Commit graph

477 commits

Author SHA1 Message Date
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
Lai Jiang
c3e8ff7b21 Prevent orphan glue records from being published
When a domain refreshes, always delete all of its subordinate host
records and then add glue records for its in-bailiwick nameservers, if
the domain is in a publishable status. When a host refreshes, delete
its glue record (if any) and then refresh its superordinate domain. The
goal is to prevent A/AAAA records for hosts that are not used as
in-bailiwick nameservers from being published in the DNS.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128354008
2016-08-02 19:07:18 -04:00
Ben McIlwain
64a7aeda30 Tag Registrar.loadByClientId() with @Nullable
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128180138
2016-08-02 19:04:48 -04:00
Brian Mountford
64bcad3f21 Add XML support for new Flags EPP extension
For the .app discounting logic, we need a new extension which will let
registrars set, clear and query custom flags on a domain. Hopefully
this will be reusable for other custom TLDs later. This CL adds the
XSD, the associated classes for marshalling and unmarshalling, and some
marshalling tests, and links the classes into the system-wide extension
lists.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128178999
2016-08-02 19:03:26 -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
2c9567e183 Remove old DNS queue processing code.
The old DNS processing was performed by WriteDnsAction, which was invoked by the standard cron fanout action. The new code, which has been running for several months in production, uses ReadDnsQueueAction to do a custom fanout to PublishDnsUpdatesAction. We no longer need the old code, so it's time to remove it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127983115
2016-07-21 14:55:18 -04:00
Brian Mountford
b83b3b313f Support version 0.12 of the EPP Fee Extension
The corresponding version of the specification is 8.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127968603
2016-07-21 14:55:08 -04:00
Ben McIlwain
38e7b07c93 Remove the "mail" task queue
I can't find any remaining uses of it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127942602
2016-07-21 14:54:57 -04:00
Greg Shikhman
5522135f5a Change value type class to @AutoValue to fix errorprone warning
AutoValue classes by default do not allow null parameters, so I've removed the unnecessary null checks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127870611
2016-07-21 14:54:42 -04:00
Ben McIlwain
a879afa075 Delete the "export" task queue
Near as I can tell, it's no longer used by anything.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127863557
2016-07-21 14:54:12 -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
Wolfgang Meyers
ac6b147bf5 Add ContactResource import utility logic
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127765049
2016-07-19 10:48:47 -04:00
mountford
41817985ff RDAP: Implement new status codes
The RDAP community is adding new values to the list of valid status codes, so that all EPP status codes can map to corresponding RDAP ones. The RDAP code has been updated accordingly.

For more information, see https://tools.ietf.org/html/draft-ietf-regext-epp-rdap-status-mapping-01.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127718882
2016-07-19 10:45:06 -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
71ab4a648b Handle nullness properly in some message/flow/poll code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127543268
2016-07-15 14:58:57 -04:00
nickfelt
eed319990a Add top-level python directory to opensource repo
This adds a home in our opensource repo for python libraries and binaries,
under a top-level "python" directory.  Future CLs will relocate ICANN
reporting bits and pieces to new homes under this directory, and will use
the MOE configuration and python_directory_import rule defined here.

This approach is roughly modeled on the protobuf Bazel opensource project,
which also uses a top-level directory for various languages, and also uses
the "imports" parameter to exclude that directory in python module names:
  https://github.com/google/protobuf/blob/v3.0.0-beta-3/BUILD#L568
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127459882
2016-07-15 14:56:22 -04:00
Ben McIlwain
4ccc016e5c Disallow empty nameservers for domains in TLDs with whitelist
If a TLD has a whitelist on nameservers, domains in such TLD must have
at least one nameserver. Therefore creating domains with empty nameserver
is forbidden, as well as deleting the last nameserver on a domain. We
enforce this policy by checking the number of nameservers for the new resource
to makesure it is not zero if a whitelist exists.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127318320
2016-07-13 16:01:10 -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
jart
7b9752c99d Forward declare namespaces only in JSDoc
Forward declares symbol. This is an indication to the compiler that the
symbol may be used in the source yet is not required and may not be
provided in compilation.

The most common usage of forward declaration is code that takes a type
as a function parameter but does not need to require it. By forward
declaring instead of requiring, no hard dependency is made, and (if not
required elsewhere) the namespace may never be required and thus, not be
pulled into the JavaScript binary. If it is required elsewhere, it will
be type checked as normal.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127095620
2016-07-13 15:57:11 -04:00
mcilwain
0e511f0178 Remove regtype extension since we won't be using it
If we do end up needing it we can simply revert this commit.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127094676
2016-07-13 15:55:48 -04:00
mcilwain
cd23ece924 Rename TldSpecificLogicEngine to TldSpecificLogicProxy
This new name is a more accurate description of what the actual class
does.  TldSpecificLogicEngine is an interface that will be added in
the near future, implementations of which will provide custom per-TLD
logic.  The class being renamed is more properly a proxy that only
handles logic generic to all TLDs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127088913
2016-07-13 15:54:24 -04:00
ctingue
b74ab4bc27 Drop RegistryCursor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126937242
2016-07-13 15:53:00 -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