Commit graph

302 commits

Author SHA1 Message Date
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
Greg Shikhman
751df4b488 Re-indent module list in BackendComponent
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129453164
2016-08-05 20:40:54 -04:00
Justine Tunney
3f4121b98c Clean up some genrule() script code
The XJC genrule in particular was dirtying /tmp which I believe may have
been causing problems for Donuts.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129451600
2016-08-05 20:40:39 -04:00
Justine Tunney
e1d02d1ea5 Make ConfigUtils public
So users can reference it from other places.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129450838
2016-08-05 20:40:23 -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
Greg Shikhman
0e4244a03d Add DnsWriter for Cloud DNS
The plumbing to support different DnsWriter implementations per TLD
using DI will come in a later CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129375856
2016-08-05 20:36:52 -04:00
Justine Tunney
51bdb26e7d Make App Engine API JAR show up in WAR
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129356083
2016-08-04 15:03:38 -04:00
mountford
eb792e89ef RDAP: Document RDAP guidance
Updates the RDAP code to reflect guidance and confirmation received from various mailing lists.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129254894
2016-08-03 17:15:02 -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
Justine Tunney
7cc7dc4af2 Use zip_rule() for EAR/WAR deploy archives
These build rules allow Bazel to generate the .ear and .war files which
appcfg.sh (a tool that comes with the App Engine SDK) can then use to
perform a deployment.

Included in this CL are configurations for five separate production
environments: production, sandbox, alpha, crash, and local.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129163010
2016-08-02 21:00:39 -04:00
Justine Tunney
e2471b837a Unstrip LrpToken from EntityClasses
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129142160
2016-08-02 19:23:01 -04:00
Chris Tingue
d2ca1ff691 Add set of valid TLDs to LrpToken
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129141577
2016-08-02 19:22:54 -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
Wolfgang Meyers
d3d33ccfdc Add escrow file import validation logic
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129116064
2016-08-02 19:22:30 -04:00
Justine Tunney
f9636b6cea Modify zip_file() to output script file
It turns out that if the script gets super huge, then Bazel will fail in
a mysterious way if you pass the script as a string to ctx.action.

This way of doing things is better anyway, because this makes it much
easier for the user to see the script that was actually generated for
troubleshooting purposes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129114272
2016-08-02 19:18:18 -04:00
Justine Tunney
37d30591ed Narrowly scope privileges for API service objects
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129099520
2016-08-02 19:18:09 -04:00
Justine Tunney
9de287378b Create zip_file() rule
This doesn't work quite the same way as Fileset(). But it should be able
to serve as a decent replacement.

The important part of this design is that zips can depend on other zips.
Therefore definitions don't have to be monolithic. This will be
important when migrating the Domain Registry codebase, because our
Fileset() definitions are dispersed across many BUILD files. So we'll be
able to migrate to zip_file() with the least amount of intrusiveness.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129034885
2016-08-02 19:17:55 -04:00
Chris Tingue
b2d5108c0c Prefer Money.zero over Money.of(currency, 0)
In the case where currency has a zero scale (i.e. JPY),
Money.of(currency, 0) throws ArithmeticException because the second
argument is handled as a double, and JPY (for example) does not allow
decimal precision, even if the decimal is zero.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129023540
2016-08-02 19:17:29 -04:00
Justine Tunney
3f471a32e2 System property loader for RegistryConfig
This change allows registries to customize the values returned by
RegistryConfig methods without needing to edit Domain Registry code in a
forked repository. This is accomplished by defining a custom
RegistryConfig implementation and specifying its name as a system
property in appengine-web.xml.

This change also open-sources the production configuration values that
Google has chosen to use for these methods. TestRegistryConfig was
hitherto used for production configuration in the open source world,
which is misleading and inappropriate, considering it tunes values such
as the number of commit log buckets to 1.

Another important benefit of this change is that it helps registry_tool
work out of the box in the open source world.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129022675
2016-08-02 19:17:19 -04:00
Justine Tunney
e3bb5dc9b0 Fix up license headers and Python linting
This will help [] be submitted without breaking the linter.
License headers are now added automatically where they were previously
added by hand. We're also now adding the license header to Soy and SQL
files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129017424
2016-08-02 19:16:42 -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
Justine Tunney
e1dc6d5adb Upgrade Closure Rules to v0.2.5
This CL fixes an issue preventing App Engine deploys in the open source
world, because an old version of Soy had its Maven jars compiled for Java
1.8. Upgrading to the latest Closure Rules release fixes this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128841077
2016-08-02 19:14:13 -04:00
Lai Jiang
31dbe4c1f1 Do not leave orphan glues for DnsUpdateWriter
This CL implements similar logic to deal with orphan glues as [] did
for ZonemanWriter. We are enforcing the policy that a glue record
should be deleted when authoritative NS record referring to it is
removed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128838082
2016-08-02 19:13:37 -04:00
Jakub Vrana
3de56496b1 Convert createDom string tag to goog.dom.TagName
goog.dom.createDom is about to support only the members of
goog.dom.TagName to improve the precision of its return type. This CL
prepares for that.

CL automatically created by:
     replace_string --pcre
(\.createDom\(\s*)\'([a-z0-9]+)'
$1goog.dom.TagName.$2

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128802686
2016-08-02 19:12:16 -04:00
Greg Shikhman
1ba739a6b6 Refactor DnsWriter into the model package
This is one of several CLs in order to support per-TLD DnsWriter
implementations, modeled on the work done for PremiumPricingEngine.

Since DnsWriters will be set inside the Registry object, the DnsWriter
interface definition needs to be moved to models to create minimal
dependency on the rest of the registry codebase to avoid cyclic
dependency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128711643
2016-08-02 19:10:49 -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
Greg Shikhman
6b5c00e143 Fix javadoc link to refer to correct annotation name
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128364461
2016-08-02 19:08:35 -04:00