Commit graph

328 commits

Author SHA1 Message Date
mountford
59ac00478e Improve BaseFee class and its children
Checks are added to ensure that fees are always non-negative, while credits are always negative, as required by the EPP fee extension specification. Also, BaseFee is made specifically abstract.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131620110
2016-08-30 14:16:41 -04:00
cgoldfeder
8059ab5c90 A @DoNotHydrate annotation for toHydratedString
This is needed for a soon-to-be-submitted CL that changes
all Refs to Keys and therefore removes the logic in
toHydratedString that doesn't expand Keys. We need to be
able to tag types as unexpandable to avoid cycles. It
would be better to tag fields, not types, but that is a
much harder change and not currently needed by the use
case of the following CL, so for now this suffices.

While I am in here, add tests for all of the features
of toHydratedString.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131618634
2016-08-30 14:15:16 -04:00
shikhman
d77dced024 Fix NPE in StackdriverWriter
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131603566
2016-08-30 14:13:50 -04:00
ctingue
942dc58251 Add valid TLD check to LrpToken validation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131438274
2016-08-30 14:10:54 -04:00
mcilwain
db8f8d5ba4 Mark rest of Domain Registry for App Engine compatibility
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131296453
2016-08-26 09:48:37 -04:00
mcilwain
9bdb2ef1f3 Make Stackdriver tests conform to testing practices in rest of codebase
The major changes are using the ExpectedException rule instead of a try/catch
pattern, asserting the message for thrown exceptions, defaulting to JUnit4
unless Mockito is really necessary, and making each test examine one behavior.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131211346
2016-08-26 09:45:10 -04:00
shikhman
1c5b4e16c6 Add metrics to PublishDnsUpdatesAction
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131190862
2016-08-26 09:43:30 -04:00
mcilwain
52bb8a5773 Reduce default [] shards to 100
We've continuously had concurrent modification exceptions for our regularly
occurring []s that run on thousands of shards, perhaps unnecessarily so.
These exceptions started after the last major [] framework refactoring,
which changed the default number of shards from 100 to essentially infinite.  I
don't think infinite is the way to go, and 100 shards should be more than
sufficient for anything we're currently running.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131175353
2016-08-26 09:40:17 -04:00
shikhman
e6beba2d39 Change resource type for Stackdriver to fix metrics push
Currently, it's forbidden for custom metrics to write to the gae_app resource
type.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131076789
2016-08-23 15:48:49 -04:00
shikhman
87314c4469 Add missing dependency to open source build
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130981257
2016-08-22 17:38:40 -04:00
shikhman
b04e54994e Fix open source build
Add missing dependencies to open source build.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130978680
2016-08-22 17:37:01 -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
shikhman
91f8b6da38 Change to metrics to keep track of when the metric value was first set
This CL also adds IncrementableMetric#reset() methods to allow resetting the
value and start timestamp of IncrementableMetrics.

This is necessary because some backends, like Stackdriver, use non-monotonic
changes in cumulative metric values to detect timeseries restarts. Tracking and
re-setting the start timestamp allows users to track mostly monotonic metrics
which may have non-monotonic discontinuities.

See https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries#Point for
more details.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130795229
2016-08-22 14:44:28 -04:00
shikhman
b6eaba08eb Improve service handling and add unit tests for threading behavior in MetricExporter
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130790170
2016-08-22 14:43:05 -04:00
nickfelt
6915e35800 Remove unused redirectIfNotLoggedIn() method
It's superseded by RequestHandler's processing of @Action(requireLogin = true), and is no longer used anywhere:
[]

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130788873
2016-08-22 14:41:41 -04:00
ctingue
61bd6159c9 Log-and-swallow post-kickoff in DeleteEppResource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130787799
2016-08-22 14:40:14 -04:00
cgoldfeder
0e4ce70610 Fix broken JavaDoc
@see tags can't contain a label and a link.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130783416
2016-08-22 14:38:46 -04:00
cgoldfeder
d25be65ed8 Remove an unused import and change @link to @code
...to stop the warnings in this file.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130759383
2016-08-22 14:35:57 -04:00
ctingue
1894b2308b Handle LRP tokens in flows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130679951
2016-08-22 14:30:19 -04:00
cgoldfeder
5ff8b9377c Remove unused request parameter extractor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130672143
2016-08-22 14:24:44 -04:00
shikhman
f10a7d8fb0 Enforce monotonicity for IncrementableMetrics
This change enforces that IncrementableMetrics should only monotonically
increase in value, and adds a new increment() method to increment by one, which is slightly faster than incrementBy (due to a lack of non-negative checking) in the common case that the counter should only be incremented by one.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130578421
2016-08-22 14:20:33 -04:00
shikhman
01e38790fd Fix visibility on MetricsReporter#startMetricExporter()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130576851
2016-08-22 14:19:06 -04:00
shikhman
7a041d066f Improve StackdriverWriter code
Add additional logic to handle cases when a MetricDescriptor is already defined
on the server, fix an NPE in related code, and add additional tests to ensure
that TimeSeries created from native MetricPoints are well-formed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130555708
2016-08-22 14:17:38 -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
shikhman
564bbdef83 Enforce very basic URL-like metric names
This change enforces URL-like metric names to match the behavior of
Stackdriver. The StackdriverWriter no longer prepends a slash, which was a
crutch.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130537347
2016-08-22 14:11:58 -04:00
shikhman
b45c2ca2ee Wire in MetricReporter into the backend servlet to publish metrics
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130468842
2016-08-22 14:07:45 -04:00
mountford
4a34807b1d RDAP: Use IANA identifier as the registrar handle
According to the ICAAN operation profile:

