Add RDAP support for deleted nameservers and filtering by registrar

This CL adds the functionality for nameserver searches. Future CLs will handle domains and entities.

Deleted items can only be seen by admins, and by registrars viewing their own deleted items.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170106014
This commit is contained in:
mountford 2017-09-26 14:07:42 -07:00 committed by Ben McIlwain
parent 0c8b5bc8bf
commit c13c2f403a
11 changed files with 870 additions and 153 deletions

View file

@ -29,7 +29,6 @@ import com.google.common.collect.Iterables;
import com.google.common.primitives.Booleans;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.cmd.Query;
import google.registry.config.RegistryConfig.Config;
import google.registry.model.EppResourceUtils;
import google.registry.model.domain.DomainResource;
import google.registry.model.host.HostResource;
@ -81,7 +80,6 @@ public class RdapDomainSearchAction extends RdapActionBase {
@Inject @Parameter("name") Optional<String> nameParam;
@Inject @Parameter("nsLdhName") Optional<String> nsLdhNameParam;
@Inject @Parameter("nsIp") Optional<InetAddress> nsIpParam;
@Inject @Config("rdapResultSetMaxSize") int rdapResultSetMaxSize;
@Inject RdapDomainSearchAction() {}
@Override
@ -300,10 +298,11 @@ public class RdapDomainSearchAction extends RdapActionBase {
// Only return the first 1000 nameservers. This could result in an incomplete result set if
// a search asks for something like "ns*", but we need to enforce a limit in order to avoid
// arbitrarily long-running queries.
return queryUndeleted(
return queryItems(
HostResource.class,
"fullyQualifiedHostName",
partialStringQuery,
false, /* includeDeleted */
MAX_NAMESERVERS_IN_FIRST_STAGE)
.keys();
}