Commit graph

899 commits

Author SHA1 Message Date
jianglai
bae5038b0a Re-apply server prohibited status codes in domain update for locked-down TLDs
For TLDs with domain create restriction. SERVER_TRANSFER_PROHIBITED and SERVER_UPDATE_PROHIBITED status codes
are automatically applied to newly created domains to make them immutable. When there is a legitimate for an update on a domain, the registry must first run nomulus update_server_locks to remove status before the registrar can request an update via EPP.

To eliminate the risk of the registry forgetting to reapply the codes after a update, we automatically re-apply these codes after a success update.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152533379
2017-04-10 13:49:21 -04:00
mountford
4f94464eaf Allow RdeStagingAction to be invoked manually
RdeStagingAction always processed all RDE and BRDA deposits currently outstanding, updating the cursors appropriately and kicking off the upload job. Sometimes we don't want all that. We just want to create a specific deposit by hand, without modifying the cursors or uploading. This CL adds parameters to support that.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152415959
2017-04-10 13:47:51 -04:00
mcilwain
08009e755f Don't include "Command" suffix in WHOIS metrics command name label
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152414152
2017-04-10 13:46:21 -04:00
nickfelt
5081d780dc Add assertTldsExist(Iterable<String>) to check multiple TLDs at once
This is better than calling assertTldExists() inside a for loop because you can throw a single exception reporting all bad TLDs at once rather than only getting as far as the first failure.  And then it's also a one-liner instead of 3 lines.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152412876
2017-04-10 13:44:52 -04:00
mountford
5127aeafb5 Enable authentication/authorization checks
The code to authenticate and authorize incoming requests (including via OAuth) has been in the system. This CL actually turns it on, since we are satisfied from logging information that it is not unjustly denying access.

Auth settings are also updated on a few commands missed earlier.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152381820
2017-04-10 13:41:51 -04:00
Ben McIlwain
bd696b4b92 Remove invalid {css $name} syntax
{css $foo} does not do anything. the correct syntax is

{css selector} (no dollar sign)
or
{css $prefix, selector}

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152375039
2017-04-10 13:40:21 -04:00
nickfelt
2be31e79ef Convert DeletionRequest to use @AutoValue.Builder
It has 5 parameters, which is pushing it for a static factory method, and we're anticipating adding more for work that Larry is doing.  Using a builder is preferable here since it makes it harder to accidentally mis-order the parameters (since @AutoValue's generated constructor is sensitive to parameter ordering).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152328220
2017-04-10 13:38:47 -04:00
mcilwain
4606b1d08e Only inject EPP metric builder in a single place
This fixes recording of number of attempts and command name on EPP
flows, which was broken because a separate metric builder was
being injected in two places, EppController and FlowRunner, with the
one injected into FlowRunner being discarded rather than having changes
applied to the same instance as in EppController.

This also adds a test that the metric is created successfully inside
a flow. Note that tests already exist for EppController to ensure that
the metric is recorded correctly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152306596
2017-04-10 13:37:18 -04:00
nickfelt
794743c7bc Fix registrar console to show type-less registrar contacts
RegistrarContacts are allowed to have no "types" specified (they can also have multiple types).  However, the registrar console displays the contacts for the logged-in registrar grouped by type into sections, and contacts with no type were simply being omitted from the listing, which was confusing because you can't even log into the console unless your email is listed as a contact, and yet you might then visit the contact settings page and see (apparently) no configured contacts.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152302159
2017-04-10 13:35:44 -04:00
jianglai
09393dc8ce Apply status during creation for domain create restricted TLDs
When a TLD is domain create restricted, every domain that is created under it will have both SERVER_TRANSFER_PROHIBITED and SERVER_UPDATE_PROHIBITED status applied on it. This way after a domain is created no registrar can change any settings on it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152266535
2017-04-10 13:34:12 -04:00
larryruili
69cf0d4b55 Add response information to TldFanoutAction
TldFanoutAction now returns an HTTP response detailing the actions it's taking.
The format is as follows:

