mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Reimplement the RDAP Json creation using Jsonables
Currently we try to reimplemnet the same behavior of the existing code as much as possible. We only fix issues that go against the RFC7483, but we don't yet update the code to follow the latest (15feb19) RDAP Response Profile. That will require a much bigger change especially for the test files, so it'll wait for a followup CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=246948018
This commit is contained in:
parent
e382299212
commit
bdc41edd34
85 changed files with 2589 additions and 2367 deletions
|
@ -19,7 +19,6 @@ import static google.registry.rdap.RdapUtils.getRegistrarByIanaIdentifier;
|
|||
import static google.registry.request.Action.Method.GET;
|
||||
import static google.registry.request.Action.Method.HEAD;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.primitives.Longs;
|
||||
import com.google.re2j.Pattern;
|
||||
import com.googlecode.objectify.Key;
|
||||
|
@ -27,6 +26,7 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.rdap.RdapJsonFormatter.OutputDataType;
|
||||
import google.registry.rdap.RdapMetrics.EndpointType;
|
||||
import google.registry.rdap.RdapObjectClasses.RdapEntity;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotFoundException;
|
||||
|
@ -60,7 +60,7 @@ public class RdapEntityAction extends RdapActionBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ImmutableMap<String, Object> getJsonObjectForResource(
|
||||
public RdapEntity getJsonObjectForResource(
|
||||
String pathSearchString, boolean isHeadRequest) {
|
||||
DateTime now = clock.nowUtc();
|
||||
// The query string is not used; the RDAP syntax is /rdap/entity/handle (the handle is the roid
|
||||
|
@ -76,9 +76,7 @@ public class RdapEntityAction extends RdapActionBase {
|
|||
if ((contactResource != null) && shouldBeVisible(contactResource, now)) {
|
||||
return rdapJsonFormatter.makeRdapJsonForContact(
|
||||
contactResource,
|
||||
true,
|
||||
Optional.empty(),
|
||||
fullServletPath,
|
||||
rdapWhoisServer,
|
||||
now,
|
||||
OutputDataType.FULL,
|
||||
|
@ -91,7 +89,7 @@ public class RdapEntityAction extends RdapActionBase {
|
|||
Optional<Registrar> registrar = getRegistrarByIanaIdentifier(ianaIdentifier);
|
||||
if (registrar.isPresent() && shouldBeVisible(registrar.get())) {
|
||||
return rdapJsonFormatter.makeRdapJsonForRegistrar(
|
||||
registrar.get(), true, fullServletPath, rdapWhoisServer, now, OutputDataType.FULL);
|
||||
registrar.get(), rdapWhoisServer, now, OutputDataType.FULL);
|
||||
}
|
||||
}
|
||||
// At this point, we have failed to find either a contact or a registrar.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue