Commit graph

691 commits

Author SHA1 Message Date
ctingue
f30b87d40e Add ExpandRecurringBillingEventsAction cron job
Note that this merely starts this MR on a daily schedule -- the billing queries that ultimately consume the synthetic OneTime events are filtering out the events at this time, so we're still relying on query-time expansion of Recurrings.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144450565
2017-01-18 11:03:32 -05:00
mcilwain
8f8d67a17b Inject the BigQuery streaming metrics queue
This makes local development easier by allowing a stub to be injected for the
queue.

Based on Justin Graham's PR: https://github.com/google/nomulus/pull/51

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144439454
2017-01-13 10:29:36 -05:00
mcilwain
f7e84b56a0 Relax uniqueness constraint on ROID suffixes
The command still enforces uniqueness (which is fine), but by changing the cache
from a BiMap to a Map, we can support non-unique suffixes if they happen to be
configured as data. The only reason the cache was ever a BiMap in the first
place was to support the Registry 2.0 migration, which was finished a year and a
half ago. It's only being read one way now, so a Map is fine.

See https://github.com/google/nomulus/pull/53 for context.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144381946
2017-01-13 10:28:08 -05:00
mcilwain
66a02856c4 Use strict email address validation in SendEmailUtils
It probably should have always been like this, but the Nomulus test recently
started failing without it for some reason.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144343479
2017-01-12 14:17:57 -05:00
mcilwain
0c6cd4d7b7 Fix missing @CopyAnnotations by upgrading to AutoValue 1.4-rc2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144332981
2017-01-12 14:16:29 -05:00
mcilwain
9f142c6767 Remove the util package's dependency on the config package
This allows us to use util methods from within config, which is a useful thing
to be able to do for, e.g., being able to log errors while loading configuration.
It makes sense that the util package should be at the very base of the
class inheritance hierarchy; config seems logically higher than it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144324273
2017-01-12 14:14:51 -05:00
cgoldfeder
b0bcc1bb3d Create *InfoData objects instead of reusing *Resource objects
This is probably best from a code-cleanliness perspective anyways,
but the rationale is that tightly coupling the resources to the
info responses was a straightjacket that required all status
values and fields to be directly available on the resource. With
this change, I already was able to get rid of the preMarshal()
hackery, and I will be able to get rid of cloneWithLinkedStatus()
and most of the contents of cloneProjectedAtTime() for non-domains.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144252924
2017-01-12 14:11:51 -05:00
cgoldfeder
96a71ded91 Fix some comment typos
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144238812
2017-01-12 14:10:24 -05:00
mcilwain
a5d5c9e2fd Support creation of EPP fee objects using custom descriptions
This is a reasonable thing that custom code might want to do (Donuts already has
a use case).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144216929
2017-01-12 14:08:56 -05:00
ctingue
3ee98988c5 Add TODOs in SQL files for recurring billing expansion
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144133707
2017-01-12 14:05:57 -05:00
shikhman
e981bad0b3 Rename all encoding methods to start with the word encode for consistency
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143973446
2017-01-12 13:58:31 -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
ctingue
bca2169c68 Add global cursor functionality to UpdateCursorsCommand
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143965268
2017-01-09 12:15:51 -05:00
mcilwain
3a5a7e030d Fix Nomulus build by adding explicit error-prone dependency
The bazel build was failing with the following error message without it:

error: cannot access CanIgnoreReturnValue
  class file for com.google.errorprone.annotations.CanIgnoreReturnValue not found

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143961684
2017-01-09 12:01:09 -05:00
mcilwain
eaec03e670 Move ConfigModule and LocalTestConfig into RegistryConfig
This is the final preparatory step necessary in order to load and load
configuration from YAML in a static context and then provide it either via
Dagger (using ConfigModule) or through RegistryConfig's existing static
functions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143819983
2017-01-09 12:01:09 -05:00
mcilwain
d3397e991e Remove the old RegistryConfig paradigm entirely
We are now ready to begin configuration using YAML, mediated by ConfigModule.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143818507
2017-01-09 12:01:09 -05:00
mcilwain
c5c74961bb Make all but one field on RegistryConfig static
The next step will be to get rid of RegistryConfig descendants and RegistryConfigLoader entirely.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143812815
2017-01-09 12:01:09 -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
Ben Kelsey
44972b916a Add otherClientId to HistoryEntry
This CL adds an otherClientId field to be populated on domain transfers with client ID of the other end of the transaction (losing registrar for requests and cancels, gaining registrar for approves and rejects). This will be used for reporting in compliance with specification 3 of the ICANN registry agreement.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143775945
2017-01-09 12:00:34 -05:00
mcilwain
25a8bbe890 Deprecate more fields in RegistryConfig
This primarily addresses issues with TMCH testing mode and email sending utils.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143710550
2017-01-09 11:59:04 -05:00
mcilwain
c05424b947 Daggerize TMCH/signed mark util classes
This allows them to support injectable configuration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143709052
2017-01-09 11:59:04 -05:00
mcilwain
534e3ba01c Update ICANN TMCH CRL file to latest as of now
This was downloaded from http://crl.icann.org/tmch.crl