OK: Launched the following 3 tasks in queue the-queue
- Task: task-a6ad250b-a9d8-427d-bbf7-eb736e6f4dcb, tld: com, endpoint: /the/servlet/com
- Task: task-cf6c4bb4-0542-411e-ae4d-723beec09e9c, tld: net, endpoint: /the/servlet/net
- Task: task-57899661-fc3f-4049-a265-d6604051406e, tld: org, endpoint: /the/servlet/org

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152264954
2017-04-10 13:32:41 -04:00
jianglai
87a9d27299 Remove domain create restriction check in non-create flows
Since domain create restriction only applies to closed TLDs, flows like domain application create and domain application update does not apply, as the TLD never goes through sunrise period. Removing checks for domain create restrictions in these flows.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152260673
2017-04-10 13:31:11 -04:00
guyben
47870f98eb Add UpdateKmsKeyringCommand to update keys in the KMS Keyring
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152253868
2017-04-10 13:26:43 -04:00
nickfelt
ef3977e837 Remove unused injected ClientScopeQualifier
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152253768
2017-04-10 13:25:11 -04:00
larryruili
7359cc13b8 Implement retry for transient errors in WHOIS server
We now attempt to retry Whois queries in the event of a short-lived error. Currently, we consider 'DatastoreTimeoutException' and 'DatastoreFailureException' as transient.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152044934
2017-04-05 10:18:23 -04:00
guyben
c3df4e26a3 Add GetKeyringSecretCommand to retrieve keyring secrets.
Cloned from CL 149476124 by 'g4 patch'.
Original change by shikhman@shikhman:registry-secrets-2:897:citc on 2017/03/07 15:37:09.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151950797
2017-04-05 10:13:45 -04:00
mountford
62c7a3935a Add nomulus tool command to delete a TLD
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151863632
2017-04-05 10:10:38 -04:00
guyben
bb70fcb66d Refactor KmsKeyring and KmsUpdater to use a centralized serializer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151853998
2017-04-05 10:09:06 -04:00
jianglai
ff9c72097c Add Registrar Account Data view in BigQuery snapshot
This adds a new view table that contains the registrar id, the currency-specific billing account id and the corresponding currency in latest_billing dataset based on latest_snapshot dataset.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151363209
2017-04-05 10:06:04 -04:00
jianglai
190be064cb Add billingAccountId to BillingData table
Join RegistrarAccountId table to BillingData to append additional billingAccountId column

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151362466
2017-04-05 10:04:32 -04:00
nickfelt
91c2558feb Make FlowRunner log ICANN activity report field name
As part of b/36599833, this makes FlowRunner log the appropriate ICANN activity
report field name for each flow it runs as part of a structured JSON log
statement which can be parsed to generate ICANN activity reports (under the key
"icannActivityReportField").

In order to support this, we introduce an annotation for Flow classes called
@ReportingSpec and a corresponding enum of values for this annotation, which is
IcannReportingTypes.ActivityReportField, that stores the mapping of constant
enum values to field names.

The mapping from flows to fields is fairly obvious, with three exceptions:

 - Application flows are all accounted under domains, since applications are
   technically just deferred domain creates within the EPP protocol
 - ClaimsCheckFlow is counted as a domain check
 - DomainAllocateFlow is counted as a domain create

In addition, I've added tests to all the corresponding flows that we are
indeed logging what we expect.

We'll also need to log the TLD for this to be useful, but I'm doing that in a
follow-up CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151283411
2017-03-27 13:32:57 -04:00
mcilwain
b03bd3b525 Remove UNRESERVED as a reservation type
This is a follow-up to Lai's refactoring of the get reservation types
code to return a set rather than a single type. Since we're always
returning a set now, the more natural way to represent a label that is
not reserved is to return an empty set rather than a set containing
UNRESERVED.

