Commit graph

65 commits

Author SHA1 Message Date
mcilwain
1c4e79f99e Don't allow non-active registrars to create domains or applications
Specifically, this prevents suspended registrars from creating domains or applications. Pending registrars already can't perform these actions because they get an error message when attempting to log in.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170481338
2017-10-04 16:16:45 -04:00
larryruili
c86fd96654 Ignore test TLDs when logging transaction creates/deletes
The probers make a constant stream of create and delete calls, which we don't
want to account for when constructing transaction reports. This change will
cause only real TLDs to log create and delete transaction records.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166737801
2017-08-29 17:18:39 -04:00
larryruili
16e8286dca Record domain transaction for domain transfers
This is the last of many cls adding explicit logging in all our domain
mutation flows to facilitate transaction reporting.

The transfer process is as follows:
GAINING sends a TransferRequest to LOSING
LOSING either acks (TransferApprove), nacks (TransferReject) or does nothing
(auto approve). For acks and autoapproves, we produce a +1 counter for GAINING
and LOSING for domain-gaining/losing-successful for each registrar, to be
reported on the approve date + the transfer grace period. For nacks, we produce
a +1 counter for domain-gaining/losing-nacked for each registrar.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166535579
2017-08-29 17:17:07 -04:00
larryruili
97581e519d Unnest transactionFieldAmount from DomainTransactionRecord
After working further with domain deletes, I realized we'll need to record multiple reportingTimes under a single historyEntry when issuing a -1 counter to cancel grace-period adds. Since the TLD would be the only shared component within a record, we'll just duplicate it across all records to save an unnecessary layer of hierarchy.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166261413
2017-08-29 17:05:15 -04:00
larryruili
c40dc67c5b Record transaction for domain adds, renews and allocates
This is the second of many cls adding explicit logging in all our domain
mutation flows to facilitate transaction reporting.

Adds and renews each result in a +1 counter for the NET_ADDS/RENEWS_#_YR field,
which I've added simple (# of years, add or renew) -> Enum functions to get.
Allocates are just a special case of adds, and are counted in a similar manner.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165963249
2017-08-29 16:56:19 -04:00
mcilwain
fcb554947c Rename buildHistory() methods to buildHistoryEntry()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165707934
2017-08-29 16:38:39 -04:00
bbilbo
e786c8d6ff Add better testing of domain and host creation using multi-part TLDs
Added validation on domain creation, preventing a domain from being created if
it equals an existing TLD. Added domain create tests for domains using
multi-part TLDs that shared suffixes and prefixes. Added host create tests for
hosts using multi-part TLDs that shared suffixes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164297749
2017-08-29 15:47:50 -04:00
cgoldfeder
ae039aa0d8 Remove all vestiges of memcache
Memcache is already off but now it's not in the code anymore.

This includes removing domain creation failfast, since that is actually
slower now than just running the flow - all you gain is a non-transactional
read over a transactional read, but the cost is that you always pay that
read, which is going to drive up latency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158183506
2017-06-14 10:28:24 -04:00
cgoldfeder
4553422ade Move domainCreateFailfast before cloneAndLinkReferences
This avoids loading all contacts and hosts before the failfast runs

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154179321
2017-04-26 11:09:23 -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
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
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
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
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
cgoldfeder
9174855a47 Remove the ofy().load() inside of HostResource.cloneProjectedAtTime
In fact, completely eviscerate cloneProjectedAtTime (to be removed in
a followup CL) in favor of doing the projection of transfers and the
loading of values from the superordinate domain at call sites. This
is one of the issues that blocked the memcache audit work, since the
load inside of cloneProjectedAtTime could not be controlled by the
caller.

