Commit graph

110 commits

Author SHA1 Message Date
cgoldfeder
c59227bb76 Remove useless createdRepoId from logging
It is no longer needed since we don't do log-replay and it's
annoying to support in the flat flows.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135805088
2016-10-14 16:58:07 -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
cb8320ff40 Change @DoNotHydrate to work on fields, not types.
There was a circular reference when hydrating a domain with a
subordinate host, since the host references the domain. To fix
this, I redid @DoNotHydrate to be the way it should have been,
rather than the hack I had originally submitted. I also beefed
up the unit tests of the epp resource types to check for cycles.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135792416
2016-10-11 11:27:54 -04:00
nickfelt
ec64f4799c Fix javadoc on DomainApplicationIndex to reflect recent change
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135516642
2016-10-11 11:08:56 -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
ctingue
0ae5d10632 Add metadata map to LrpToken
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135382828
2016-10-07 15:29:47 -04:00
ctingue
36249021ac Remove redemptionHistoryEntry from LrpToken index
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134570879
2016-10-03 15:54:10 -04:00
mcilwain
afa6648cf7 Fix Java imports across entire codebase to be compliant
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134119822
2016-09-26 13:44:11 -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
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
21a98b899c Replace loadByUniqueId() with methods that don't overload unique id
It is replaced by loadByForeignKey(), which does the same thing that
loadByUniqueId() did for contacts, hosts, and domains, and also
loadDomainApplication(), which loads domain application by ROID. This eliminates
the ugly mode-switching of attemping to load by other foreign key or ROID.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133980156
2016-09-26 13:20:22 -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
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
mcilwain
65ff6b45d1 Add documentation on poll messages and an outline of Code structure
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133713736
2016-09-22 14:06:32 -04:00
jianglai
77571e2063 Refactor Fee class to support EAP fee
Currently EapFee is a separate class that has no inheritance from either
BaseFee and Fee. With this CL its functionality is merged into the Fee class
and the type of the fee can be identified by the FeeType enum in the Fee class.
Future custom fees can follow the same pattern.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133627570
2016-09-22 14:03:01 -04:00
cgoldfeder
0518f63aad []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133597433
2016-09-22 14:01:29 -04:00
mcilwain
b1e1dd0f47 Remove toString() method on Result.Code and fix metrics recording
We almost certainly had intended to record a String representation of the
numeric Code all along, but a bad toString() method on the enum resulted
in the wrong thing happening.  This is more evidence of why overriding
toString() on enums is bad.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133583683
2016-09-19 12:11:44 -04:00
jianglai
743ff99ca3 Support custom effective date for fee check command
Added support to specify custom effective date to run the fee check command.
Such functionality is useful for TLDs with creation price as a function of
time, such as those with EAP. However the implementation is not limited EAP or
create price check. Any fee check can specify a date, as long as its XML schema
supports a date.

Currently conforming to fee extension v12, subject to schema changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133420255
2016-09-19 12:08:46 -04:00
mcilwain
c6e9779af1 Fix Result.Code enum values to use UPPER_CAMEL naming
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133324460
2016-09-19 12:02:56 -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
cgoldfeder
1ee02108ae Crush out shared code in contact flows, especially transfer
Although the delta implies that this is actually adding code, it's
better than it looks, because some of the stuff in ContactFlowUtils
is duplicating more generic methods in ResourceFlowUtils, which
can be deleted when the domain and host flows are cut over.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133149104
2016-09-14 16:10:18 -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
mcilwain
2b42118aaf Make boolean operator precedence unambiguous in ClaimsListShard
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132442796
2016-09-14 15:19:15 -04:00
mcilwain
cadf9d4af2 Use smaller shard size in ClaimsListShardTest
The default production value of 10,000 was unnecessarily large for testing
purposes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132441792
2016-09-14 15:16:22 -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
ctingue
6f241c5605 Index redemptionHistoryEntry on LrpToken
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132323443
2016-09-07 11:57:30 -04:00
mcilwain
07135f6190 Don't allow null in BillingEvent.setFlags()
It's better that it always takes a non-null ImmutableSet, which may either be
empty or contain elements.  That way the ugliness of nullness is contained
just to the entity class itself, and all other code that interacts with it
can always be assured of having a real set to deal with.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132066238
2016-09-02 13:57:50 -04:00
shikhman
7d1a30d8d6 Remove backfill for DnsWriter and PricingEngine
The backfill for these is no longer necessary as all of the Registry entities in all environments have been backfilled.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131984138
2016-09-02 13:53:28 -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
59ac00478e Improve BaseFee class and its children
Checks are added to ensure that fees are always non-negative, while credits are always negative, as required by the EPP fee extension specification. Also, BaseFee is made specifically abstract.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131620110
2016-08-30 14:16:41 -04:00
cgoldfeder
8059ab5c90 A @DoNotHydrate annotation for toHydratedString
This is needed for a soon-to-be-submitted CL that changes
all Refs to Keys and therefore removes the logic in
toHydratedString that doesn't expand Keys. We need to be
able to tag types as unexpandable to avoid cycles. It
would be better to tag fields, not types, but that is a
much harder change and not currently needed by the use
case of the following CL, so for now this suffices.

