Commit graph

612 commits

Author SHA1 Message Date
mcilwain
5eb9702f05 Improve ListDomainsCommand to list domains on multiple TLDs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140053423
2016-11-28 11:36:17 -05:00
ctingue
35d88a9f8c Rethrow exceptions in ExpandRecurringBillingEventsAction
Also fixes bug in handling of future-dated Recurring billing events.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140048357
2016-11-28 11:34:30 -05:00
jianglai
9a616ccd7f Add extensible custom logic to the domain renew flow
This also adds a TODO in DomainCheckFlow to document the fact that as-of date is not overridden when passed to the custom logic.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140031318
2016-11-28 11:32:47 -05:00
mmuller
ddacd33c5e Retry RDE report on SocketTimeoutException
It's likely that either 1) we should be doing this for more than a
SocketTimeoutException - we probably want to do this in the case of a number
of different transient failures 2) we don't want to do this at all because it
happens in a background task that will get re-run anyway.

In any case, this seems like the right fix and it addresses a problem we see
occassionally.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139935190
2016-11-28 11:31:16 -05:00
mcilwain
b3907d5d90 Add Javadocs to parameters for DomainCreateFlowCustomLogic methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139912059
2016-11-28 11:29: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
jianglai
2d85ec9aa3 Add extensible custom logic to the domain info flow
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139584129
2016-11-28 11:26:42 -05:00
cgoldfeder
5bac24186f Add the ability to dump the history of a single resource
This would have saved me 2+ hours yesterday of mucking around
in datastore and manually copying out the xml bytes so that
I could base64decode them.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139472542
2016-11-28 11:25:06 -05:00
cgoldfeder
419a04bc26 Command to resave datastore entities by websafe key
While I am doing this, promote LoadAndResaveEntityCommand from
javascrap to the main tool since it's repeatedly been useful, and
rename it and update its documentation to better reflect the
difference between that command and the one I am adding.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139460841
2016-11-28 11:23:29 -05:00
mcilwain
c711097357 Fix a generic type inference issue in Java 7
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139378025
2016-11-28 11:20:09 -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
16c53c6996 Fix uncaught LEADING_HYPHEN IllegalArgumentException in host flows
This should have been getting turned into an InvalidHostNameException, but
wasn't. I've added tests for HostFlowUtils verifying the correct behavior for
this. Idn.toASCII() can throw IllegalArgumentException for some combinations
of input, including hostnames with a leading hyphen, so the call should be
inside the try block that turns IAEs into InvalidHostNameExceptions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139373849
2016-11-16 17:09:45 -05:00
cgoldfeder
438eeb5e38 When resolving a transfer to SERVER_CANCELLED (on delete) still pass in a time
Currently we pass in null. However, from the spec:

<domain:acDate> element that contains the date and time of a
      required or completed response.  For a PENDING request, the value
      identifies the date and time by which a response is required
      before an automated response action will be taken by the server.
      For all other status types, the value identifies the date and time
      when the request was completed."
          - https://tools.ietf.org/html/rfc5731#page-16, section 3.1.3

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139363370
2016-11-16 17:08: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
cgoldfeder
fdc8ceb6bb Scope down lastTransferTime to only ContactResource, DomainResource
and HostResource.

DomainApplication is not transferable and has no need for this
field. HostResource needs it because it can be transferred with
a domain.

This is all in service of removing the ofy().load() inside of
host's cloneProjectedAtTime.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139346925
2016-11-16 17:05:13 -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
mcilwain
3942f0768b Fix Nomulus build type inference error on resolvePendingTransfer()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139219997
2016-11-15 15:19:29 -05:00
mountford
fb47d2563d Add extra flow logic hooks for transfer approve, cancel and reject
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139217498
2016-11-15 13:52:01 -05:00
cgoldfeder
84009eaccb Scope down TransferData to only ContactResource and DomainResource
HostResource and DomainApplication are not transferable, (or at
least, not directly in the case of hosts) and have no need for
the TransferData field. In a flat-flow world, we can push it down
to where it's actually used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139201423
2016-11-15 13:47:28 -05:00
mountford
890354938c Switch TMCH SMDRL fetch job to start at 00:15 and 12:15
The job was starting at midnight and noon, which is exactly when the files are changing. This resulted in intermittent failures, as the files are temporarily missing during the changeover.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139081163
2016-11-15 11:02:42 -05:00
mcilwain
7ed02f4612 Reload resources before saving in ReloadAllEppResourcesAction
This prevents a potential blind write scenario in which something else has concurrently modified the EppResource in between load and save, and those changes then get overwritten.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138911873
2016-11-15 10:59:47 -05:00
ctingue
fab8ca8414 Move injectable config values into ConfigModule
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138903917
2016-11-15 10:58:20 -05:00
ctingue
1b6f2f82cd Clean up BillingEvent.Reason.AUTO_RENEW and scraps
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138903021
2016-11-15 10:56:52 -05:00
cgoldfeder
d5104df453 Fix two ErrorProne warnings in TypeUtils
1) Prefer .getConstructor().newInstance() over .newInstance()
   because otherwise checked exceptions can be propagated from
   the constructor even though they aren't declared.
2) Use the type T in the parameters to instantiate().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138874730
2016-11-15 10:50:39 -05:00
nickfelt
f742ac8056 Refactor RequestHandler to handle request component construction
This refactors RequestHandler so that it handles the construction of the request
component itself, rather than being handed a pre-built request component
instance constructed by the invoking servlet.

The motivation for this change is so that RequestHandler can be extended in
future CLs to compute authentication results, and can provide those results as
an available binding in the constructed request component.  An alternative
approach could have been to compute the authentication results within
RequestModule itself, but I think it's clearer to keep business logic like
that outside of Dagger providers.

This CL makes the following individual changes:

- Adds request component builders, which implement a RequestComponentBuilder
  interface so they can all be manipulated by RequestHandler

- Instead of obtaining request components via factory methods on the global
  components, one now can have global-scoped bindings just inject the request
  component builders (which requires adding a module to each global component
  declaring the subcomponent).  This follows the recommended approach here:
  http://google.github.io/dagger/subcomponents.html

