Commit graph

71 commits

Author SHA1 Message Date
mcilwain
aa7c05cb8b Improve pretty-print diffing of Datastore entities
This removes the countless lines of the form "[null, []]" in registry_tool diffs
that are an artifact of the way we handle nulls in Objectify.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133409440
2016-09-19 12:06:54 -04:00
ctingue
75203918a9 Add command for creating LRP tokens
Command allows for both one-off creation and bulk import of assignees via file (the latter will be used for the initial import from Play Store).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133048360
2016-09-14 16:02:08 -04:00
nickfelt
e478fd09fb Remove straggling JarKeyring link and sort MOE-added imports
Followups from []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132564245
2016-09-14 15:29:30 -04:00
mcilwain
3b4b7a475b Replace VoidKeyring with InMemoryKeyring and a dummy module
VoidKeyring always threw exceptions whenever any of its methods were called,
which caused several parts of the system to fail early (and thus required a
proper Keyring to be implemented almost immediately, early on in the "just
playing around with the system" phase).

I'm swapping this out with an InMemoryKeyring which is supplied by
DummyKeyringModule, which, instead of throwing exceptions, returns dummy
values, delaying the onset of errors to when connecting to external services
is attempted.  This pushes off the required implementation of a real Keyring-
providing module, allowing the system to be played around with more first.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132361157
2016-09-07 12:15:08 -04:00
ctingue
daca7d65c2 Allow PasswordGenerator to use different alphabets
Per mcilwain's suggestion in the LRP design doc, LRP tokens should use a Base58 alphabet. I'll move PasswordGenerator out of the tools package and into a utils class in a future CL, as we'll want to use this generator in the LrpToken class itself rather than relegate the token definition to a tool.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132358363
2016-09-07 12:07:58 -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
mcilwain
dd09dc1837 Rename soy templates to use consistent naming scheme
We use {EPP resource}{action} as the naming scheme everywhere else, so we shoudl do so here too.  It's generally nicer for files to group by type of EPP resource (so all of the domain actions are together) than by type of action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130955192
2016-08-22 14:48:40 -04:00
mcilwain
965cf6edc3 Add registry_tool host_create command
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130953679
2016-08-22 14:45:54 -04:00
mcilwain
9e810c4b36 Add gtech_tool target to tools BUILD
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130545312
2016-08-22 14:16:12 -04:00
jianglai
27820c512e Small fixes for orphan glue cleanup []
Moving to tools module for consistency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130435371
2016-08-22 14:04:44 -04:00
jianglai
d2f033d9ed Ad-hoc refresh of all domains to clean up orphan glues
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130424917
2016-08-22 13:57:22 -04:00
jianglai
5f26196993 Add create_domain command to gtech_tool
Support creating domain with gtech_tool, instead of creating temporary epp file
and run execute_epp manually. Also changes CreateContactCommand for consistency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130127280
2016-08-15 16:53:01 -04:00
shikhman
e55ed209c5 Fix NPE in registry_tool when creating or updating a TLD with a dns writer
I forgot to inject the CreateTldCommand/UpdateTldCommand commands, which now
need to be injected so that the list of available DnsWriter implementations is
instantiated. This CL also adds a new DI Set<String> with just the name of the
writer, so that the instantiated writer map (which may have many DI dependencies)
doesn't need to be pulled in.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130042215
2016-08-15 16:48:20 -04:00
ctingue
2e88129c43 Swap id and indexed field in LrpToken
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130014294
2016-08-15 16:39:03 -04:00
Chris Tingue
1ef8716177 Add LRP TLD states to Registry and *_tld tools
Also had to add an EnumParameter class to support
List<T extends Enum<T>>, as these aren't natively supported by
JCommander (although single Enum parameters are.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129464699
2016-08-05 20:41:11 -04:00
Greg Shikhman
a620d06239 Add dagger map for injecting DnsWriter implementations
This is one of several CLs in a sequence for allowing per-TLD DNS
implementations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129445641
2016-08-05 20:38:21 -04:00
mcilwain
ea24f6ca31 Use string keys for the multimap of pricing engines for TLDs
This is better than the previous way of using the canonical name of the class,
because the previous way did not allow for refactoring, and also required the
PremiumPricingEngine to live in the model package lest there be circular
dependencies, which does not seem ideal.

Note that, for reasons of backwards compatibility with existing persisted data,
the name of the static premium pricing engine has been set to its canonical
class name, but the class can now be refactored going forward so long as this
string remains unchanged, and any new pricing engine implementations can use
whatever string key they want (it doesn't have to be a canonical class name).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129215185
2016-08-03 11:16:01 -04:00
Chris Tingue
eb76b063b3 Move LRP token and tools into domain package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129134685
2016-08-02 19:22:44 -04:00
Justine Tunney
7f3f03ee97 MOE strip compatible_with
This is an internal-only feature that breaks the open source build.

CL created with:

    dr-replace '(compatible_with.*)' '\1  # MOE:strip_line'

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128852873
2016-08-02 19:14:28 -04:00
Chris Povirk
5332ac4e4a Set compatible_with=appengine on GAE targets
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128475519
2016-08-02 19:09:11 -04:00
Chris Tingue
9c28534b64 Add --set_current_tld_state to UpdateTldCommand
This feature would have been useful earlier when I was changing the TLD
state on a sandbox TLD on-the-fly for testing purposes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128088578
2016-08-02 19:02:19 -04:00
ctingue
a3cade3e20 Add --set_current_tld_state to UpdateTldCommand
This feature would have been useful earlier when I was changing the TLD state on a sandbox TLD on-the-fly for testing purposes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128088578
2016-07-21 17:54:41 -04:00
Justine Tunney
e82a40a2fb Add WHOIS disclaimer text to ConfigModule
This fixes #23 for @parsoj by allowing a custom disclaimer to be
specified via dependency injection modules.

By making the disclaimer part of the dependency injection graph, it can
come from anywhere.

For example, if I was Donuts, I would have my own repository. I'd use an
external http_archive() repository for Domain Registry. Then I would
write my own Dagger @Component for each App Engine module. My Component
would have a list of Dagger Modules, which I copied from the Domain
Registry version. Then I would swap out ConfigModule with my own
DonutsConfigModule, which provides the same values.

So long as a method exists that @Provides @Config("whoisRegistry"), and
the module containing it is listed in the @Component, the dependency
injection graph becomes valid and complete for the whois package
(provided other dependencies are met.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128082921
2016-07-21 14:55:38 -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
mountford
e72491e59b Replace to(Upper|Lower)Case with Ascii.to$1Case
The presubmits are warning that toUpperCase() and toLowerCase() are locale-specific, and advise using Ascii.toUpperCase() and Ascii.toLowerCase() as a local-invariant alternative.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127583677
2016-07-19 10:43:38 -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
458a673601 Remove cursor migration scrap tools
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126935942
2016-07-13 15:51:36 -04:00
jart
5ebfb87651 Update Domain Registry to Closure Rules v0.2.3
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126911095
2016-07-13 15:44:35 -04:00
gak
a47cc2a85c Migrate @Provides methods to @Binds methods where possible.
@Binds is a much more efficient way to delegate one binding to another in that:
  * The @Binds method does not need to be invoked
  * It does not generate an additional Provider implementation
  * An additional Provider does does not need to be instantiated
Future changes to Dagger's component processor will add even further benefits.

More information: []

ATTENTION REVIEWERS: This migration is being done with global approval.  Per-project approval is not required.

Tested:
    TAP train for global presubmit queue
    []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125980758
2016-06-27 16:47:18 -04:00
ctingue
14522eac0c Cut RegistryCursor over to global cursors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125797729
2016-06-27 16:44:35 -04:00
ctingue
744648b5d3 Create scrap tool for deleting old RegistryCursors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125597754
2016-06-27 16:40:22 -04:00
ctingue
385206a81e Scrap tool for verifying dual-written cursors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125593970
2016-06-27 16:39:01 -04:00
cgoldfeder
757aed2d80 Replace the login validating command with a non-EPP impl
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125336530
2016-06-27 16:23:38 -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
fe1cd06da8 Remove some cruft in CommandUtilities
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125127487
2016-06-27 16:13:31 -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
mmuller
4f91d03704 Add a flag to registry_tool for EAP
Add a flag to CreateTldCommand to allow us to set the EAP fee schedule for the
registry.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125068579
2016-06-27 16:02:11 -04:00
mmuller
5a4877805b Validate EAP currency in Registry build
Verify that the currency of all entries in the EAP fee schedule map matches
that of the registry object itself.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124967612
2016-06-27 15:56:29 -04:00
cgoldfeder
ec39f15a23 Fix generics in EppXmlTransformer.unmarshal to not be only on the return type.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124914271
2016-06-27 15:55:03 -04:00
Justine Tunney
45747fd792 Make open source build pass
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124868265
2016-06-14 16:33:56 -04:00
Nick Felt
9a2b88ee28 Add --reason flag to UpdateSmdCommand
Just an old patch that I had lying around and never mailed out.  Seemed like it could be worth having checked in.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124853504
2016-06-14 16:32:44 -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
Ben McIlwain
6ba1d5e6df Rename PricingEngine to PremiumPricingEngine
This properly reflects the fact that other, separate things will now
be responsible both for EAP and for per-TLD custom pricing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124558165
2016-06-14 16:29:52 -04:00
Corey Goldfeder
366c5a344d Change the LoadTestAction to use /_dr/epptool
The load tests used to directly build EPP, but that becomes
problematic for an upcoming CL that refactors a lot of the
EPP flow code. Instead, use the existing tool endpoint
(conveniently, LoadTestAction is already in the tools module).
This required changing the EppToolServlet to get its
xml from a param rather than from the request payload,
since task queues won't allow both a payload and request
params on the same task.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124351878
2016-06-14 16:29:22 -04:00
mcilwain
91f6c7006e Add additional return values to PricingEngine interface
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123658519
2016-06-06 12:14:51 -04:00
mcilwain
4876d09d6c Add scaffolding of deeplinking verification []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123450717
2016-06-06 12:11:59 -04:00