While I am in here, add tests for all of the features
of toHydratedString.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131618634
2016-08-30 14:15:16 -04:00
ctingue
1894b2308b Handle LRP tokens in flows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130679951
2016-08-22 14:30:19 -04:00
mountford
4a34807b1d RDAP: Use IANA identifier as the registrar handle
According to the ICAAN operation profile:

2.1.7. Registries MUST support lookup for entities with the registrar role within other objects using the handle (as described in 3.1.5 of RFC7482). The handle of the entity with the registrar role MUST be equal to IANA Registrar ID. The entity with the registrar role in the RDAP response MUST contain a publicIDs member to identify the IANA Registrar ID from the IANA’s Registrar ID registry. The type value of the publicID object MUST be equal to IANA Registrar ID.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130452501
2016-08-22 14:06:07 -04:00
mcilwain
467286d79e Remove registrar certificate state dead code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130418304
2016-08-22 13:55:54 -04:00
mountford
0e794c790a Add additional methods for manipulating timed transition maps
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130311938
2016-08-15 17:13:29 -04:00
nickfelt
d1ea3e3a68 Fix NPE bug in DomainCommand.cloneAndLinkReferences()
See b/30806813 for more context.  Copied from there:  This appears to be happening if we get an EPP domain create command that is missing any contacts (but has a registrant; with no registrant we exercise a different codepath).  In that case, JAXB leaves the contacts field on the Create null, and we try to pass it into Sets.union() as a result of Corey's refactoring in [] that changed contact loading to load the contacts and registrant all at once.  The fix is just to apply nullToEmpty() first.

Note that it's always an error to try to create a domain without any non-registrant contacts, but that's supposed to happen later on in BaseDomainCreateFlow.verifyCreateIsAllowed() via validateRequiredContactsPresent(), which will produce a nice error message.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130309019
2016-08-15 17:13:29 -04:00
mountford
160266f37a RDAP: Implement entity name search
Adds the ability to search for entities (contacts and registrars) by name.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130305930
2016-08-15 17:13:29 -04:00
mountford
57ec8b3ae3 Add utility methods for copying time transition maps and filtering grace periods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130281141
2016-08-15 17:02:51 -04:00
mcilwain
3efe09616c Allow two-letter domain names
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130139005
2016-08-15 16:57:19 -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
ctingue
2e88129c43 Swap id and indexed field in LrpToken
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130014294
2016-08-15 16:39:03 -04:00
Chris Tingue
1ef8716177 Add LRP TLD states to Registry and *_tld tools
Also had to add an EnumParameter class to support
List<T extends Enum<T>>, as these aren't natively supported by
JCommander (although single Enum parameters are.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129464699
2016-08-05 20:41:11 -04:00
Greg Shikhman
a620d06239 Add dagger map for injecting DnsWriter implementations
This is one of several CLs in a sequence for allowing per-TLD DNS
implementations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129445641
2016-08-05 20:38:21 -04:00
Greg Shikhman
0e4244a03d Add DnsWriter for Cloud DNS
The plumbing to support different DnsWriter implementations per TLD
using DI will come in a later CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129375856
2016-08-05 20:36:52 -04:00
mcilwain
ea24f6ca31 Use string keys for the multimap of pricing engines for TLDs
This is better than the previous way of using the canonical name of the class,
because the previous way did not allow for refactoring, and also required the
PremiumPricingEngine to live in the model package lest there be circular
dependencies, which does not seem ideal.

Note that, for reasons of backwards compatibility with existing persisted data,
the name of the static premium pricing engine has been set to its canonical
class name, but the class can now be refactored going forward so long as this
string remains unchanged, and any new pricing engine implementations can use
whatever string key they want (it doesn't have to be a canonical class name).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129215185
2016-08-03 11:16:01 -04:00
Justine Tunney
e2471b837a Unstrip LrpToken from EntityClasses
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129142160
2016-08-02 19:23:01 -04:00
Chris Tingue
d2ca1ff691 Add set of valid TLDs to LrpToken
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129141577
2016-08-02 19:22:54 -04:00
Chris Tingue
eb76b063b3 Move LRP token and tools into domain package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129134685
2016-08-02 19:22:44 -04:00
Justine Tunney
e3bb5dc9b0 Fix up license headers and Python linting
This will help [] be submitted without breaking the linter.
License headers are now added automatically where they were previously
added by hand. We're also now adding the license header to Soy and SQL
files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129017424
2016-08-02 19:16:42 -04:00