- Instead of exposing request components on the global component interface,
  we now expose module-specific subclasses of RequestHandler that @Inject the
  appropriate request component builder's provider and pass it to the superclass
  (note that inheritance isn't strictly necessary here but saves boilerplate)

- RequestHandler now takes the Provider<RequestComponentBuilder> and builds
  the component itself using its own fresh RequestModule instance. This provides
  some nice encapsulation but is mainly needed for adding a RequestAuthModule
  in future work.

- RequestHandler also takes UserService now, which can be provided via Dagger
  by the subclass.  Longer-term that will go away in favor of instead providing
  AuthStrategy instances, some of which will use UserService internally.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138815648
2016-11-15 10:49:05 -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
mcilwain
07a6e55f82 Add missing @Nullable annotations to ForeignKeyIndex load methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138782186
2016-11-15 10:44:32 -05:00
mcilwain
780a5add78 Get rid of ReferenceUnions entirely
This is the third and final phase in the migration away from ReferenceUnions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138778148
2016-11-15 10:42:58 -05:00
mountford
8d97fa5858 Add TLD-specific logic for application creates
This CL applies the status flag logic, but doesn't yet do any name checking

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138769004
2016-11-15 10:39:51 -05:00
mcilwain
274b070b54 Make driveFolderId on Registry entity optional
This defaults to null, and leaving it to null now simply disables reserved terms
exporting, rather than throwing an error every time the action runs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138763161
2016-11-15 10:38:20 -05:00
nickfelt
9122372e38 Change Router to do reflective setAccessible() calls itself
This change moves the reflective setAccessible() calls on the request component
methods (needed so that they can be invoked reflectively from RequestHandler)
to within Router itself, eliminating the need to manually call this from each
Servlet class and then pass in the resulting Method objects.  Instead, we just
pass in the request component class and let Router do the rest.

Old comments say that cross-package reflection is not allowed on AppEngine, but
while it's quite possible this was once the case, I can't reproduce that
limitation, and the documentation seems to contradict any such restriction:

"""
An application is allowed full, unrestricted, reflective access to its own
classes.  It can query any private members, call the method
java.lang.reflect.AccessibleObject.setAccessible(), and read/set private
members.
"""
https://cloud.google.com/appengine/docs/java/runtime#reflection

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138693006
2016-11-10 12:30:44 -05:00
mountford
59c213c66f Add extra flow logic hook for application info
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138683307
2016-11-10 12:30:44 -05:00
mountford
09beacf746 Add extra flow logic hook for domain allocation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138679232
2016-11-10 12:30:44 -05:00
mcilwain
225f25bf42 Fix build error by adding testonly=1 to eclipse BUILD file
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138652263
2016-11-10 12:30:20 -05:00
dxy
0263667dae Add Google Cloud Storage helper for non-GAE environment
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138563147
2016-11-10 12:30:00 -05:00
Francis Aiello
1671508547 Set svID in ConfigModule instead of hard-coding it
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138552819
2016-11-10 12:29:53 -05:00
cgoldfeder
1abd0e1123 Remove FieldExposers, since GAE reflection works normally
Calling setAccessible() cross-package used to fail in
the custom security manager. It never shouldn have failed,
and now it works correctly (not sure when it was fixed) so
remove these trampolines.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138549703
2016-11-10 11:32:07 -05:00
mcilwain
2cbfd6475d Fix @Provides method name in ConfigModule for consistency
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138512734
2016-11-10 11:30:36 -05:00
mcilwain
9aa2f3b96e Make host flows only accept canonicalized host names as input
This now throws errors when a non-lower-cased, non-puny-coded, or non-canonicalized host name is passed in as an input parameter.

The approach we'll take is to first notify registrars which hosts we'll be renaming, then
issue EPP host update commands to effect those renames as superuser, then push this code
live to production.

This fixes #38 on GitHub.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138441130
2016-11-10 11:29:03 -05:00
mmuller
cbe76e8615 Don't throw an exception on orphaned contacts
Return Optional.absent() instead of throwing NotFoundException when a user has
a contact record but the Registrar entity is missing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138423965
2016-11-10 11:27:32 -05:00
ctingue
7a77819977 Add retry logic to CreateLrpTokensCommand
A transient 404 on entity save interrupts a long-running run of this command.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138400654
2016-11-10 11:26:03 -05:00
mountford
baaaacd4f5 Add extra flow logic hooks for application delete and update
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138393251
2016-11-10 11:24:32 -05:00
mcilwain
cef07f6bc5 Use cursor to track updating of registrar sheet
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138221931
2016-11-10 11:21:29 -05:00
ctingue
3a75486c72 Clean up ConfigModule
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138219117
2016-11-10 11:19:58 -05:00
ctingue
b7a98451e6 Add retry logic for SheetSynchronizer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138211996
2016-11-10 11:18:25 -05:00
cgoldfeder
ec73b5ec1c Minor comment fix
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138119838
2016-11-10 11:16:55 -05:00
mountford
994747a8e5 Enable built-in session cleanup in production
[] enabled the built-in App Engine session cleanup servlet in alpha and sandbox, and it appears to be deleting expired sessions at the expected rate of 100 every 15 minutes. So enable it for production as well.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138071390
2016-11-10 11:13:52 -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
2dd703ef3a Refactor authInfo validation
1) Don't do ofy().load() inside a model class (in DomainAuthInfo)
2) Move the one use of verify into the one caller in ResourceFlowUtils
3) Hosts don't support authInfo, so remove useless code

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137984809
2016-11-10 11:07:54 -05:00