2.1.7. Registries MUST support lookup for entities with the registrar role within other objects using the handle (as described in 3.1.5 of RFC7482). The handle of the entity with the registrar role MUST be equal to IANA Registrar ID. The entity with the registrar role in the RDAP response MUST contain a publicIDs member to identify the IANA Registrar ID from the IANA’s Registrar ID registry. The type value of the publicID object MUST be equal to IANA Registrar ID.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130452501
2016-08-22 14:06:07 -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
shikhman
9b4ef23d92 Change project to projectResource to better match Stackdriver sample code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130432024
2016-08-22 14:01:50 -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
mcilwain
467286d79e Remove registrar certificate state dead code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130418304
2016-08-22 13:55:54 -04:00
mountford
0e794c790a Add additional methods for manipulating timed transition maps
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130311938
2016-08-15 17:13:29 -04:00
nickfelt
d1ea3e3a68 Fix NPE bug in DomainCommand.cloneAndLinkReferences()
See b/30806813 for more context.  Copied from there:  This appears to be happening if we get an EPP domain create command that is missing any contacts (but has a registrant; with no registrant we exercise a different codepath).  In that case, JAXB leaves the contacts field on the Create null, and we try to pass it into Sets.union() as a result of Corey's refactoring in [] that changed contact loading to load the contacts and registrant all at once.  The fix is just to apply nullToEmpty() first.

Note that it's always an error to try to create a domain without any non-registrant contacts, but that's supposed to happen later on in BaseDomainCreateFlow.verifyCreateIsAllowed() via validateRequiredContactsPresent(), which will produce a nice error message.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130309019
2016-08-15 17:13:29 -04:00
mountford
160266f37a RDAP: Implement entity name search
Adds the ability to search for entities (contacts and registrars) by name.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130305930
2016-08-15 17:13:29 -04:00
shikhman
64abebec82 Add StackDriver implementation, in monitoring/metrics package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130287319
2016-08-15 17:12:35 -04:00
mountford
57ec8b3ae3 Add utility methods for copying time transition maps and filtering grace periods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130281141
2016-08-15 17:02:51 -04:00
mountford
19da9a1531 RDAP: Add "last update of RDAP database" event
The ICANN operational profile says:

1.4.12. An entity object within an RDAP response MUST contain an events
member with the following events:
o An event of eventAction type registration.
o An event of eventAction type last changed. The event of eventAction type last changed MUST be omitted if the Contact Object (as defined in RFC5733) has not been updated since it was created.
o An event of eventAction type last update of RDAP database.

It has similar wording for domains and hosts. The registration and last changed events are already being generated. This CL adds a "last update of RDAP database" event for all three object types. It's very redundant, and I have warned ICANN that "last update" doesn't mean what they might expect in the context of an eventually consistent database, but there we are.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130279688
2016-08-15 17:01:29 -04:00
shikhman
82ab624b36 Add instrumentation implementation
The instrumentation implementation adds the ability to track counters for dimensional data in the codebase. Instrumentation points will be added to different parts of the codebase in upcoming CLs. The ability to export the data to Stackdriver will also be added in an upcoming CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130195199
2016-08-15 16:58:42 -04:00
mcilwain
3efe09616c Allow two-letter domain names
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130139005
2016-08-15 16:57:19 -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
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
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
mountford
0cab13e6d8 RDAP: Remove port43 element from JSON output
According to Gustavo Lozano of ICANN: "In the case of the RDAP profile (gTLD space), the “port43” element is not expected to be used, because Whois/43 tcp will be deprecated in the future." So it sounds like we should not include the port43 element for the moment.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130017966
2016-08-15 16:42:06 -04:00
nickfelt
72894253ae Downgrade undeclared extension log message to INFO
ECatcher seems to trigger on warnings, even if no exception is thrown (?).  This warning doesn't really need to be a warning if it's WAI and not something we're actually going to bother to reach out to registrars about (in this case, 101domain apparently isn't declaring the launch extension, but we let them use it anyway).

If at some point we decide to be stricter about declaring extensions and want to go determine how often this is happening, making it INFO vs WARNING doesn't make that any harder.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130016606
2016-08-15 16:40:35 -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
mcilwain
878f43f0ab Remove invalid compatible_with directive
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129670094
2016-08-08 17:12:26 -04:00
cpovirk
5daa0e52e1 Set compatible_with=appengine on targets depended on by App Engine apps or by the App Engine runtime itself.
This CL has minimal[*] immediate impact on the targets, but it has two consequences moving forward:
- When [] moves to Java 8, compatible_with=appengine targets will remain on Java 7. (If this target is a non-java_* target, you can ignore this bullet.)
- compatible_with=appengine targets can depend only on other compatible_with=appengine targets. (Fortunately, most common libraries will be compatible_with=appengine: []
This CL is one of thousands in a migration on the critical path for Java 8, so please respond promptly, and, if you are the wrong reviewer, please reassign the CL.

[*] It does mean that your target will go back to being compiled to Java 7 bytecode after its recent switch to Java 8 ([]If your target compiles the same files as another non-compatible_with=appengine target, this CL may break one_definition_test targets.

More information:
[]
Tested:
[] build --nobuild

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129660908
2016-08-08 16:35:22 -04:00
mcilwain
8a76171417 Unbreak build by including DNS packages and modules
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129660098
2016-08-08 16:34:00 -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