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
|
@ -96,7 +96,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
results = searchByName(RdapSearchPattern.create(Idn.toASCII(nameParam.get()), true), now);
|
||||
} else {
|
||||
// syntax: /rdap/nameservers?ip=1.2.3.4
|
||||
results = searchByIp(ipParam.get());
|
||||
results = searchByIp(ipParam.get(), now);
|
||||
}
|
||||
if (results.isEmpty()) {
|
||||
throw new NotFoundException("No nameservers found");
|
||||
|
@ -120,7 +120,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
}
|
||||
return ImmutableList.of(
|
||||
RdapJsonFormatter.makeRdapJsonForHost(
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
// Handle queries with a wildcard, but no suffix. There are no pending deletes for hosts, so we
|
||||
// can call queryUndeleted.
|
||||
} else if (partialStringQuery.getSuffix() == null) {
|
||||
|
@ -132,7 +132,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
for (HostResource hostResource : query) {
|
||||
builder.add(
|
||||
RdapJsonFormatter.makeRdapJsonForHost(
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
}
|
||||
return builder.build();
|
||||
// Handle queries with a wildcard and a suffix. In this case, it is more efficient to do things
|
||||
|
@ -140,7 +140,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
// looking for matches.
|
||||
} else {
|
||||
DomainResource domainResource =
|
||||
loadByUniqueId(DomainResource.class, partialStringQuery.getSuffix(), clock.nowUtc());
|
||||
loadByUniqueId(DomainResource.class, partialStringQuery.getSuffix(), now);
|
||||
if (domainResource == null) {
|
||||
throw new NotFoundException("No domain found for specified nameserver suffix");
|
||||
}
|
||||
|
@ -149,11 +149,11 @@ public class RdapNameserverSearchAction 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)) {
|
||||
HostResource hostResource = loadByUniqueId(HostResource.class, fqhn, clock.nowUtc());
|
||||
HostResource hostResource = loadByUniqueId(HostResource.class, fqhn, now);
|
||||
if (hostResource != null) {
|
||||
builder.add(
|
||||
RdapJsonFormatter.makeRdapJsonForHost(
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
|
||||
/** Searches for nameservers by IP address, returning a JSON array of nameserver info maps. */
|
||||
private ImmutableList<ImmutableMap<String, Object>>
|
||||
searchByIp(final InetAddress inetAddress) throws HttpException {
|
||||
searchByIp(final InetAddress inetAddress, DateTime now) throws HttpException {
|
||||
// In theory, we could filter on deletion time being in the future. But we can't do that in the
|
||||
// name query above (because we already have an inequality filter), and filtering on deletion
|
||||
// time differently in the two cases seems like a recipe for future confusion.
|
||||
|
@ -177,7 +177,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
for (HostResource hostResource : query) {
|
||||
builder.add(
|
||||
RdapJsonFormatter.makeRdapJsonForHost(
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer));
|
||||
hostResource, false, rdapLinkBase, rdapWhoisServer, now));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue