Commit graph

61 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c70d167a99 Remove getOnlyElement()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124846747
2016-06-14 16:31:15 -04:00
Chris Tingue
2a83d122ef Add MR to expand billing events into OneTimes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124837292
2016-06-14 16:31:00 -04:00
Corey Goldfeder
7cf4ddce97 Rename Response in the epp model to EppResponse
So that it doesn't conflict with request.Response.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124595393
2016-06-14 16:30:26 -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
5a2f63cf58 Make Hello flows use the flow "now" time
This cleans up some of the tests, and helps with
future injection CLs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124208164
2016-06-14 16:29:02 -04:00
mmuller
b9ae0a2550 Add EAP fee schedule to the Registry object
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123894969
2016-06-06 13:31:16 -04:00
cgoldfeder
89066a7215 Make the new datastore testing proxy actually store the requests
This will improve error messages and allow for easier debugging
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123893831
2016-06-06 13:31:16 -04:00
cgoldfeder
aa10792f73 Test that marshaling a domain only does one datastore fetch.
This is true even though the domain has three fields (a contact,
a host, and the registrant) whose foreign keys need to be loaded.

This CL also adds the generic ability to do these sort of tests
elsewhere in the code, by instrumenting the datastore instance
used by Objectify to store static counts of method calls.

TESTED=patched in a rollback of [] and confirmed that the
test failed because there were three reads.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123885768
2016-06-06 13:31:16 -04:00
cgoldfeder
23b66b0bb4 Load foreign keys more efficiently for xml marshalling.
Before this CL, each contact and host was independently
loaded via the ReferenceUnion adapter. Since fields are
processed serially by JAXB, this means worst-case there
were 17 loads, best case 3 (the 3 required contacts) and
usual case 5-6 (some hosts). This CL reduces that to 1
datastore roundtrip in all cases.

A side effect of this CL is the further hollowing-out of
ReferenceUnion, since it no longer is involved in
marshalling at all.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123712842
2016-06-06 13:30:53 -04:00
mmuller
8eab3848c1 Fix broken code reference to PricingUtils
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123673913
2016-06-06 12:17:33 -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
6355ef5922 Add registration type response extension to info commands
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123323993
2016-05-27 12:58:53 -04:00
mcilwain
041b2c4116 Add domain check and update registration type extensions
This completes the command extensions for the regType 0.2 extension.
Up next will be the response extensions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123322887
2016-05-27 12:57:31 -04:00
ctingue
510da196d7 Follow-up changes to TimeOfYear from []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123316677
2016-05-27 12:56:09 -04:00
mcilwain
a09f478ac0 Add simple registration type command extension for domain creates
Note that it doesn't do anything yet beyond basic XML validation
because the default registry system doesn't use registration types,
but this serves as a template for the other domain commands using
registration types and provides a method that TLDs implementing custom
logic can use.  This also explicitly doesn't yet handle the response
extensions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123245388
2016-05-27 12:50:46 -04:00
ctingue
3abb29adf8 Rename BillingEvent.OneTime.cancellationTargetId
Per comments in []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123000109
2016-05-27 12:45:19 -04:00
ctingue
91cf36c5b9 Change TimeOfDay getInstancesInRange to use Range
This will make the utility a lot more versatile (allow both open and closed intervals) and hand the range validation and comparison off to the Range class.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122867110
2016-05-27 12:43:56 -04:00
mcilwain
a2d2764115 Change second-level domain name to fully-qualified domain name
Second-level domain name isn't accurate because we support multi-part
TLDs, so standardize on the "fullyQualifiedDomainName" name that is
used throughout the code base.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122693009
2016-05-27 12:42:33 -04:00
Corey Goldfeder
cc11653446 Comment typo of the day
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122632247
2016-05-18 13:10:47 -04:00
Corey Goldfeder
d2a66e9d1f Registrant of a domain can never be null
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122630609
2016-05-18 13:10:18 -04:00
Justine Tunney
6f4b059cc9 Make javadoc <p> style guide compliant
This led to confusion for an open source contributor about how to format
code. We don't want to be like, "do as I say, not as I do."

https://google.github.io/styleguide/javaguide.html#s7.1.2-javadoc-paragraphs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122589700
2016-05-18 13:09:01 -04:00
cgoldfeder
618050dc32 Load referenced contact/hosts from EPP more efficiently
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122459862
2016-05-16 20:11:58 -04:00
Corey Goldfeder
d9875ea302 Remove unused and misused methods from EppResourceUtils and DomainBase.
The methods in DomainBase were the only callers for the methods in
EppResourceUtils, so I first inlined them. Then I realized that there
were no callers for loadReferencedContacts() anywhere. For loadNameservers(),
all but one invocation actually wanted to load the foreign keys, and was
repeating that work, so I replaced it with loadNameserverFullyQualifiedHostNames().
The last invocation, in the Rdap code, was incorrectly assuming this was an async
load when in fact it blocks, so I replaced it with a real async load.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122433897
2016-05-16 18:39:23 -04:00
cgoldfeder
9a2afc7a9b Remove nearly all uses of ReferenceUnion
ReferenceUnion is a hack to work around the mismatch between how
we store references (by roid) and how they are represented in EPP
(by foreign key). If it ever needed to exist (not entirely clear...)
it should have remained tightly scoped within the domain commands
and resources. Instead it has leaked everywhere in the project,
causing lots of boilerplate. This CL hides all of that behind
standard Refs, and should be followed by work to remove ReferenceUnion
completely.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122424416
2016-05-16 16:36:25 -04:00
Justine Tunney
1a0c282cf8 Bring open source build closer to passing 2016-05-14 01:29:22 -04:00
ctingue
a8544100fa Adding synthetic source ID to BillingEvent.OneTime
Synthetic BillingEvent.OneTimes need to have a pointer to their source Recurring event, in order to match up properly against Cancellations.

Also improving the exception message for mismatched Flag.SYNTHETIC and syntheticCreationTime.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122155636
2016-05-13 23:20:45 -04:00