Commit graph

1886 commits

Author SHA1 Message Date
jianglai
27c1765ab4 Fix Bazel build breakage introduced in []
This is no way to make Blaze and Bazel happy at the same point. Without [] Blaze complains about import orders. However the new order breaks Bazel. Bazel suggested to add a suppression to suppress order check, which fixes the Bazel problem, but the suppression string is not recognized by Blaze.

I cannot think of another way to solve this other than MOE. Luckily we'll delete all the BUILD files when we move to Gradle anyway.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=237501133
2019-03-08 18:36:36 -05:00
jianglai
b573b10ae1 Remove backported MockitoJUnitRule
Mockito in third_party is updated to 1.10. We do not need to backport this rule anymore.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=237496086
2019-03-08 18:35:00 -05:00
tjgq
5056e48363 Fix linter errors introduced by CL 236568443.
Note that the Bazel closure rules run the linter at head, while fixjs/cider/critique/etc run the released version, so they will complain about the formatting introduced by this CL until a new release is out.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=237358273
2019-03-08 18:33:25 -05:00
jianglai
90e298fb39 Only show OT&E admin actions when not in production environment
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=237061813
2019-03-08 18:27:11 -05:00
shicong
6b9b60d38c Remove all CSS animations to reduce flakiness
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=237045320
2019-03-08 18:25:36 -05:00
weiminyu
98cce20899 Set up domain-registry proxy in Crash environment
- Created configs for Proxy server, GKE, and terraform
- Created sans_list file for use with tarsier client
- Updated allowedClients in registry server

TODO: Update dr-bashrc to support crash environment

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=236659249
2019-03-05 14:25:01 -05:00
Weimin Yu
69b7815dd0 Update create registrar form
Changed the order of the create registrar form fields and updated the delegate email and country code labels to be more intuitive

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=236354256
2019-03-05 14:22:09 -05:00
guyben
847795d58d Remove the web console EPP endpoint
This removes the "create Domain/Host/Contact" forms that were supposed to be used instead of regular EPPs for CC-TLD that wanted to support it.

We're removing it because we don't use it and want to reduce unneeded code for the registry 3.0 migration.

Also, this is a security risk, as it allowed to do "billable actions" (creating a new domain for example) with the only authentication being access to the registrar's G Suite account.

This bypassed the certificate, IP whitelist, and EPP password, which is bad.

PUBLIC:
Remove the web console EPP endpoint

This removes the "create Domain/Host/Contact" forms that were supposed to be used instead of regular EPPs for CC-TLD that wanted to support it.

We're removing it because we don't use it and want to reduce unneeded code for the registry 3.0 migration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=236244195
2019-03-05 14:20:42 -05:00
jianglai
4418d45595 Do not require auth info in super user transfer
Super users can look up auth info in Datastore or BigQuery backup anyway.
Requiring it only adds friction when using the super user extension, without
any additional security benefit.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=235786090
2019-03-05 14:17:42 -05:00
guyben
5b94364bb9 Set the registrar WHOIS email in the web console creation endpoint
We set the initial value to the "icann referral email", but registrars can change it later if they want.

Although this value isn't strictly required, we assume it exists in the spec11 report.

Also changed the name of the contact email from "email" to "consoleUserEmail"

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=235734200
2019-03-05 14:14:46 -05:00
gbrodman
7ddd8b55d2 Set domain create fee cost to be 0 for anchor tenants
We already properly remove EAP fees for anchor tenants.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=235529469
2019-03-05 14:11:36 -05:00
jianglai
8fac22f0f3 Fix .bzl files with buildifier
This CL fixes .bzl files to make them compatible with the next versions of Bazel. This is done by running the following command on all the .bzl files:

    buildifier --lint=fix --warnings=attr-non-empty,attr-single-file,ctx-actions,output-group

More information: []

Tested:
    tap_presubmit
    Some tests failed; test failures are believed to be unrelated to this CL

BEGIN_PUBLIC
Internal cleanup
END_PUBLIC

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=235192309
2019-02-25 11:13:08 -05:00
jianglai
468808723a Move domain registry terraform configs
We are moving toward using GitHub as the source of truth for the domain registry project (Nomulus). As such, the piper location will soon be deleted, along with it the terraform configs. These files are copied to the canonical location []

Note that the files under modules will still be present in the open source code base as it allows open source users to set up the project quickly. The files under envs are specific to each actual project and is removed entirely from the open source code (it was excluded by MOE before).

Some files are renamed to conform to the newly established terraform code style.

There was a remaining regarding using latchkey to set up IAM policies that I intend to punt for now. I imagine if we decide to use latchkey, it means that the IAM related terraform configs will be removed for the Annealing set up. However we would still like to leave that in the open source configs such that it still is a one-stop shop to set up your project.

The automation mode is set to DRYRUN so that there are no accidental changes to our projects during .dev launch. It will be changed back later.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=234838043
2019-02-25 11:13:08 -05:00
mcilwain
94a2681127 Send deletion poll messages when requested by superuser
Otherwise, registrars will never receive a notification through EPP that a
domain has been synchronously deleted by us.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=234172289
2019-02-18 17:34:36 -05:00
mcilwain
067756722d Change nomulus registrar --drive_id parameter to --drive_folder_id
This makes it consistent with the parameter of the same name on the tld commands.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=234148699
2019-02-18 17:32:57 -05:00
jianglai
4241c7658f Add admin page link to create new registrar
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233956155
2019-02-14 16:08:57 -05:00
guyben
4097dae3b2 Only inject @Parameter-created variables in the Action itself
Icann reports have 3 parameter-provided injections:

- yearMonth
- subdir
- reportType

We move all of them away from the "inner classes" and only @Inject them in the Actions themselves.

This has 2 benefits:
- it's much clearer what all the parameter inputs of the Actions are
- the "inner injected classes" don't assume anything about the Action that uses them - they will work just as well for JSON actions as for "regular" actions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233625765
2019-02-13 16:07:45 -05:00
mcilwain
49ac4e3e69 Improve Datastore efficiency of duplicate contact messages
I should have caught this in the review, but [] is loading *ALL*
contacts individually from Datastore on every domain update. This will add a
large number of Datastore round trips and thus significantly reduce update
performance.

This CL changes the behavior to *ONLY* load contacts when there is a duplicate
(which is needed to determine the contact's display name to generate the error
message), and loads all of them in a single batch rather than individually.

This also makes some minor changes around domain getters returning empty sets
instead of null.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233128140
2019-02-11 11:22:34 -05:00
shicong
71d65ed73a Add detailed log when DuplicateContactForRoleException is thrown
This change also added a test to verify that EPP request to modify
both contacts and registrant at same time can be handled as expected.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232935690
2019-02-08 11:20:21 -05:00
shicong
c2445c3797 Rename loadByForeignKeys to loadByForeignKeysCached
This is to remind the user that the function actually uses cache, and also
for naming consistency with EppResourceUtils.loadByForeignKeyCached().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232870846
2019-02-08 11:17:38 -05:00
gbrodman
93ff541006 Handle sunrise reservations properly during sunrise TLDs
We figure out the TLD state so that we properly check whether or not we can provision sunrise domains in that TLD. We also change the message slightly so that it's a bit more clear when we aren't in sunrise.

Note: it is deliberate that NAME_COLLISION reservations are provisionable in sunrise.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232742813
2019-02-06 18:06:21 -05:00
jianglai
7fe16689d8 Change redacted output for domain whois query
The redacted text for the email field displays a longer prompt to
contact the registrar, per the request filed at b/123573370.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232716133
2019-02-06 18:03:11 -05:00
mcilwain
29d3ad8052 Switch to constructor injection in a few actions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232552406
2019-02-06 17:53:49 -05:00
guyben
927e8bbd73 Move LocalDate injection to the Actions themselves
We want to make it clear what query (or POST) inputs the user needs to / can give for each Action. That means moving all the @Injects of these parameters to the Actions themselves instead of injecting them in "hidden" indirect dependencies.

