Commit graph

370 commits

Author SHA1 Message Date
mcilwain
b317aab22f Clean up some areas in preparation for externalized codebase
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221454055
2018-11-16 16:51:11 -05:00
jianglai
589e98a1db Explicitly set the shard size when saving the claims list
This allows us to get rid of the use of InjectRule in tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218221409
2018-10-22 19:13:11 -04:00
mcilwain
f43125bb04 Add a RESERVED billing event flag for creates of reserved domains
This is an additional signal we can use for the billing/invoicing pipeline that
will be helfpul in targeting invoice rows that may need adjustment.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217524250
2018-10-22 18:38:23 -04:00
mcilwain
9faf7181c3 Index the allocation token's redemption history entry field
We need this to efficiently query which tokens have and have not been redeemed.

I'm also marking it as nullable for consistency with the domain name field (it's
already null for unredeemed tokens).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214366534
2018-10-03 11:52:31 -04:00
mcilwain
633b30725a Handle Purchase Order numbers explicitly in billing pipeline
Note that these aren't used for most registrars.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213631863
2018-09-20 11:19:36 -04:00
mcilwain
8ddbf88151 Remove the deprecated MISTAKEN_PREMIUM reservation type
It doesn't do anything that ALLOWED_IN_SUNRISE doesn't do, and there's no point
in having two separate types when we can simply keep track of the semantic
difference between the two by using different lists (as we have for .soy).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212997752
2018-09-14 21:28:23 -04:00
weiminyu
80b0e6297b Export Premium names to Drive
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212509587
2018-09-14 11:47:38 -04:00
mcilwain
7b87ba41c7 Delete all Limited Release Program (LRP) code
We never used it and don't have any plans to use it going forward. All
conceivable parts of its functionality that we might use going forward have
already been subsumed into allocation tokens, which are a simpler way of
handling the same use case that are also standards-compliant.

Also gets rid of the hideous ANCHOR_ prefix on anchor tenant EPP authcodes
that was only ever necessary because of overloading the authcode for
anchor tenant creation. Going forward it'll be based on allocation tokens,
so there's no risk of conflicts.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209418194
2018-08-20 14:28:16 -04:00
mcilwain
d2f849ac0f Add new reserved domain creation from allocation tokens mechanism
Note that this gets rid of anchor tenant codes in reserved lists (yay!), which
are no longer valid.  They have to come from allocation tokens now.

This removes support for LRP from domain application create flow (that's fine,
we never used it and I'm going to delete all of LRP later).  It also uses
allocation tokens from EPP authcodes as a fallback, for now, but that will be
removed later once we switch fully to the allocation token mechanism.

This doesn't yet allow registration of RESERVED_FOR_SPECIFIC_USE domains using
the allocation token extension; that will come in the next CL.  Ditto for
showing these reserved domains as available on domain checks when the allocation
token is specified.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209019617
2018-08-20 14:22:06 -04:00
mcilwain
d80f431e21 Add domain name support to AllocationToken entities
The design doc is at []
The next step will be to tie this into the domain create flow, and if the domain
name is on a reserved list, allow it to be created if the token is specified that
has the given domain name on it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207884521
2018-08-10 13:46:48 -04:00
mcilwain
f614044681 Add an auto update time field to the Cursor entity
Also adjusts the nomulus list_cursors command to output the value of this field.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206646117
2018-08-10 13:44:25 -04:00
mcilwain
ded40851d3 Use locking on async mapreduces
This ensures that only one will run at a time, which should help fix the
clogged up mapreduces we've seen on sandbox.

In order to do this, the UnlockerOutput is introduced. This unlocks the
given Lock after all reducer shards have finished.

Also increases the lease duration of the DNS refresh action from 20 to
240 minutes. 20 minutes isn't long enough; when there's a lot of domains
and decent system load the mapreduce could take longer than that in the
ordinary case.

TESTED=Deployed to alpha and verified that more than one copy of the
mapreduce wouldn't run simultaneously, and also that the lock is
released when the mapreduce is finished.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205887554
2018-08-10 13:44:25 -04:00
mcilwain
df5d9957f7 Move the AllocationToken entity to the token subpackage
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204485366
2018-07-14 01:37:03 -04:00
mcilwain
32b3563126 Delete all Braintree code
We never launched this, don't planning on launching it now anyway, and it's rotted over the past two years anyway.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202993577
2018-07-14 01:37:03 -04:00
mcilwain
43ed2cd7b3 Clean up annotation imports in BUILD files
This affects JSR305, JSR330, and Guava annotations.

The exact command run to generate this CL was:

build_cleaner '//third_party/java_src/gtld/...' -c '' --dep_restrictions='//third_party/java/jsr330_inject,//third_party/java/jsr305_annotations,[]'

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202322747
2018-06-27 15:28:53 -04:00
mcilwain
bee3d6a5a4 Fix BUILD glob rules to not include non-wildcarded paths
This is a Buildozer warning

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202311866
2018-06-27 15:28:53 -04:00
mcilwain
4c7bc3b18c Improve internal build system speed
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202016862
2018-06-27 15:28:52 -04:00
mcilwain
ed910455b0 Add more absent clTrid unit tests
In RFC 5730, clTrid is specified as optional. We ran into an error earlier this
year in which a registrar was not passing a client transaction id and we didn't
handle it correctly. So, this CL adds some tests of common EPP operations verify
that they work correctly when the clTrid is not specified.

This also slightly improves some flow logic to make it more obvious at first
glance that clTrid is indeed optional.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202000845
2018-06-27 15:28:52 -04:00
mcilwain
6706b99828 Delete remnants of registrar-level credits
We never fully used this stuff but definitely no longer use it following our
recent billing refactor. It's confusing to retain all of these entities and
commands given that none of them are actually used by anything.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201978094
2018-06-27 15:28:52 -04:00
mcilwain
d3364b0387 Migrate away from VoidWorks
This is one last hanging piece of work left over from last year's Java 8
migration. There's no functionality changes in this CL, just refactoring.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201947600
2018-06-27 15:28:52 -04:00
mcilwain
8b263baefa Delete MultiplyingCloudDnsWriter
Now that the large zone re-signing test is complete, we no longer need it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199507075
2018-06-27 15:28:06 -04:00
mcilwain
5d80f124ca Remove unnecessary "throws" declarations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201058582
2018-06-18 18:17:56 -04:00
guyben
646c6fa069 Print GAE-UserId even when null
Also explicitly state that contacts missing GAE-UserId can't access the
registrar console

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200402953
2018-06-18 18:06:23 -04:00
larryruili
1c71487e5d Set EAP billing event to one-year period
This is consistent with how we treat RESTORE billing events as well- in
general, fees are considered to be amortized over the course of a year (by the
invoicing team).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199684843
2018-06-18 17:42:29 -04:00
mcilwain
e1bcc2e64d Add relevant exception message for checkArgumentNotNull usage
I ran into this while writing some other code and having the exception message
would have made it easier to debug.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199292321
2018-06-06 15:13:10 -04:00
jianglai
70b13596e4 Migrate to Flogger (green)
This is a 'green' Flogger migration CL. Green CLs are intended to be as
safe as possible and should be easy to review and submit.

No changes should be necessary to the code itself prior to submission,
but small changes to BUILD files may be required.

Changes within files are completely independent of each other, so this CL
can be safely split up for review using tools such as Rosie.

For more information, see []
Base CL: 197826149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198560170
2018-05-30 12:18:54 -04:00
mcilwain
8f456bcf64 Clarify when to use cache (or not) when loading premium lists
You don't want to use the cache when loading them for the purposes of updating
them, but you definitely do still want to use the cache when checking the
price of individual domains.

In [] the cache clearing of premium lists on update was removed. This
is a good thing in aggregate because the cache is per-instance and thus
misleading, but it also caused us to not be able to update the same premium
list twice within an hour because the second update would hit a "PremiumList
was concurrently edited" exception, owing to first loading the stale version
from the cache for the purposes of updating it. Now we bypass the cache for
that purpose.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197768142
2018-05-30 12:18:54 -04:00
jianglai
fc60890136 Migrate to internal FormattingLogger in preparation of migration to Flogger
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197744904
2018-05-30 12:18:54 -04:00
mcilwain
b8d7d9da29 Don't delete the old premium list yet after updating to a new one
The issue is that the premium list cache is configured to persist for 60
minutes. So after updating the list, checks/creates for up to the next 60
minutes could still be referring to the old list. That's fine and dandy, unless
you delete the old premium list immediately (*bad*), which makes all domains
appear to now be non-premium for as long as the cache lasts. The reason deleting
the premium list entries makes names appear as non-premium is that a load-by-key
existence check with the domain label itself is used to determine if a name is
premium.

I also removed a misleading cache update statement, which doesn't do what it
appears to be doing (it appears to fix this issue) because cache is
instance-level, and so even if the premium list were updated from the frontend
instance only one of 100 instances would have its cache updated. But it's
updated from the tools service anyway, so it's guaranteed to not be a shared
cache with any instance serving EPP traffic.

On a sidenote, I introduced this bug on 2014-10-27 in [] The domain
label list refactor was my Noogler project.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197033604
2018-05-17 21:52:35 -04:00
mcilwain
9c0d3b6db3 Add limit to list_domains command
This allows list_domains to continue working for large TLDs.

TESTED=Deploys to alpha and it works to list the most recently created domains even
on a TLD with a huge number of domains on it (much more than .app has currently).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196717389
2018-05-17 21:52:35 -04:00
guyben
e4f25c08e8 Improve the error when trying to delete the registrant contact
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196708902
2018-05-17 21:52:35 -04:00
larryruili
6cdbde107f Redirect Registrar.referralUrl UI actions to url field
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196597051
2018-05-17 21:52:35 -04:00
jianglai
82ded21b9e Make EAP fee description check more flexible
Currently we determine fee type from the fee extension description by checking if the format string of the FeeType contains the description we received. The formatting string for EAP is "Early Access Period, fee expires: %s", so the fee description generated by a domain check command, like "Early Access Period, fee expires: 2022-03-01T00:00:00.000Z", is not recognized as EAP.

This CL adds the ability to add arbitrary extra description strings to the FeeType for a description to match against. It also changes the match to "the given description contains any of the strings from the list of format string plus extra description strings".

For EAP, we added an extra description string "Early Access Period", so any fee description that contains "Early Access Period" will be matched to EAP FeeType, including the specific description (that contains the expiry time) that we send in a domain check.

Also improved error message on multiple fee type matching.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194149162
2018-05-05 23:26:33 -04:00
mcilwain
33505f4df7 Make async flow logic handle missing client transaction IDs
Per EPP RFC 5730, the <clTRID> element is optional. However, we weren't handling
it not being specified in asynchronous contact/host deletions because we were
adding it directly as a parameter value on a task, which does not allow null and
thus threw a NullPointerException.

This fixes handling for nulls (the parameter isn't set at all) and adds a test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194123259
2018-05-05 23:21:55 -04:00
mcilwain
2c0fb6d5a6 Enforce canonicalization of premium/reserved list labels
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193401336
2018-04-23 14:53:10 -04:00
guyben
9ed4d43f41 Use Predicates.not for one-liner functionals when appropriate
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193386976
2018-04-23 14:50:02 -04:00
guyben
eb17851cb3 Test that update works for every field in RegistrarSettings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192348329
2018-04-23 14:20:43 -04:00
mcilwain
07d38340f3 Cache domains, contacts, and hosts in WHOIS queries
This should prevent having issues with hot key paths on entities that
experience a heavy WHOIS volume (e.g. contacts that registrars reuse on
many domains).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191506124
2018-04-10 16:24:03 -04:00
mcilwain
377fe5f573 Allow number of commit log buckets to be increased
Also increases the number of commit log buckets on alpha to 397 and correspondingly
reduces the frequency of commit log diff exporting to once every 3 minutes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191440586
2018-04-10 16:16:08 -04:00
mcilwain
54a8cd09ea Use some Java 8 features in commit log code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190985373
2018-04-02 16:53:46 -04:00
mmuller
785225fc28 Implement "premium price ack required" checkbox
Implement a checkbox in the "Resources" tab to allow registrars to toggle
their "premium price ack required" flag.

Tested:
  Verfied the console functionality by hand.  I've started work on an
  automated test, but we can't actually test those from blaze and the
  kokoro tests are way too time-consuming to be practical for development, so
  we're going to have to either find a way to run those locally outside of
  the normal process or make do without a test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190212177
2018-04-02 16:33:51 -04:00
mcilwain
e525df791f Update default sunrush add grace period to 5 days
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189935343
2018-04-02 16:21:14 -04:00
larryruili
b39e6c0d7e Change RESTORE BillingEvents to have 1-year periods
This simplifies calculating the overall invoice by giving RESTORE fees a
period equal to the period of the associated RENEW (1 year). Older
BillingEvents will not be backfilled, and will have periodYears = null.

Invoicing and business both agree this is a valid representation, since RESTORE fees are intrinsically tied to the 1-year RENEW it's associated with.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188041777
2018-03-06 19:25:05 -05:00
jianglai
1013ef9bc0 Update OT&E command to support requirements for .app launch
Changed SUNRISE to START_SUNRISE and added a registry/registrar pair for testing EAP. The EAP period is set to 2018-03-01 to 2022-03-01 with a price of $100.

A temporary flag is added to only create EAP registry/registrar pair so that we can update existing registrars.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187897405
2018-03-06 19:20:22 -05:00
mcilwain
ceed5bdd1c Make return value of ClaimsListShard.getClaimKey() Optional
It was nullable all along, but wasn't tagged as such, and thus it was
possible to misuse the method from its call sites.

Also adds an assertion about no NORDN tasks being enqueued in a failing
domain create test for a required signed mark.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187649865
2018-03-06 19:15:52 -05:00
larryruili
fa989e754b Add sharded DNS publishing capability
This enables sharded DNS publishing on a per-TLD basis. Instead of a TLD-wide lock, the sharded scheme locks each update on the shard number, allowing parallel writes to DNS.

We allow N (the number of shards) to be 0 or 1 for no sharding, and N > 1 for an N-way sharding scheme. Unless explicitly set, all TLDs default to a numShards of 0, so we don't have to reload all registry objects explicitly.

WARNING: This will change the lock name upon deployment for the PublishDnsAction from "<TLD> Dns Updates" to "<TLD> Dns Updates shard 0". This may cause concurrency issues if the underlying DNSWriter is not parallel-write tolerant (currently all production usages are ZonemanWriter, which is parallel-tolerant, so no issues are expected).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187525655
2018-03-06 19:14:26 -05:00
guyben
24799b394d Allow the same LaunchPhase to be used for both start-date and end-date sunrise
Also changed the name of "verifyRegistryStateAllowsLaunchFlows" to "verifyRegistryStateAllowsApplicationFlows", because there are now launch flows that don't use applications (start-date sunrise).

Finally, added a test to showcase the "super-user" power that EPPs with Anchor Tenants have. There's no change in behavior in that regard in this CL - we just add a test to make it explicit.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187517199
2018-03-06 19:12:56 -05:00
mcilwain
ce136f9285 Add short-term host/contact caching for high-QPS domain mutations
After investigating common domain create/update command usage
patterns by registrars, we noticed that it is frequent for a
given registrar to reuse both hosts (using a standardized set of
nameservers) as well as contacts (e.g. for privacy/proxy
services). With these usage patterns, potential per-registrar
throughput during high volume scenarios (i.e. first moments of
General Availability) suffers from hitting hot keys in Datastore.

The solution, implemented in this CL, is to add short-term
in-memory caching for contacts and hosts, analogous to how we are
already caching Registry and Registrar entities.  These new
cached paths are only used inside domain flows to determine
existence and deleted/pending delete status of contacts and
hosts. This is a potential loss of transactional consistency, but
in practice it's hard to imagine this having negative effects, as
contacts or hosts that are in use cannot be deleted, and caching
would primarily affect widely used contacts and hosts.

Note that this caching can be turned on or off through a
configuration option, and by default would be off. We'd only want
it on when we really needed it, i.e. during a big launch.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187093378
2018-03-06 19:05:20 -05:00
jianglai
ff221fba96 Validate individual fee types
Currently we validate the fee extension by summing up all fees present in the extension and comparing it against the total fee to be charged. While this works in most cases, we'd like the ability to individually validate each fee. This is especially useful during EAP when two fees are charged, a regular "create" fee that would also be amount we charge during renewal, and a one time "EAP" fee.

Because we can only distinguish fees by their descriptions, we try to match the description to the format string of the fee type enums. We also only require individual fee matches when we are charging more than one type of fees, which makes the change compatible with most existing use cases where only one fees is charged and the description field is ignored in the extension.

We expect the workflow to be that a registrar sends a domain check, and we reply with exactly what fees we are expecting, and then it will use the descriptions in the response to send us a domain create with the correct fees.

Note that we aggregate fees within the same FeeType together. Normally there will only be one fee per type, but in case of custom logic there could be more than one fee for the same type. There is no way to distinguish them as they both use the same description. So it is simpler to just aggregate them.

This CL also includes some reformatting that conforms to google-java-format output.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186530316
2018-03-06 18:48:39 -05:00
guyben
b0cbc0f60d Add the START_DATE_SUNRISE phase
The START_DATE_SUNRISE phase allows registration of domains only with a signed mark. In all other respects - it is identical to the GENERAL_AVAILABILITY phase.

Note that Anchor Tenants bypass all checks, and are hence able to register domains without a signed mark.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185534793
2018-02-20 15:45:27 -05:00