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
This commit is contained in:
mountford 2016-08-15 07:40:37 -07:00 committed by Ben McIlwain
parent 82ab624b36
commit 19da9a1531
30 changed files with 302 additions and 67 deletions

View file

@ -25,6 +25,7 @@ import google.registry.request.HttpException;
import google.registry.request.HttpException.NotFoundException;
import google.registry.util.Clock;
import javax.inject.Inject;
import org.joda.time.DateTime;
/**
* RDAP (new WHOIS) action for domain requests.
@ -50,15 +51,16 @@ public class RdapDomainAction extends RdapActionBase {
@Override
public ImmutableMap<String, Object> getJsonObjectForResource(
String pathSearchString, boolean isHeadRequest, String linkBase) throws HttpException {
DateTime now = clock.nowUtc();
pathSearchString = canonicalizeName(pathSearchString);
validateDomainName(pathSearchString);
// The query string is not used; the RDAP syntax is /rdap/domain/mydomain.com.
DomainResource domainResource =
loadByUniqueId(DomainResource.class, pathSearchString, clock.nowUtc());
loadByUniqueId(DomainResource.class, pathSearchString, now);
if (domainResource == null) {
throw new NotFoundException(pathSearchString + " not found");
}
return RdapJsonFormatter.makeRdapJsonForDomain(
domainResource, true, rdapLinkBase, rdapWhoisServer);
domainResource, true, rdapLinkBase, rdapWhoisServer, now);
}
}