Also fixes some minor style issues I ran across regarding static
importing and test method naming that I ran across (no logic
implications).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151132116
2017-03-27 13:31:33 -04:00
mcilwain
4260fb573f Use the actual EPP command flow name for EppMetrics
It was previously only using the name of the inner command XML element,
e.g. "Create", "Delete", "Update", etc. This wasn't very useful because
there was no way to discriminate between operations on different types
of EPP resources.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151131491
2017-03-27 13:30:05 -04:00
nickfelt
0d32b6b7b2 Remove MakeBillingTablesCommand credit data views
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151130847
2017-03-27 13:28:33 -04:00
ctingue
c6a1c3d870 Clean up minor items found during DiRT
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151125802
2017-03-27 13:25:35 -04:00
mmuller
5ffb424682 Add a "loadtest" command to nomulus tool
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151034721
2017-03-27 13:16:35 -04:00
nickfelt
59ce636bb2 Mark registrar credit model classes as incomplete
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151031744
2017-03-27 13:15:06 -04:00
nickfelt
2b2a00216f Remove unnecessary semicolon after one-line constructor
It's causing a warning in Eclipse.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151029304
2017-03-27 13:13:30 -04:00
nickfelt
aa35d74900 Remove UpdateCreditsCommand
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151023241
2017-03-27 13:12:00 -04:00
jianglai
d7e2009ddf Add billing account map to Registrar entity
A CurrencyUnit-to-BillingAccountEntry map is persisted in the Registrar entity. It provides flexibility for billing systems that assign different account ids for accounts under different currencies of the same registrar.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151022753
2017-03-27 13:10:29 -04:00
nickfelt
ab9b7c613d Remove now-unused RegistryData SQL columns
These columns were only necessary to support the old PremiumListData and
RecurringEventData views, which were removed in []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151019824
2017-03-27 13:08:55 -04:00
nickfelt
dfce7608e7 Remove billing data query Registry 1.0 vestiges
These were a few straggling special cases to deal with Registry 1.0 data;
that data was removed ages ago and I just never got around to cleaning these
up.  This removes them at long last.

