mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
RDAP: Show registrar entity even if contacts are redacted
Even when the request is not permissioned to see contact information, we should show information about the owning registrar. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=187049833
This commit is contained in:
parent
6a994f320f
commit
247339cfd5
6 changed files with 412 additions and 31 deletions
|
@ -522,10 +522,13 @@ public class RdapJsonFormatter {
|
|||
Map<Key<HostResource>, HostResource> loadedHosts =
|
||||
ofy().load().keys(domainResource.getNameservers());
|
||||
// Load the registrant and other contacts and add them to the data.
|
||||
if (displayContacts) {
|
||||
ImmutableList<ImmutableMap<String, Object>> entities;
|
||||
if (!displayContacts) {
|
||||
entities = ImmutableList.of();
|
||||
} else {
|
||||
Map<Key<ContactResource>, ContactResource> loadedContacts =
|
||||
ofy().load().keys(domainResource.getReferencedContacts());
|
||||
ImmutableList<ImmutableMap<String, Object>> entities =
|
||||
entities =
|
||||
Streams.concat(
|
||||
domainResource.getContacts().stream(),
|
||||
Stream.of(
|
||||
|
@ -543,17 +546,17 @@ public class RdapJsonFormatter {
|
|||
outputDataType,
|
||||
authorization))
|
||||
.collect(toImmutableList());
|
||||
entities =
|
||||
addRegistrarEntity(
|
||||
entities,
|
||||
domainResource.getCurrentSponsorClientId(),
|
||||
linkBase,
|
||||
whoisServer,
|
||||
now,
|
||||
outputDataType);
|
||||
if (!entities.isEmpty()) {
|
||||
jsonBuilder.put("entities", entities);
|
||||
}
|
||||
}
|
||||
entities =
|
||||
addRegistrarEntity(
|
||||
entities,
|
||||
domainResource.getCurrentSponsorClientId(),
|
||||
linkBase,
|
||||
whoisServer,
|
||||
now,
|
||||
outputDataType);
|
||||
if (!entities.isEmpty()) {
|
||||
jsonBuilder.put("entities", entities);
|
||||
}
|
||||
// Add the nameservers to the data; the load was kicked off above for efficiency.
|
||||
ImmutableList.Builder<Object> nsBuilder = new ImmutableList.Builder<>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue