Commit graph

220 commits

Author SHA1 Message Date
mcilwain
bb87b6e74f Remove outdated regtype comment
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126416855
2016-07-01 13:45:32 -04:00
mcilwain
38bd9d7b4d Add TldSpecificLogicEngine to open source release
It's now being depended on by other parts of the codebase.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126415327
2016-07-01 13:44:14 -04:00
ctingue
273fc0014d Add EAP fees to domain create flow
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126411200
2016-07-01 13:42:58 -04:00
ctingue
d6bd2d56cd Return expiry date along with the EAP fee
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126407427
2016-07-01 13:41:38 -04:00
ctingue
9f731ba4d0 Clean up BaseFeeResponse.setFee() and call sites
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126229075
2016-07-01 13:38:57 -04:00
nickfelt
01698059f6 Fix flow double-init bug by removing @FlowScope on provideFlow()
See [] for details, but basically, @FlowScope causes the Flow instance produced by flowProvider.get() in FlowRunner to be the same each time it's called, which leads to the instance being re-used when a transactional retry (e.g. for a ConcurrentModificationException) causes a flow to be attempted more than once.  Flow is not meant to be re-used and certain flows fail at runtime when this happens, so the effect is that a CME now aborts most EPP requests, which is bad.

This is a bit of a hacky fix; finding a better one is tracked in []

== TESTING ==
This is very hard to test because there isn't really a clean way to trigger a CME from within a flow's execution without hardcoding in assumptions about what a given flow is doing when it runs, and we can't easily supply a custom Flow for testing while also exercising the Flow daggerization process (since this bug only appears due to the specific way that dagger constructs the Provider<Flow>).  Ideally a fix would improve the testability here as well.

For now, I've manually tested this change by pasting code into FlowRunner that explicitly throws a ConcurrentModificationException after running the flow (similar to DryRunException), but only on the first transaction attempt.  With @FlowScope on provideFlow(), this change reproduces the UnsupportedOperationException issue in many tests; once it's removed (i.e. with this CL submitted) the problem goes away.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126226066
2016-07-01 13:36:15 -04:00
ctingue
65f920594b Fix minor items on recurring billing expansion MR
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126060671
2016-07-01 13:32:17 -04:00
Ben McIlwain
372bf5718e Fix import to use canonical Preconditions package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125990307
2016-07-01 13:30:58 -04:00
Wolfgang Meyers
bdfa97b0ae Add XjcToContactResourceConverter
XjcToContactResourceConverter is, as it name suggests, an inverse of
ContactResourceToXjcConverter. This utility class is designed to
support the TLD data import feature.

EXTERNAL_REVIEW_URL=https://github.com/google/domain-registry/pull/19
GIT_AUTHOR=Wolfgang Meyers <wolfgang@donuts.co>
(With some minor changes by Ben McIlwain.)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125985714
2016-07-01 11:38:05 -04:00
Ben McIlwain
9eeb0c43a1 Change import to reference canonical implementation of checkArgument
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125984267
2016-06-27 16:48:41 -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
nickfelt
a4091594d0 Add new JSON logging to FlowRunner for EPP activity reporting
We've been using the very fragile newline-delimited legacy logging
statement in FlowRunner for ICANN reporting for a long time.  While
this is bad in a few ways, the worst is that the parsing of this
logging statement is extremely fragile (e.g. adding/removing fields
can easily break the parsing).  This is in fact part of what broke the
ExportLogsServlet parsing last fall ([] and forced us to
recover by manually parsing the log statement (and its XML) in
BigQuery.  It also broke again in [] where we were relying
on matching the logging classname, since matching on 'EPP Command'
was considered insufficiently narrow.

This introduces a new JSON-format logging statement to FlowRunner
that fixes both of these problems:

 1) it replaces the newline-delimited "format" with a JSON-based
    format, so that we can add new fields much more easily and
    reliably support logging more structured data

 2) it replaces the short 'EPP Command' signature with a much more
    targeted 'EPP-REPORTING-LOG-SIGNATURE' signature so that we can
    use that alone for matching, rather than relying on the class
    name in the log message

What this doesn't fix is the fact that we still need to parse the
XML in BigQuery; we should fix this by logging the parts of the XML
that ICANN reporting needs explicitly, but that'll be a subsequent
change, since while the existing approach is gross, it's actually
much less fragile than just matching the log statement itself.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125902976
2016-06-27 16:45:55 -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
nickfelt
6fa1c2d91c Refactor SessionMetadata and TransportCredentials toString() methods
This cleanups up the toString() methods of all implementations of
these interfaces, as pre-work for adding tests against the legacy
logging statement in FlowRunner used for ICANN reporting, so that we
can validate against any changes to that log statement in the future.

It removes system hash codes since those aren't really safe to rely on
in test code and they really don't help with debugging anyway.  It
also standardizes SessionMetadata.toString() a bit and regroups
methods on that interface so all the getters are together.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125686039
2016-06-27 16:43:12 -04:00
Ben McIlwain
84eb3c8666 Upgrade apache_sshd CL #2: Update to v1_2_0
This changelist makes the newly added v1_2_0 the default and fixes incompatibilities
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125609347
2016-06-27 16:41:48 -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
dpb
86af4c2f6a Replace nested @Multibindings interfaces with the new @Multibinds feature. See []
If the enclosing module can be abstract, pull @Multibinds methods up into it; otherwise, replace the @Multibindings interface with a @Module and include it into the enclosing module.

Tested:
    TAP --sample for global presubmit queue
    []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125589112
2016-06-27 16:37:42 -04:00
jart
e009d85855 Fix soy open source build error
All [] paths relating to soy are encompassed by @io_bazel_rules_closure[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125498324
2016-06-27 16:33:28 -04:00
cgoldfeder
2bcad14bdb Remove unused class
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125491862
2016-06-27 16:32:08 -04:00
mcilwain
98c88fee1a Make deeplinking verification calls to IRDB
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125491372
2016-06-27 16:30:45 -04:00
cgoldfeder
0d47534246 Inject flows with a nested ternary rather than a map
This is more efficient (we were constructing all the
providers and the map anew for every flow) and prettier.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125479328
2016-06-27 16:29:19 -04:00
cgoldfeder
317e92d88c Inject two fields into flows.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125453450
2016-06-27 16:27:57 -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
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
2b2fb958f6 Turn CheckApiAction into a standard-ish epp endpoint
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125335634
2016-06-27 16:22:12 -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
1d2d81492e Simplify an exception's constructor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125127036
2016-06-27 16:12:00 -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
nickfelt
038d3d5031 Fix latest_snapshot "pointer" query to use to fully-qualified table reference
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125105776
2016-06-27 16:09:10 -04:00
cgoldfeder
b6da74d424 Update the hardcoded clTRID in the check api
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125087399
2016-06-27 16:07:47 -04:00
mmuller
0306b81040 Add setFee(List<Fee>) method to BaseFeeResponse
We need a flavor that accepts a list in order to set this from data returned
from the pricing system.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125078913
2016-06-27 16:04:58 -04:00
mmuller
61f37b756a Add TimedTransitionProperty.getTransitionTime()
Add a method to get the next transition time so that we can return the expiry
date along with the EAP fee for a given time.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125076484
2016-06-27 16:03:36 -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
cgoldfeder
a277e7c040 Fix another instance of generic abuse
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125064618
2016-06-27 16:00:41 -04:00
cgoldfeder
3be61a13b5 Format EppMetrics a bit nicer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125061643
2016-06-27 15:59:16 -04:00
ctingue
3e0963dfdb Dual-read RegistryCursor prior to Cursor cutover
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125057857
2016-06-27 15:57:51 -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
nickfelt
6466ad51f6 Fix entry-overwriting bug in PremiumList.saveAndUpdateEntries()
The saveAndUpdateEntries() method was always saving entries under the current entity's revisionKey, and then always deleting them under the old entity's revisionKey - even if the revisionKeys were the same (i.e., we didn't change any entry content in the list, in which case the builder's build() method doesn't create a new revisionKey).

This would have caused the existing entries to be unnecessarily resaved, and (worse) then caused those same existing entries to all be deleted.

This fixes the bug by only resaving entries when the revisionKey has changed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124873871
2016-06-27 15:53:34 -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
Hans Ridder
2ac5d3694b Cleanup DnsUpdateWriter
- Update DnsUpdateWriter to load nameservers names using
  DomainBase.loadNameserverFullyQualifiedHostNames() to be consistent with
  other uses.
- Pass "whole entity" to helper methods to simplify code.
- Cleanup damage from prior rename of DnsMessageTransport.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124854517
2016-06-14 16:33:26 -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
Kurt Kluever
cc01035fe8 Remove "catch (FooException e); throwIfInstanceOf(e, FooException.class)" and just let the FooException propagate naturally.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124847480
2016-06-14 16:31:47 -04:00