There were also some TODOs for the same bug around better TLD extraction that
supports multi-part TLDs (though that's pretty unrelated to Registry 1.0/2.0),
so I fixed those since it turns out supporting multi-part TLDs is trivial.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151003181
2017-03-27 13:05:51 -04:00
nickfelt
ec4ffe53f0 Clean up flow validation of registration periods
This tidies up some logic in the flows that checks registration periods, so that in the create flows we're consistently checking that the requested number of years is <= 10 right away (DomainCreateFlow was deferring it until very late, including after custom logic ran, for no good reason I can see).

It also refactors the validateRegistrationPeriod() overload used by DomainRenewFlow to take the newExpirationTime directly, and just check to ensure that it's >= to now.plusYears(10) (with leap-safety just in case).  This is a much simpler check than before, which recomputed the newExpirationTime separately from the logic used by DomainRenewFlow itself (always dangerous) and did a more convoluted and unnecessary comparison involving extendRegistrationWithCap().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151002960
2017-03-27 13:04:19 -04:00
nickfelt
3a18d8a04f Remove straggler references to extended registration years
The actual extendedRegistrationYears field was removed in [] but I
missed a few prose (space-separated) references.

While I was at it, I also swapped the javadoc for approvePendingTransfer() and
denyPendingTransfer(), since their descriptions after the summary fragment were
reversed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150782713
2017-03-27 12:59:48 -04:00
jianglai
37440d6b29 Add nameserver validation in domain update related flows
When updating domains, make sure that if the domains are nameserver restricted, the updated nameservers set on the domains are still consistent with the restriction.

When updating domains of a domain created restricted TLD, validate if the domain is still on the reserved list with nameserver restricted reservation. If it is not, there's likely some conflicting states of the domain that needs to be reconciled (e. g.the domain is removed from the reserved list after being created). Throws an exception in this case.

Also added missing tests for TLDs with nameserver whitelist.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150781935
2017-03-27 12:58:19 -04:00
jianglai
a958d0a6c3 Add a Nomulus command to set domain create restricted status
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150665065
2017-03-21 15:43:52 -04:00
jianglai
620d698479 Add validation during domain creation for locked down TLDs
During domain create/applicationcreate/allocate, domains that are on the reserved list(s) with nameserver restricted reservation type must set nameservers that are part of the allowed nameservers for that domain in the reserved list(s) applied to that TLD.

Additionally a boolean is added to Registry to indicate if a TLD is restricting domain create. If it is, only domains that are nameserver restricted can be registered.

For consistency with a similar feature that validates a TLD-wide nameserver whitelist, the per-domain nameserver validation is performed even when the operation is in super-user mode. Similarly, if a domain is nameserver restricted, nameservers must be supplied (i. e. the nameservers set cannot be empty) when registering the domain.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150641269
2017-03-21 15:42:23 -04:00
mcilwain
582469e052 Revert upgrade to Bazel 0.4.4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150633068
2017-03-21 15:40:54 -04:00
jart
f37296c3a1 Set output_licenses on java_plugin
The fix was released in Bazel 0.4.4 a month ago.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150630179
2017-03-21 15:39:28 -04:00
nickfelt
232132eac0 Remove XsrfTokenManager fallback for validating legacy tokens
This is the third step of migrating to the new format: removing support
for the legacy format.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150512556
2017-03-21 15:36:31 -04:00
nickfelt
09f619cce2 Remove obsolete TransferData.extendedRegistrationYears
Now that transfers are always restricted to 1 year, it's unnecessary to store
extendedRegistrationYears on TransferData - it will always be equal to 1.  This
simplifies logic in a few other places, e.g. RdeDomainImportAction.

I verified in BigQuery that no DomainBases exist with extendedRegistrationYears
values that aren't either null or equal to 1.  At some point we should remove
the persisted fields from datastore via e.g. resaving all those domains, but
it's low priority and can wait until we have some more pressing migration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150373897
2017-03-21 15:35:00 -04:00
nickfelt
70fbdccea2 Restrict domain transfer pricing to 1 year
This CL restricts domain transfer pricing lookups (on domain check and info) to
only support a 1-year period for inquiring about transfer fees.  That treatment
matches what we do for domain restores, which are also always one year.  This is
a followup to [] which disallowed actual transfer request flows from
specifying multi-year periods.

Since it's no longer necessary, this CL also changes the domain transfer pricing
logic to drop the years parameter, including removing the parameter from the
custom pricing logic TransferPriceParameters object.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150367839
2017-03-21 15:33:29 -04:00
mountford
ff70494bd8 Capitalize the Bloom in Bloom filter in comments
(Because it's someone's name.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150353742
2017-03-21 15:30:30 -04:00
nickfelt
bd6a2d02dd Fix stale documentation on {ForeignKeyed,}DesignatedContact
Noticed that this is a bit out-out-date ever since these were
split into two types versus using the converters.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150352102
2017-03-21 15:28:58 -04:00
mountford
c2cbb9ea5a Define Stackdriver metrics for premium list checks
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150349564
2017-03-21 15:25:59 -04:00
ctingue
443e260f91 Disallow renaming of external hosts
EPP host spec section 3.2.5 requires that attempts to update hosts that are linked to different registrars must fail with error code 2305. This is complicated to do, as linked status is eventually consistent, and even more painful when checking links to those of different registrars.

This change forbids external-to-anything renames entirely.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150336754
2017-03-21 15:24:28 -04:00
nickfelt
e1c9395749 Simplify blocking of renews for domains in pending transfer
This tweaks the logic that prohibits domain renews during pending transfers to just use the regular verifyNoDisallowedStatuses() check instead of a special check on TransferData with a custom exception.  This is simpler and produces a better error message: we get "Operation disallowed by status: pendingTransfer" instead of "Object with given ID (foo.com) already has a pending transfer" (which is intended for use when denying a transfer request for an object already being transferred, not for this case).

For the record, we originally prohibited renews for domains in pending transfer because there's no good reason to do such a renew: b/12533793.  But in fact our transfer server-approve logic relies heavily on this behavior, because otherwise the domain's expiration time computed in cloneProjectedAtTime() will reflect the transfer year added to the post-renew expiration time, whereas all the transfer server approve entities (e.g. new autorenew billing event) will reflect the pre-renew expiration time at the moment the transfer was requested.  As such, it would be quite difficult to ever support a renew during pending transfer, since it would need to change many fields within the transfer server approve entities.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150325501
2017-03-21 15:21:28 -04:00
nickfelt
4d20490258 Remove unused method from PollMessage.OneTime
This was created during the Registry 2.0 migration for use by a scrap servlet ([] and never removed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150325126
2017-03-21 15:20:01 -04:00
nickfelt
d8349aa0ee Standardize usage of some transfer flow verification helpers
We were using verifyHasPendingTransfer() only in the domain transfer flows; now we use it in both.  I also added a helper verifyTransferInitiator() even though it's only used in two places (the transfer cancel flows), because I think it streamlines the flow and makes it more consistent with the whole section of verification checking.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150324823
2017-03-21 15:18:33 -04:00
mcilwain
7622e71dcf Add Cloud KMS as dependency of eclipse package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150321468
2017-03-21 15:17:04 -04:00