Add RDAP support for deleted contacts and registrars

This CL adds the functionality for contact and registrar searches. A future CL will handle domains and entities.

Support is also added for filtering results by registrar.

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=170734664
This commit is contained in:
mountford 2017-10-02 12:20:04 -07:00 committed by Ben McIlwain
parent 6740e9270f
commit a5c931a152
13 changed files with 905 additions and 375 deletions

View file

@ -85,7 +85,7 @@ public class RdapEntityAction extends RdapActionBase {
ContactResource contactResource = ofy().load().key(contactKey).now();
// As per Andy Newton on the regext mailing list, contacts by themselves have no role, since
// they are global, and might have different roles for different domains.
if ((contactResource != null) && now.isBefore(contactResource.getDeletionTime())) {
if ((contactResource != null) && shouldBeVisible(contactResource, now)) {
return rdapJsonFormatter.makeRdapJsonForContact(
contactResource,
true,
@ -101,7 +101,7 @@ public class RdapEntityAction extends RdapActionBase {
if (ianaIdentifier != null) {
wasValidKey = true;
Optional<Registrar> registrar = getRegistrarByIanaIdentifier(ianaIdentifier);
if ((registrar.isPresent()) && registrar.get().isLiveAndPubliclyVisible()) {
if (registrar.isPresent() && shouldBeVisible(registrar.get())) {
return rdapJsonFormatter.makeRdapJsonForRegistrar(
registrar.get(), true, rdapLinkBase, rdapWhoisServer, now, OutputDataType.FULL);
}
@ -112,4 +112,3 @@ public class RdapEntityAction extends RdapActionBase {
: new BadRequestException(pathSearchString + " is not a valid entity handle");
}
}