Also fixes bug in handling of future-dated Recurring billing events.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140048357
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
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
This also adds beforeValidation hook to DomainCreateCustomFlow.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139828346
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
[] 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
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
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
This is the second phase of a three phase migration to remove
ReferenceUnions. As of the end of this phase, ReferenceUnions are no longer read
from in any active code paths, but are still written to in case a rollback to
the previous version is necessary. The third and final phase will remove the
ReferenceUnions entirely.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137951076