Note: fixed a minor bug where a subordinate host created after its superordinate domain was last transferred should have lastTransferTime==null but was previously reporting the domain's lastTransferTime.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149769125
2017-03-13 11:22:55 -04:00
Ben McIlwain
fa5607c3e1 Use Immutable types for static final fields
For constant field declarations, you should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List). This communicates to your callers important semantic guarantees ([]

This change replaces constants (static final CONSTNAT_CASE) declaration type which use the general collection interface (e.g. List) with an immutable type (e.g. ImmutableList).

For more info, see: []

Cleanup change automatically generated by javacflume/refactory
Refactoring: //third_party/java_src/error_prone/project/core/src/main/java/com/google/errorprone/bugpatterns:MutableConstantField_refactoring
Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149010021
2017-03-07 13:34:48 -05:00
ctingue
53262d82bb Add period restriction to domain flows
Specifically, Domain[Create,Allocate,ApplicationCreate]Flow

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147458283
2017-02-14 12:14:04 -05:00
mmuller
b70f57b7c7 Update copyright year on all license headers
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146111211
2017-02-02 16:27:22 -05:00
Justin Graham
f3388326d6 Add FlowMetadata (containing isSuperuser) to custom flow logic
This also bypasses signed mark validation during domain creation if
the flow is being executed as superuser.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145435268
2017-01-25 12:25:34 -05:00
Justin Graham
2a3a17d653 Add signed mark parameter to Create flow afterValidation extension point
This is the follow up PR for #49. It adds an additional parameter to DomainCreateFlowCustomLogic.AfterValidationParameters: a nullable signed mark id.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143966945
2017-01-09 12:17:55 -05:00
Justin Graham
7fba7c1e4f Update the ordering of the DomainCreateFlow 'After Validation' extension point
Custom logic to block domain labels is currently being implemented in 'Before Save'. At that point, the default flow has already validated the SMD, premium, and reserved. Only then can we determine if we should block the label, so the 'After Validation' extension point doesn't currently fit the need.

However, as a result, if the label is blocked, but the fee extension is missing, a generic fee error is thrown, stating the fee extension must be present. We would rather state that the label is blocked. Then, if the SMD is present, we override the block, validate that the fee is present with the correct price, and allow the domain create.

The solution is to move the 'After Validation' extension point to actually be after all validation, including of the SMD, but before the fee check.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143790163
2017-01-09 12:01:03 -05:00
mcilwain
8252e97dfb Break domain flow TMCH helper methods into separate injected class
This is a necessary prerequisite to subsequently injecting the configuration
dependencies.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143567753
2017-01-09 11:59:04 -05:00
mcilwain
0b112f17a7 Move ROID suffix handling from RegistryConfig to ConfigModule
This is the first in a decently long series of commits to delete RegistryConfig
entirely and centralize all configuration in ConfigModule using Dagger. Once
this is done, then the text-based YAML configuration work can begin in earnest.

Note that the configuration settings from TestRegistryConfig will be moving
into ConfigModule.LocalTestConfig. This way they can be referred to in a static
context from test and test utility helpers, rather than having to be injected
everywhere, which we don't typically bother with for tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143473089
2017-01-09 11:59:04 -05:00
mcilwain
6fb9858198 Remove the unused flags extension
It can always be brought back if we find an actual use case for it, but for now, it shouldn't be in the standard distribution given that it has no users.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143044153
2017-01-09 11:59:04 -05:00
mcilwain
9d9c527917 Reconcile FeesAndCredits handling in price customization
Also adds a mechanism to ensure that fee extensions are included when custom
pricing logic adds a custom fee, and fixes up the domain restore flow to
properly use the restore price.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142715136
2016-12-22 16:09:14 -05:00
jianglai
74d64f502e Modify create price custom logic to return FeesAndCredits
Previously DomainPricingCustomLogic#customizeCreatePrice takes in the create
price itself and modifies it. Change it to take in the entire FeesAndCredits (previously named EppCommandOperations) which may contain other fees related to domain creation,
such as EAP fees, and returns FeesAndCredits that may either change the
fees or add new type of fees.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141600614
2016-12-13 15:59:16 -05:00
mcilwain
f227598920 Inject DnsQueue in DomainCreateFlow
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140867232
2016-12-06 11:52:46 -05:00
mcilwain
3740171bbf Update create logic to ignore signed marks unless in sunrise
This addresses an issue where the existing logic assumed that the presence of a
signed mark means the current flow is a sunrise/sunrush request, when this isn't
necessarily true. It's safe to ignore signed marks in other circumstances.

This is a combination of work by Justin Graham <justin.af.graham@gmail.com>,
Nick Felt, and me (Ben). It is based on the original PR located at:
https://github.com/google/nomulus/pull/41

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140784461
2016-12-06 11:52:46 -05:00
jianglai
79a72387ee Migrate getCreatePrice() call to DomainPricingLogic
Swap all calls to TldSpecificLogicProxy.getCreatePrice() to the counterpart in
DomainPricingLogic. Also makes necessary changes for testing to work, including
fake implementations of DomainPricingCustomLogic and
DomainCreateLofwCustomLogic.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140754334
2016-12-06 11:52:46 -05:00
jianglai
998dae33ec Add extensible custom logic to the domain update flow
This also adds beforeValidation hook to DomainCreateCustomFlow.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139828346
2016-11-28 11:28:16 -05:00
mcilwain
d2139d9825 Add explicit generic type parameters to make Java 7 build happy
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139374166
2016-11-16 17:11:14 -05:00
mcilwain
a343648b34 Add extensible custom logic to the domain check flow
This also fixes up a hook on the domain create flow custom logic to use a single
parameter, which is the general pattern we want to use going forward. It also
establishes a pattern for custom logic being able to add extensions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139362230
2016-11-16 17:06:43 -05:00
mcilwain
5368489987 Enforce nullness consistency on EppResponse.set...() methods
The callsites were inconsistent between whether they were passing empty list or
null, and many of the ones that were passing null were not correctly annotated
with @Nullable. I'm now going with empty list throughout except for the final
step where the actual field that will be transformed into XML is set, where it
is coerced to null to avoid an empty element in the XML output.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139340837
2016-11-16 17:03:43 -05:00
mcilwain
4d2e0941f3 Add a custom logic framework to provide pluggable extensibility
To add additional logic for flow code, write custom classes that extend the existing custom logic classes (of which DomainCreateFlowCustomLogic is the first provided example), along with a class that extends CustomLogicFactory to provide instances of the new custom logic classes. Then configure the fully qualified class name of your new custom logic factory in ConfigModule.provideCustomLogicFactoryClass().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139221577
2016-11-15 15:19:32 -05:00
mountford
0634e25822 Remove as-of date from argument list for extra create flow logic
Lai points out that, for creation, the as-of date should always be equal to the creation time. And, in fact, there was a check to throw an exception if that is not the case. So it's more straightforward just to remove that argument entirely.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138783711
2016-11-15 10:46:04 -05:00
cgoldfeder
8256120b3a Simplify the fee extensions.
I added shared base classes to all of the Fee extension types that
make it possible to fully ignore the version in the flows. (You
ask for a FeeCreateCommandExtension, for example, and you get one
without having to worry about which). This is an improvement over
the old code that asked you to provide a list of possible fee
extensions and then ask for the first one in preference order.

As part of this I was able to make the Fee implementation a bit
simpler as well.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137992390
2016-11-10 11:09:23 -05:00
cgoldfeder
053538b1b5 Turn Flow into an interface and inject all its fields
This concludes your flow flattening experience. Please
fill out a flow flattening satisfaction survey before
exiting.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137903095
2016-11-02 15:19:34 -04:00
mountford
78a36925f4 Remove commitAdditionalLogicChanges(), part 1
Now that the flows are flattened, the commitAdditionalLogicChanges() call, which used to come later in the flow to actually save the Datastore objects, is now happening right after the performAdditionalXXXLogic() call. So we can instead just do the saves in performAdditionalXXXLogic(), and get rid of the separate call. As a first step, this CL simply makes commitAdditionalLogicChanges() a private method that gets called internally by the extra logic manager. Later, we can move the saves into their proper position, affecting only the extra logic class itself.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137529991
2016-11-02 15:19:34 -04:00
cgoldfeder
1dbc5f6bb0 Replace command.applyTo() with inlined builder operations
These are much easier to understand.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137446273
2016-11-02 15:19:34 -04:00
cgoldfeder
b84d7f1fb5 Remove LoggedInFlow
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137444791
2016-11-02 15:19:34 -04:00
ctingue
21c0b43af0 Fix missing LRP token during LRP period behavior
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137321673
2016-11-02 15:19:34 -04:00
ctingue
5f8a95d853 Add additional LRP tests for non-application phases
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137292394
2016-11-02 15:19:34 -04:00
cgoldfeder
475203532e Flatten the domain and application create flows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136601151
2016-10-19 13:08:33 -04:00
shikhman
f76bc70f91 Preserve test logs and test summary output for Kokoro CI runs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135494972
2016-10-14 16:57:43 -04:00
cgoldfeder
a09d48a4a5 Decentralize how registry phase checks are done in flows
Very few flows actually check the phase. Push the checks down to the leaf
flows so that we can remove the inherited code from ResourceFlow and replace
it with utility methods. In the process, document and test two places that
throw the exception but did not previously test it.

This introduces a temporary hack in BaseDomainCreateFlow that does something
specific for DomainApplicationCreateFlow. It will go away literally tomorrow
when I flatten that flow.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135480538
2016-10-07 15:29:48 -04:00
mcilwain
e864fedab1 Remove trailing whitespace in files
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135386752
2016-10-07 15:29:47 -04:00
jianglai
add9474e9a Change EAP fee billing event reason to EARLY_ACCESS
The reason field is 1:1 mapped to skus in billing reports. Need to add a new reason for EAP for this type of billing event for reporting to work correctly. Also map that reason to the correct SKU.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134005364
2016-09-26 13:28:07 -04:00
mountford
a63921350b HistoryEntry for extra logic; update fee check
While working on an implementation of TLD-specific logic, it was realized that the extra logic methods would need access to the flow's HistoryEntry, so that things like poll messages could be parented properly.

Also, the update flow had not been fixed to perform the fee check.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132561527
2016-09-14 15:28:03 -04:00
mountford
95cc7ab3d8 Add extra logic for all relevant flows
This CL enhances various domain flows (check, create, delete, renew, restore, transfer, update) so that they invoke the appropriate methods on the object implementing the TLD's RegistryExtraFlowLogic (if any). TldSpecificLogicProxy is also updated to invoke RegistryExtraFlowLogic proxy (if any) to fetch the appropriate price. The tests use a made-up extra flow logic object which can be attached to a test TLD to make sure that the proper routines are being invoked.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132486734
2016-09-14 15:26:36 -04:00
jianglai
6641f105b7 Create a separate billing event when EAP is applied
When EAP is involed we current have one billing event for domain create that
has the create fee and EAP fee lumped together. Change it to record two
separate billing events for each.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132335349
2016-09-07 12:00:28 -04:00