I also checked the test/pilot file, and we are already up to date with
http://crl.icann.org/tmch_pilot.crl

The CRT file is up to date with https://ca.icann.org/tmch.crt

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143702877
2017-01-09 11:59:04 -05:00
ctingue
8b297fa099 Clean up stray commented code in ExpandRecurringBillingEventsAction
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143696298
2017-01-09 11:59:04 -05:00
ctingue
a2bc05d1cd Add scrap [] to purge synthetic OneTimes
This is temporary until we verify that recurring billing event expansion is working as expected. I want to have this available in case things go south, though in a perfect world, we won't need this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143693458
2017-01-09 11:59:04 -05:00
ctingue
00dab551d7 Fix deleted domain bug in recurring billing expansion
Currently, the recurring billing expansion chokes when looking for existing OneTime events for domains that are deleted or transferred at the MR execution time. To fix this, change the FKI query to look for a key at either execution time or recurrence end time, whichever is earliest.

(This one is distinct from [] in that this bug occurs when domains are [] deleted.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143693153
2017-01-09 11:59:04 -05:00
mmuller
270734fd9b Convert AppEngineConnection to use HttpTransport
Make AppEngineConnection use HttpTransport through HttpRequestFactory and
create factory factories for localhost and HTTPOverRPC.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143680257
2017-01-09 11:59:04 -05:00
ctingue
0cf62be403 Fix recurring expansion when handling transferred or deleted domains
The recurring billing event expansion fails when handling domains that are transferred or deleted before the initial renew. Quietly ignore these recurring events.

(This one is distinct from [] in that this bug occurs when domains currently exist under new ownership.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143594317
2017-01-09 11:59:04 -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
c35c3a678b Change commit log bucket counts in tests
I'm setting it to three buckets across all tests, because the default one bucket
wasn't realistic enough, and allowed some tests to pass that shouldn't have,
essentially by accident.

This also changes RegistryConfig from being an interface to being an abstract
base class. The medium term goal here is to have it be a static class so that it
can provide fields from the YAML-derived POJO in situations where Dagger
injection isn't feasible.

The expected end state is as follows:

default-config.yaml -- The master config file that provides defaults for all
values.

nomulus-config.yaml -- A per-environment config file that overrides the defaults
from the previous file.

YamlConfig.java -- The POJO that the aforementioned YAML files are deserialized
into.

RegistryConfig.java -- Contains a static, memoized instance of YamlConfig and
provides static methods for getting some of those values.

ConfigModule -- Will become a static inner class of RegistryConfig, using Dagger
to provide most of the fields from the memoized YamlConfig instance. This way,
all configuration will be coming from a single place: RegistryConfig.java.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143567288
2017-01-09 11:59:04 -05:00
jart
734130aa73 Restructure Maven dependencies in build
We're now using java_import_external instead of maven_jar. This allows
us to specify the relationships between jars, thereby allowing us to
eliminate scores of vendor BUILD files that did nothing but re-export
@foo//jar targets, thus addressing the concerns of djhworld on Hacker
News: https://news.ycombinator.com/item?id=12738072

We now have redundant failover mirrors, which is a feature I added to
Bazel 0.4.2 in ed7ced0018

A new standard naming convention is now being used for all Maven repos.
Those names are calculated from the group_artifact name using the
following algorithm that eliminates redundancy:
https://gist.github.com/jart/41bfd977b913c2301627162f1c038e55

The JSR330 dep has been removed from java targets if they also depend
on Dagger, since Dagger always exports JSR330.

Annotation processor dependencies should now be leaner and meaner, by
more appropriately managing what needs to be on the classpath at
runtime. This should trim down the production jar by >1MB. As it stands
currently in the open source world:

- backend_jar_deploy.jar: 50MB
- frontend_jar_deploy.jar: 30MB
- tools_jar_deploy.jar: 45MB

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143487929
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
mountford
ab3f352782 Clean up RDAP code
For some reason, although a constant was defined for the RDAP response content type, it was being used in one place but not another.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143185157
2017-01-09 11:59:04 -05:00
mcilwain
393eeabc5e Ensure that poll messages are created in domain create flow tests
Also ensures that a custom logic hook is called on create.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143112481
2017-01-09 11:59:04 -05:00
ctingue
1c927a48e9 Filter synthetic OneTimes from billing SQL
I intend to configure ExpandRecurringBillingEventsAction in production in the near future, but until I verify that there's a 1:1 match between OneTimes expanded via SQL and OneTimes expanded via MR, filter the MR-synthetic OneTimes from the billing data view SQL.

I confirmed that this is the only script that consumes data from OneTime.

(Note that the best way would be to check for the SYNTHETIC flag, but syntheticCreationTime has a value iff the flag exists, and parsing the flags field is a relative pain in the neck compared to checking for null -- this is temporary.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143108200
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
48a1bacbb0 Get rid of the delete() method on ReservedList
It wasn't being used by any actual code, and having helper methods handling
saving/persistence on entities like this is not a pattern we want to encourage,
since it hides Datastore transactions from further up in the call chain. The
idea is that you can always look for ofy() calls in the same layer of code to
see where persisted data is being changed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143036027
2017-01-09 11:59:04 -05:00
mcilwain
28f6c770c8 Add MOE equivalence for sync on 2016-12-19
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142449539
2017-01-09 11:59:04 -05:00
nickfelt
0405a427f1 Remove unnecessary SecureRandom from UrlFetchUtils
We're only using it for generating multiparty boundaries, and there's no real need for the random boundary values to be cryptographically secure.  The point of the randomness is just to make collisions with content in the payload sufficiently unlikely.  The app itself controls the payload contents, and while it might be derived from user-submitted content, in practice it would be nearly infeasible to get the payload to contain arbitrary boundary values even if the RNG-produced boundaries could be determined in advance.

To further insulate against this, I've increased the boundary size (from 40 bits to 192) and added an actual check that the boundary isn't present in the input data, so that in the extremely unlikely event of a collision, we fail rather than producing an invalid multipart request.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142784289
2016-12-22 16:10:44 -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
720f03cc17 Wire in domain transfer custom pricing and add a test
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142593949
2016-12-22 16:07:39 -05:00
mcilwain
7e5c6edfe3 Make enum fields in ProtocolDefinition final
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142294958
2016-12-19 11:09:20 -05:00
mountford
9764ab0a56 Add missing dependency on Jackson2 library
The com.google.client.api.json.jackson2 package depends on the com.fasterxml.jackson.core library, but this was not properly reflected in the Nomulus build files. The problem was masked because the library was getting pulled in by other dependencies, but when they were removed, the bug came out.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142291622
2016-12-19 11:09:20 -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
mountford
0afafeff03 Move VerifyEntityIntegrityAction to batch package
By moving []s into the batch package, which is not included in the frontend service, we pave the way to remove the dependency of frontend on the [] library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142265351
2016-12-19 11:09:20 -05:00
mountford
246098d8e8 Remove unneeded reference to [] libraries
The flows package no longer needs [].

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142263353
2016-12-19 11:09:20 -05:00
mountford
669c3dc975 Move the async [] classes out of the flows package
We should be able to remove the dependency on the App Engine [] library from the frontend service, since no []s actually run there. In order to do this, we need to remove the various []-reliant classes from the frontend service build. This CL begins the process by moving the two async "flows" to a different package which is not included in the frontend service.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142159568
2016-12-19 11:09:19 -05:00
Tom Johnson
b0ebeed5a5 Add @ReportedOn annotation for BigQuery exports
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142038227
2016-12-19 11:09:11 -05:00
mcilwain
6cdac0462a Mark enum field on CreditType as final
Enums should be immutable, so all fields on them should be final.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142025872
2016-12-19 10:34:14 -05:00
cgoldfeder
5b9219fbdd Add filter support to the test server
The lack of ObjectifyFilter means that in any tests using
RegistryTestServer the Objectify session cache persists
between "requests" in the same test method. This is wrong
but had not caused any failures because we didn't assert
anything that mattered. However, a CL I'm working on
asserts that there is a creationTime on a created resource,
which is set automatically on Datastore save, and therefore
is still null in the session cache's version of the resource
if you don't clear it before the next command. Fixing it here
separately from that CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141939330
2016-12-13 18:00:15 -05:00
mcilwain
c281f54def Add getter to CheckData
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141926948
2016-12-13 16:05:22 -05:00