Commit graph

18 commits

Author SHA1 Message Date
mcilwain
d2ee63cf69 Consolidate Dagger modules for utils classes
There was no reason to have several different modules all providing a single
thing. This approach, which creates a single UtilsModule for everything in the
util package, is cleaner. This also removes provisioning of Random and
StringGenerator objects in RegistryConfig.ConfigModule, which don't belong
there because they aren't configuration options.

This also removes insecure random entirely; it was only used in a
single place to generate 24 bytes a couple times per day. We can live with the
lower speed if it means we don't have to worry about multiple types of Random,
or possibly using an insecure random accidentally in a place that security
actually does matter.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229751915
2019-01-17 19:20:52 -05:00
guyben
557984bb75 Add support G-Suite group whose members have ADMIN access to registrar console
After this CL, "support" accounts (accounts that are part of the "support" G-Suite group) will the same access to the registrar console as GCP "admins". However, they don't won't have access to the GCP project itself.

We could give them their own Role in the future (say SUPPORT) and give them different access than "admins", but right now we don't need it and YAGNI or something :)

NOTE: we identify users by their email (they need to be logged in to a google account). I don't know if that's best practice, since I guess different google accounts might have the same email address. However, G-Suite groups' membership is by email so there's not much we can do about it if we want to use G-Suite groups.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220804273
2018-11-12 14:51:40 -05:00
guyben
3f6585fccc Reduce duplicate code in the servlets
Currently, all 4 servlets (backend, frontend, pubapi, tools) have duplicates of
the same exact code.

That's an anti-pattern!

Created a ServletBase they can all extend which has the duplicate code.

As a bonus, the tools servlet now runs the metric reporter, meaning tool
related metrics will now be reported!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219792176
2018-11-02 14:44:22 -04:00
guyben
a45d3d3bc7 Add a log statement at the very end of our code
Having a log at the very begining of "our" code helped us find issues with
App-Engine's dispatcher, where we could clearly see in the logs that "our" code
started many seconds after the request came in.

We now suspect there is something similar going on after the end of "our" code
- where the reply is sent back many seconds after our code finished running.

To make sure - we add a log statement at the very last line of "our" code, so
we know exactly when it ended.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219309962
2018-10-31 19:09:51 -04:00
mcilwain
bec7a91cfc Allow choice of Keyring to be configured in YAML
This uses a Dagger-provided map of Keyring implementations, with two currently available,
"KMS" and "Dummy". The active keyring is configured in the YAML file, so we no longer
require MOE directives to choose which one to use for internal/external builds.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216898058
2018-10-17 11:48:12 -04:00
weiminyu
5038fa917c Remove outdated credential modules
All credentials provided by these modules have been
replaced by those in the config/CredentialsModule,
with a new set of Qualifiers. With Dagger 2, a successful
build means that the removal is safe.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215258792
2018-10-03 12:08:55 -04:00
weiminyu
9436ce6f0e Introduce simplified Default credential provision
As the first step in credential consolidation, we replace
injection of application default credential in for KMS and
Drive.

Tests:
- for Drive, tested with exportDomainLists and exportReservedTerms.
- For KMS, used CLI commands (get_keyring_secret and update_kms_keyring) to change and
  restore secret for one key.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211819859
2018-09-08 00:16:09 -04:00
mcilwain
6e74ba0587 Wrap ModulesService in new AppEngineServiceUtils
ModulesService does not provide a great API. Specifically, it doesn't have a
way to get the hostname for a specific service; you have to get the hostname for
a specific version as well. This is very rarely what we want, as we publish new
versions every week and don't expect old ones to hang around for very long, so
a task should execute against whatever the live version is, not whatever the
current version was back when the task was enqueued (especially because that
version might be deleted by now).

This new and improved wrapper API removes the confusion and plays better with
dependency injection to boot. We can also fold in other methods having to do
with App Engine services, whereas ModulesService was quite limited in scope.

This also has the side effect of fixing ResaveEntityAction, which is
currently broken because the tasks it's enqueuing to execute up to 30 days in
the future have the version hard-coded into the hostname, and we typically
delete old versions sooner than that.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206173763
2018-08-10 13:44:25 -04:00
mcilwain
b5412adba9 Clean up Guava imports in BUILD files
This removes the following unnecessary imports:

[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]

The exact command run to generate this CL was:

build_cleaner '//third_party/java_src/gtld/...' -c '' --dep_restrictions='[],[],[],[],[],[],[],[],[],[],[],[],[],[]'

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202325520
2018-06-27 15:28:53 -04:00
mcilwain
43ed2cd7b3 Clean up annotation imports in BUILD files
This affects JSR305, JSR330, and Guava annotations.

The exact command run to generate this CL was:

build_cleaner '//third_party/java_src/gtld/...' -c '' --dep_restrictions='//third_party/java/jsr330_inject,//third_party/java/jsr305_annotations,[]'

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202322747
2018-06-27 15:28:53 -04:00
mcilwain
4c7bc3b18c Improve internal build system speed
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202016862
2018-06-27 15:28:52 -04:00
Ben McIlwain
0422205d84 Start using non-EPP-flow-wrapping implementation in CheckAPI
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201620090
2018-06-27 15:28:52 -04:00
mcilwain
8b263baefa Delete MultiplyingCloudDnsWriter
Now that the large zone re-signing test is complete, we no longer need it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199507075
2018-06-27 15:28:06 -04:00
mcilwain
9097a32cc8 Remove web & protocol WHOIS, check API, and RDAP from frontend
These are now handled by the pubapi service and all publicly facing sites that
were using these APIs have already been migrated over.

For documentation on the newly added dispatch.xml file, see:
https://cloud.google.com/appengine/docs/standard/java/config/dispatchref

Note that the --auto_update_dispatch parameter needs to be passed to the
`appcfg update` command in order to apply this new XML file.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200441580
2018-06-18 18:07:53 -04:00
Ben McIlwain
c61f36502e Add a new check API that does not wrap the domain check EPP flow
Copied class and test from CheckApiAction. All unit tests passing.

Remaining work: add metrics

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198916177
2018-06-06 15:05:30 -04:00
jianglai
70b13596e4 Migrate to Flogger (green)
This is a 'green' Flogger migration CL. Green CLs are intended to be as
safe as possible and should be easy to review and submit.

No changes should be necessary to the code itself prior to submission,
but small changes to BUILD files may be required.

Changes within files are completely independent of each other, so this CL
can be safely split up for review using tools such as Rosie.

For more information, see []
Base CL: 197826149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198560170
2018-05-30 12:18:54 -04:00
jianglai
fc60890136 Migrate to internal FormattingLogger in preparation of migration to Flogger
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197744904
2018-05-30 12:18:54 -04:00
mcilwain
ac500652ac Add "pubapi" App Engine service for check API, WHOIS, and RDAP
The migration plan is as follows:
1. This CL, which adds the new "pubapi" service that serves the check API, WHOIS, and RDAP.
2a. Update our public facing sites to switch over to use the new service.
2b. (either order) Rewrite the check API to remove dependencies on flows.
3. ... eventually, once the frontend service is no longer being hit by this traffic, remove its handling of these public endpoints.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197716346
2018-05-30 12:18:54 -04:00