mirror of
https://github.com/google/nomulus
synced 2026-08-20 22:26:12 +00:00
Add RDAP warning when domain searches by nameserver may be incomplete
When searching for domains by nameserver name or IP address, we fetch the matching nameserver keys, then search for domains by those keys. We limit the number of nameserver keys returned, to avoid arbitrarily large domain queries. This CL adds a warning to the RDAP response if we retrieved the maximum number of nameservers. This may indicate that we have not found all the domains. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168885124
This commit is contained in:
@@ -16,7 +16,6 @@ package google.registry.rdap;
|
||||
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.rdap.RdapIcannStandardInformation.TRUNCATION_NOTICES;
|
||||
import static google.registry.request.Action.Method.GET;
|
||||
import static google.registry.request.Action.Method.HEAD;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
@@ -32,6 +31,7 @@ import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.rdap.RdapJsonFormatter.BoilerplateType;
|
||||
import google.registry.rdap.RdapJsonFormatter.OutputDataType;
|
||||
import google.registry.rdap.RdapSearchResults.IncompletenessWarningType;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotFoundException;
|
||||
@@ -119,8 +119,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
||||
rdapJsonFormatter.addTopLevelEntries(
|
||||
jsonBuilder,
|
||||
BoilerplateType.NAMESERVER,
|
||||
results.isTruncated()
|
||||
? TRUNCATION_NOTICES : ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
results.getIncompletenessWarnings(),
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
rdapLinkBase);
|
||||
return jsonBuilder.build();
|
||||
@@ -215,6 +214,10 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
||||
host, false, rdapLinkBase, rdapWhoisServer, now, outputDataType));
|
||||
}
|
||||
ImmutableList<ImmutableMap<String, Object>> jsonList = jsonListBuilder.build();
|
||||
return RdapSearchResults.create(jsonList, jsonList.size() < hosts.size());
|
||||
return RdapSearchResults.create(
|
||||
jsonList,
|
||||
(jsonList.size() < hosts.size())
|
||||
? IncompletenessWarningType.TRUNCATED
|
||||
: IncompletenessWarningType.NONE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user