This has the extra benefit of allowing these indirect dependencies to work for JSON Actions as well, since the "regular" way we @Inject parameters can corrupt the POST JSON data.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232540758
2019-02-06 17:52:16 -05:00
gbrodman
058ef07e16 Fix some style issues that will help us out later
These files will have errors later when we run the Google Java Format plugin over their entirety (e.g. a situation where fixed indentation leads to a line that's longer than 100 characters). It's simpler to fix them now so we won't have to fix them later.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232353791
2019-02-06 17:47:37 -05:00
mcilwain
339202e879 Delete the mapreduce poll action
We never used it for anything.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232024489
2019-02-01 16:24:37 -05:00
mcilwain
f01ded3fa7 Make logged response in NordnUploadAction intelligible
Right now it's logging the raw bytes, which look like:

response data: [65, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 114, 101, 113, 117, 105, 114, 101, 100]

We'd rather convert it to ASCII characters (what the NORDN service uses) before
logging it, so that it'd instead look like:

response data: Authorization required

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231998658
2019-02-01 16:20:01 -05:00
guyben
c5ad30f49d Prevent spellchecking from textarea fields
The spellchecking causes test flakiness.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231984097
2019-02-01 16:18:24 -05:00
mcilwain
3812c2ceda Use -dot- subdomain notation in MapReduce console links
appspot.com is not provisioned with a multi-level wildcard SSL certificate, so
URLs of the form https://service.projectid.appspot.com/path need to be rewritten
as https://service-dot-projectid.appspot.com/path (and same for version names).

This is a follow-up to []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231418795
2019-01-31 13:59:05 -05:00
gbrodman
6e0b8f2cfd Pass the date field in to the Spec11 Soy template
The daily template is the only one that needs it but we can always pass it in without issue.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231295089
2019-01-31 13:57:30 -05:00
mcilwain
2edb072e68 Delete the deprecated RegistrarBillingEntry Datastore index
This should have been deleted in [] when the underlying entity was
deleted, but it was missed. It's been a no-op since then. This is just cleanup.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231293033
2019-01-31 13:55:52 -05:00
mcilwain
88aa13d1a4 Log a warning when MarksDB password isn't configured
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231287550
2019-01-31 13:51:10 -05:00
mcilwain
5dedc1e889 Delete everything related to RDE import
This code was never finished or fully working anyway.  It would require
substantial reworking for the Registry 3.0 migration because it's closely tied
to the Datastore model and App Engine MapReduce framework, both of which will be
going away.  We can bring back some of these deleted test files as necessary
if/when we rewrite RDE import for the new schema.

On the plus side, in a relational database, RDE import will be much simpler.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231265578
2019-01-28 16:16:36 -05:00
mcilwain
f0c677b18b Rename DNL and SMDRL "login" to "loginAndPassword"
They are passed around in the format username:password, whereas just saying
"login" implies it's just a username and not necessarily also a secret
password. Putting password in the variable name makes it obvious what this is
and reduces the likelihood of anyone ever logging it or otherwise using it
inappropriately.

Note that this does not require data migrations as the actual key used to store
the data in KMS remains unchanged.

This is a follow-up to []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231253964
2019-01-28 16:15:04 -05:00
mcilwain
0130f91830 Add logging to DNL fetch action
This will help us to debug the current MarksDB issue.  This also throws an explicit error earlier when attempting to connect to MarksDB without login credentials being specified, which we know will fail.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231236317
2019-01-28 16:13:27 -05:00
gbrodman
5272d8ca7f Make a prettier table to display OT&E check results
We now display the results of each check in addition to the overall result.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=231051913
2019-01-28 16:10:16 -05:00
mcilwain
c6e58d3bff Fix some issues caught by IntelliJ static code analysis
The most common issues were:
* Arrays.asList() shouldn't be called with a single parameter.
* Broken Javadoc @links.
* Unnecessary casts and type declarations.
* Unnecessary unused variable initializations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230994311
2019-01-28 16:08:24 -05:00
gbrodman
3cf26ff9b6 Fix various Error Prone errors that were found by the FOSS build
Most common:
- Unnecessary parentheses and operator precedence clarify (self-explanatory)
- Reference equality--there were a few instances of using == or != improperly
- Qualification of Builder (and similar) imports so that it's clear which type of Builder we're referring to
- Marking some immutable classes with @Immutable since EP desires that all enums be deeply immutable
- String.split() having "surprising behavior"

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230971531
2019-01-28 16:05:09 -05:00
mcilwain
5b0c61dad3 Use simpler Iterables helper when counting domains
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230955066
2019-01-28 16:01:55 -05:00
guyben
5a8760570c Fix RDE reducer broken in []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230945703
2019-01-28 16:00:19 -05:00
weiminyu
4213e9246c Update the latest_datastore_export view in Bigquery
This view used to point to the latest datastore backup
using the deprecated export mechanism, which has been
disabled. We will point this view to the new backups.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230930872
2019-01-28 15:58:44 -05:00
mcilwain
e2528875b2 Merge DomainResource into DomainBase
This eliminates the use of Objectify polymorphism for EPP resources entirely
(yay!), which makes the Registry 3.0 database migration easier.

It is unfortunate that the naming parallelism of EppResources is lost between
ContactResource, HostResource, and DomainResource, but the actual type as far as
Datastore was concerned was DomainBase all along, and it would be a much more
substantial data migration to allow us to continue using the class name
DomainResource now that we're no longer using Objectify polymorphism. This
simply isn't worth it.

This also removes the polymorphic Datastore indexes (which will no longer
function as of this change). The non-polymorphic replacement indexes were added
in []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230930546
2019-01-28 15:57:10 -05:00
mcilwain
97c2049669 Catch errors when attempting to delete entities through Objectify
This is currently erroring out on entities that fail to load properly through Objectify (e.g. because their entity type is no longer registered).  The proper thing to do is to catch the error, log it, and fall back to the raw Datastore operation, which will succeed.

The exact Exception this is designed to catch is:

com.google.apphosting.runtime.jetty9.JettyLogger warn: /_dr/admin/deleteEntity (JettyLogger.java:29)
java.lang.IllegalStateException: No registered subclass for discriminator 'DomainApplication'
	at com.googlecode.objectify.v4.impl.PolymorphicEntityMetadata.getConcrete(PolymorphicEntityMetadata.java:133)
	at com.googlecode.objectify.v4.impl.PolymorphicEntityMetadata.load(PolymorphicEntityMetadata.java:164)
	at com.googlecode.objectify.v4.impl.LoadEngine.load(LoadEngine.java:220)
	at com.googlecode.objectify.v4.impl.LoadEngine$1.nowUncached(LoadEngine.java:178)
	at com.googlecode.objectify.v4.impl.LoadEngine$1.nowUncached(LoadEngine.java:164)
	at com.googlecode.objectify.v4.util.ResultCache.now(ResultCache.java:30)
	at com.googlecode.objectify.v4.impl.Round$1.nowUncached(Round.java:73)
	at com.googlecode.objectify.v4.util.ResultCache.now(ResultCache.java:30)
	at com.googlecode.objectify.v4.LoadResult.now(LoadResult.java:25)
	at google.registry.tools.server.DeleteEntityAction.loadOfyEntity(DeleteEntityAction.java:103)
	at google.registry.tools.server.DeleteEntityAction.run(DeleteEntityAction.java:74)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230737553
2019-01-24 20:02:04 -05:00
weiminyu
acbd23fa64 Remove deprecated Datastore backup code
Removed three Action classes and the CheckSnapshot command.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230545631
2019-01-24 19:58:54 -05:00
gbrodman
701ebc6a28 Fix a few stylistic issues in preparation for Checkstyle addition
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230524735
2019-01-24 19:57:14 -05:00
mcilwain
40540b1846 Add non-polymorphic DomainBase indexes
These indxes do not include the ^i field like the current ones do.

We'll need these so that we can properly index into the DomainBase entities once
DomainResource is merged into them (which will cause us to lose the value of the
^i field).

The migration plan is to push next week's release with these new indexes, then
run the re-save all EPP resources action to populate them, and then eventually
remove the ^i versions of the indexes, retaining only these newly added ones,
once the DomainBase/DomainResource merge is accomplished.

TESTED=Deployed to alpha, ran the re-save all EPP resources mapreduce, and
verified that the new indexes were populated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229992464
2019-01-18 17:30:43 -05:00
gbrodman
5f87c3bff3 Add a button in the admin panel to check OT&E status of a registrar
For now, it only displays a status of "Passed: true|false" or an error message in simple text. In further work we will make the UI nicer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229971564
2019-01-18 15:35:40 -05:00
mmuller
87ab149049 Externalize premium/reserved list tests
Remove the GoogleInternal designator on the premium/reserved list tests, move
the lists themselves under the config/files directory, and fix all of the
surrounding infrastructure.

The lists do not get exported.  Only the "example.txt" list does, allowing the
test to function on the open source build.

TESTED:
  Verified that the gradle build works and that only the example.txt file is exported.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229940659
2019-01-18 15:34:06 -05:00
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
9aa7b69921 Add web console for creating registrars
This console is only to be used by Admins (either GAE admins for this project, or Support accounts). It is for "internal" use only, not for use by the registrars themselves.

To prevent abuse, the registrar is created in a non-functional PENDING state and can only be made functional from the nomulus shell tool.

While in "PENDING" state, the registrar can be updated from the registrar-console by admins.

Also - moving all the web consoles to the same directory (moving the otesetup/* files into registrar/)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229681011
2019-01-17 19:19:09 -05:00