mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 06:44:51 +02:00
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:
parent
82ab624b36
commit
19da9a1531
30 changed files with 302 additions and 67 deletions
|
@ -136,7 +136,7 @@ public class RdapDomainSearchAction extends RdapActionBase {
|
|||
}
|
||||
return ImmutableList.of(
|
||||
RdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
domainResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
// Handle queries with a wildcard.
|
||||
} else {
|
||||
Query<DomainResource> query = ofy().load()
|
||||
|
@ -153,7 +153,7 @@ public class RdapDomainSearchAction extends RdapActionBase {
|
|||
if (domainResource.getDeletionTime().isAfter(now)) {
|
||||
builder.add(
|
||||
RdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
domainResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
|
@ -168,7 +168,7 @@ public class RdapDomainSearchAction extends RdapActionBase {
|
|||
// Handle queries without a wildcard; just load the host by foreign key in the usual way.
|
||||
if (!partialStringQuery.getHasWildcard()) {
|
||||
Ref<HostResource> hostRef = loadAndGetReference(
|
||||
HostResource.class, partialStringQuery.getInitialString(), clock.nowUtc());
|
||||
HostResource.class, partialStringQuery.getInitialString(), now);
|
||||
if (hostRef == null) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ public class RdapDomainSearchAction extends RdapActionBase {
|
|||
// looking for matches.
|
||||
} else {
|
||||
DomainResource domainResource = loadByUniqueId(
|
||||
DomainResource.class, partialStringQuery.getSuffix(), clock.nowUtc());
|
||||
DomainResource.class, partialStringQuery.getSuffix(), now);
|
||||
if (domainResource == null) {
|
||||
throw new NotFoundException("No domain found for specified nameserver suffix");
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ public class RdapDomainSearchAction extends RdapActionBase {
|
|||
// We can't just check that the host name starts with the initial query string, because then
|
||||
// the query ns.exam*.example.com would match against nameserver ns.example.com.
|
||||
if (partialStringQuery.matches(fqhn)) {
|
||||
Ref<HostResource> hostRef = loadAndGetReference(HostResource.class, fqhn, clock.nowUtc());
|
||||
Ref<HostResource> hostRef = loadAndGetReference(HostResource.class, fqhn, now);
|
||||
if (hostRef != null) {
|
||||
builder.add(hostRef);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ public class RdapDomainSearchAction extends RdapActionBase {
|
|||
for (DomainResource domainResource : query) {
|
||||
builder.add(
|
||||
RdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
domainResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue