Commit graph

36 commits

Author SHA1 Message Date
cgoldfeder
ae039aa0d8 Remove all vestiges of memcache
Memcache is already off but now it's not in the code anymore.

This includes removing domain creation failfast, since that is actually
slower now than just running the flow - all you gain is a non-transactional
read over a transactional read, but the cost is that you always pay that
read, which is going to drive up latency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158183506
2017-06-14 10:28:24 -04:00
cgoldfeder
927eb43cbc Un-Ignore a test in DomainApplicationCreateFlowTest
A little injection-foo makes this test possible to run.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154442134
2017-05-03 10:44:56 -04:00
cgoldfeder
b6e50f0467 Turn on memcache in flow tests.
No tests break because of this, but some tests that were previously
intentionally clearing memcache (for example, the test in
DomainInfoFlow that counts datastore calls) are now doing something
that is not a no-op anymore.

Also fix an incorrect comment about memcache in DatastoreHelper.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154087182
2017-04-26 11:04:56 -04:00
mcilwain
c1643fa3cd Correctly set clientId on EPP metrics in LoginFlow
This wasn't being recorded correctly because the clientId is only
set in LoginFlow after the flow succeeds, whereas we were
previously logging the clientId before executing the flow. This
adds special handling for LoginFlow. Note that we only set the
metric label to the clientId for valid registrar logins, to ensure
that metric cardinality doesn't grow unbounded (as it might if we
used every arbitrary string passed in as an attempted login).

This also refactors creation and handling of FakesAndMocksModule so
as to be able to make test assertions about EPP metrics from
integration flow tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154048280
2017-04-26 10:56:13 -04:00
mountford
89b3e9c55b Remove some unnecessary uses of MockitoJUnitRunner, which is discouraged
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153719402
2017-04-26 10:47:13 -04:00
mcilwain
4606b1d08e Only inject EPP metric builder in a single place
This fixes recording of number of attempts and command name on EPP
flows, which was broken because a separate metric builder was
being injected in two places, EppController and FlowRunner, with the
one injected into FlowRunner being discarded rather than having changes
applied to the same instance as in EppController.

This also adds a test that the metric is created successfully inside
a flow. Note that tests already exist for EppController to ensure that
the metric is recorded correctly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152306596
2017-04-10 13:37:18 -04:00
mcilwain
cdadb54acd Refer to Datastore everywhere correctly by its capitalized form
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147479683
2017-02-17 12:12:12 -05:00
mcilwain
ec55aa5361 Resolve some Guava 20 TODOs (mostly unnecessary asList() calls)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146799536
2017-02-07 13:27:40 -05:00
mmuller
b70f57b7c7 Update copyright year on all license headers
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146111211
2017-02-02 16:27:22 -05:00
Justin Graham
f3388326d6 Add FlowMetadata (containing isSuperuser) to custom flow logic
This also bypasses signed mark validation during domain creation if
the flow is being executed as superuser.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145435268
2017-01-25 12:25:34 -05:00
eaftan
f15bb698ae Reduce visibility of test helper method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145084942
2017-01-25 12:20:30 -05:00
mcilwain
a28e0b3ff7 Use enum instead of boolean for TMCH CA mode
Also more narrowly scopes a catch block in TmchCertificateAuthority.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144744847
2017-01-18 11:11:35 -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
mountford
78a36925f4 Remove commitAdditionalLogicChanges(), part 1
Now that the flows are flattened, the commitAdditionalLogicChanges() call, which used to come later in the flow to actually save the Datastore objects, is now happening right after the performAdditionalXXXLogic() call. So we can instead just do the saves in performAdditionalXXXLogic(), and get rid of the separate call. As a first step, this CL simply makes commitAdditionalLogicChanges() a private method that gets called internally by the extra logic manager. Later, we can move the saves into their proper position, affecting only the extra logic class itself.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137529991
2016-11-02 15:19:34 -04:00
mcilwain
cfbf62ef4e Move ExceptionRule up to FlowTestCase
This removes a much larger number of independent field defs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135846921
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
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
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
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
Brian Mountford
8443da5c5c Support multiple versions of the EPP Fee Extension
We want to support multiple versions of the fee extension, to allow new features while maintaining backward compatibility. This CL extends the framework and adds one new version, 0.11 (spec version 7), to the existing version 0.6 (spec version 3). A follow-on CL will add version 0.12 (spec version 8).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127849044
2016-07-21 14:53:50 -04:00
mcilwain
aa2f283f7c Convert entire project to strict lexicographical import sort ordering
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127234970
2016-07-13 15:59:53 -04:00
ctingue
2caba95d28 Tidy up ExpandrecurringBillingEventsAction
Per nickfelt's suggestion on []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127193451
2016-07-13 15:58:34 -04:00
mcilwain
e87987072b Get app cert hash from Play Store API and send it to IRDB
This is needed because IRDB contains information on Android apps that
aren't in the Play Store, and differentiates them by production
certificate SHA256 hash fingerprint.  So we need to know the value of
this hash in order to ask IRDB about links to/from a specific app,
which we can fortunately get by querying the Play Store.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125566907
2016-06-27 16:34:53 -04:00
cgoldfeder
c9a16f7f11 Dagger, meet Flows. Flows, meet Dagger.
Daggerizes all of the EPP flows. This does not change anything yet
about the flows themselves, just how they are invoked, but after
this CL it's safe to @Inject things into flow classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125382478
2016-06-27 16:26:29 -04:00
cgoldfeder
116bf1f4d6 Fix a bad assumption in DomainAllocateFlowTest.
Despite the comment, DomainAllocateFlow is absolutely registered in
FlowPicker. It gets picked if there's a domain create epp command that
also specifies the allocate extension. Remove the explicit setting of
flowClass, and remove two tests that now fail because DomainCreateFlow
gets loaded - which is the desired behavior.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125339191
2016-06-27 16:25:02 -04:00
cgoldfeder
bb82f5bc05 Clean up the tattered shreds of SessionMetadata
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125334811
2016-06-27 16:20:48 -04:00
cgoldfeder
2a3a3fbc30 Break SessionSource out of SessionMetadata and rename it EppRequestSource.
The "SessionSource" has nothing to do with sessions (and it's often
used in sessionless contexts). What it does indicate is the endpoint
used to make the request.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125295224
2016-06-27 16:19:21 -04:00
cgoldfeder
fd6c4888db Decouple superuser from SessionMetadata
Superuser should only be settable via the tool (see []
which is merged in here but not diffbased, and which removes
the implicit superuser for CharlestonRoad). It is a property
of the request, not of the session (there are no sessions in the tool).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125204707
2016-06-27 16:17:57 -04:00
cgoldfeder
e359ab5f52 Decouple dryRun from SessionMetadata
dryRun is only available via the (sessionless!) tool, and is not
a property of the session.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125203026
2016-06-27 16:16:27 -04:00
cgoldfeder
3ae646d687 Decouple SessionMetadata and TransportCredentials
TransportCredentials are per-request, not per-session, and
there's no reason to carry them within SessionMetadata.

While I'm in here, get rid of "null" credentials.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125202213
2016-06-27 16:14:57 -04:00
cgoldfeder
31ddced437 Move two enums from FlowRunner to FlowTestCase.
They are only needed in test code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125126550
2016-06-27 16:10:37 -04:00
Corey Goldfeder
0ce293325c Actionize the EPP endpoints.
This introduces Actions and Dagger up until FlowRunner. The changes
to the servlets are relatively simple, but the required changes to
the tests, as well as to auxillary EPP endpoints (such as the http
check api and the load test servlet) were vast. I've added some
comments in critique to make the review easier that don't really
make sense as in-code comments for the future.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124593546
2016-06-14 16:30:12 -04:00
Corey Goldfeder
5a2f63cf58 Make Hello flows use the flow "now" time
This cleans up some of the tests, and helps with
future injection CLs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124208164
2016-06-14 16:29:02 -04:00
mcilwain
ca0e546230 Add package for flow pickers
This also renames the existing FlowRegistry to FlowPicker to avoid
overloaded uses of the word "registry".  Absent this renaming, the new
package would've been google.registry.flows.registry, which gives
entirely the wrong impression as it makes it sound like the home for
flows that affect TLDs.

This is a preparatory CL for adding flow picker engines that will
allow customized flows to run on a per-TLD basis.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122671260
2016-05-27 12:41:11 -04:00
Michael Muller
c458c05801 Rename Java packages to use the .google TLD
The dark lord Gosling designed the Java package naming system so that
ownership flows from the DNS system. Since we own the domain name
registry.google, it seems only appropriate that we should use
google.registry as our package name.
2016-05-13 20:04:42 -04:00
Justine Tunney
5012893c1d mv com/google/domain/registry google/registry
This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
2016-05-13 18:55:08 -04:00
Renamed from javatests/com/google/domain/registry/flows/FlowTestCase.java (Browse further)