Commit graph

91 commits

Author SHA1 Message Date
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
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
mcilwain
f44557f34f Remove deprecated extra flow logic and TLD-specific pricing proxy
This also adds a domain update pricing hook to DomainPricingCustomLogic.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142286755
2016-12-19 11:09:20 -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
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
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
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
mountford
aecca10989 Add additional specific PricingEngineProxy methods
We already had methods to return just the create or just the renew price. I added more to return just the premium flag or just the fee class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136833071
2016-10-24 11:57:00 -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
cgoldfeder
886d6f8e17 Flatten the domain and domain application update flows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135282371
2016-10-07 14:34:06 -04:00
jianglai
b783acfcc6 Support date and notAfter in fee extension response v12
When custom effective date is passed in the check command, the response should
contain that date as an acknowledgemant that the check is performed at a time
different from now.

Also when the fee(s) returned contains a validDateRange (i. e. EAP fees that
are only valid during a certain period), the response will contain a notAfter
field which is the date after which the quoted fee(s) are no longer valid. (i.
e. the earliest of the end dates of all fees that would expire.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133989775
2016-09-26 13:24:57 -04:00
mcilwain
4813ed392b Rename "clientIdentifier" to "clientId" almost everywhere
It's best to be consistent and use the same thing everywhere.  "clientId" was
already used in more places and is shorter and no more ambiguous, so it's the
logical one to win out.

Note that this CL is almost solely a big Eclipse-assisted refactoring. There are
two places that I did not change clientIdentifier -- the actual entity field on
Registrar (though I did change all getters and setters), and the name of a
column on the exported registrar spreadsheet. Both would require data
migrations.

Also fixes a few minor nits discovered in touched files, including an incorrect
test in OfyFilterTest.java and some superfluous uses of String.format() when
calling checkArgument().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133956465
2016-09-22 14:30:05 -04:00
cgoldfeder
a69fc769af Flatten the domain info flows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133955573
2016-09-22 14:30:05 -04:00
cgoldfeder
1b34f1e326 Flatten the domain transfer flows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133906420
2016-09-22 14:30:05 -04:00
cgoldfeder
01e2e0141d Simplify the use of the fee extension a little
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133149148
2016-09-14 16:11:56 -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
cgoldfeder
5098b03af4 DeReference the codebase
This change replaces all Ref objects in the code with Key objects. These are
stored in datastore as the same object (raw datastore keys), so this is not
a model change.

Our best practices doc says to use Keys not Refs because:
 * The .get() method obscures what's actually going on
   - Much harder to visually audit the code for datastore loads
   - Hard to distinguish Ref<T> get()'s from Optional get()'s and Supplier get()'s
 * Implicit ofy().load() offers much less control
   - Antipattern for ultimate goal of making Ofy injectable
   - Can't control cache use or batch loading without making ofy() explicit anyway
 * Serialization behavior is surprising and could be quite dangerous/incorrect
   - Can lead to serialization errors. If it actually worked "as intended",
     it would lead to a Ref<> on a serialized object being replaced upon
     deserialization with a stale copy of the old value, which could potentially
     break all kinds of transactional expectations
 * Having both Ref<T> and Key<T> introduces extra boilerplate everywhere
   - E.g. helper methods all need to have Ref and Key overloads, or you need to
     call .key() to get the Key<T> for every Ref<T> you want to pass in
   - Creating a Ref<T> is more cumbersome, since it doesn't have all the create()
     overloads that Key<T> has, only create(Key<T>) and create(Entity) - no way to
     create directly from kind+ID/name, raw Key, websafe key string, etc.

(Note that Refs are treated specially by Objectify's @Load method and Keys are not;
we don't use that feature, but it is the one advantage Refs have over Keys.)

The direct impetus for this change is that I am trying to audit our use of memcache,
and the implicit .get() calls to datastore were making that very hard.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131965491
2016-09-02 13:50:20 -04:00
mountford
0066a03709 Add extra flow logic hooks for info and update
This CL adds the hooks necessary to implement TLD-specific flow info and update flow logic. Usage of the hooks follows in a separate CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130108832
2016-08-15 16:51:26 -04:00
Brian Mountford
8443da5c5c Support multiple versions of the EPP Fee Extension
We want to support multiple versions of the fee extension, to allow new features while maintaining backward compatibility. This CL extends the framework and adds one new version, 0.11 (spec version 7), to the existing version 0.6 (spec version 3). A follow-on CL will add version 0.12 (spec version 8).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127849044
2016-07-21 14:53:50 -04:00
Ben McIlwain
4ccc016e5c Disallow empty nameservers for domains in TLDs with whitelist
If a TLD has a whitelist on nameservers, domains in such TLD must have
at least one nameserver. Therefore creating domains with empty nameserver
is forbidden, as well as deleting the last nameserver on a domain. We
enforce this policy by checking the number of nameservers for the new resource
to makesure it is not zero if a whitelist exists.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127318320
2016-07-13 16:01:10 -04:00
mcilwain
aa2f283f7c Convert entire project to strict lexicographical import sort ordering
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127234970
2016-07-13 15:59:53 -04:00
mcilwain
cd23ece924 Rename TldSpecificLogicEngine to TldSpecificLogicProxy
This new name is a more accurate description of what the actual class
does.  TldSpecificLogicEngine is an interface that will be added in
the near future, implementations of which will provide custom per-TLD
logic.  The class being renamed is more properly a proxy that only
handles logic generic to all TLDs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127088913
2016-07-13 15:54:24 -04:00
ctingue
262aab22b9 Add EAP fee to domain check flow
(Original from mmuller@: []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126911443
2016-07-13 15:45:59 -04:00
Ben McIlwain
1ed77d5572 Fix a bug when updating a domain without changing its registrant
When updating a filed other than the registrant for a domain, a null
registratantContactId is passed to the registrant whitelist validator, causing
an excpetion because null is not an element in the whitelist (if it exists).
Added logic to handle null registrantContactId.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126817310
2016-07-13 15:43:13 -04:00
ctingue
9f731ba4d0 Clean up BaseFeeResponse.setFee() and call sites
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126229075
2016-07-01 13:38:57 -04:00
cgoldfeder
ec39f15a23 Fix generics in EppXmlTransformer.unmarshal to not be only on the return type.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124914271
2016-06-27 15:55:03 -04:00
Ben McIlwain
6ba1d5e6df Rename PricingEngine to PremiumPricingEngine
This properly reflects the fact that other, separate things will now
be responsible both for EAP and for per-TLD custom pricing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124558165
2016-06-14 16:29:52 -04:00
mcilwain
91f6c7006e Add additional return values to PricingEngine interface
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123658519
2016-06-06 12:14:51 -04:00
cgoldfeder
618050dc32 Load referenced contact/hosts from EPP more efficiently
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122459862
2016-05-16 20:11:58 -04:00
Corey Goldfeder
86f3287761 Typo in comment
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122449880
2016-05-16 18:40:40 -04:00
cgoldfeder
9a2afc7a9b Remove nearly all uses of ReferenceUnion
ReferenceUnion is a hack to work around the mismatch between how
we store references (by roid) and how they are represented in EPP
(by foreign key). If it ever needed to exist (not entirely clear...)
it should have remained tightly scoped within the domain commands
and resources. Instead it has leaked everywhere in the project,
causing lots of boilerplate. This CL hides all of that behind
standard Refs, and should be followed by work to remove ReferenceUnion
completely.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122424416
2016-05-16 16:36:25 -04:00
cgoldfeder
d1f34776d2 Fix whitelist tests
Followups to []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121993530
2016-05-13 23:20:27 -04:00
mcilwain
047bbf186e Extract premium pricing to a PricingEngine interface
This refactors the existing premium list functionality into the new
class StaticPremiumListPricingEngine, which implements PricingEngine.
A backfill @OnLoad is provided to default existing Registry entities
into the static implementation.  For now there is just this one
implementation.  Dagger map multibinding is used to generate the total
set of allowed pricing engines, and allows other parties to plug in
their own implementations.

The pricing engine is a required field on the Registry object.  If you
don't want a particular Registry to actually have a premium list, then
use the static pricing engine but don't actually set a premium list.

A subsequent CL will refactor the Key<PremiumList> field on the
Registry entity class to be handled solely by the
StaticPremiumListPricingEngine implementation.  Going forward, all
configuration and implementation details that are specific to a given
pricing engine should be handled by that pricing engine, and not as
fields on the Registry object.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121850176
2016-05-13 23:19:40 -04:00
mcilwain
6f69e96465 Add clientId and time parameters to pricing methods
This is a broken-out refactoring from []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121603352
2016-05-13 23:19:07 -04:00
Michael Muller
c458c05801 Rename Java packages to use the .google TLD
The dark lord Gosling designed the Java package naming system so that
ownership flows from the DNS system. Since we own the domain name
registry.google, it seems only appropriate that we should use
google.registry as our package name.
2016-05-13 20:04:42 -04:00
Justine Tunney
5012893c1d mv com/google/domain/registry google/registry
This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
2016-05-13 18:55:08 -04:00
Renamed from java/com/google/domain/registry/flows/domain/DomainFlowUtils.java (Browse further)