mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
RDAP: Include remarks only in object classes
The APNIC conformance checker points out that, according to RFC 7483, RDAP remarks should be included only as part of object classes such as domains, nameservers and entities, not in help responses and so on. Note that something is amiss here -- If RFC 7483 is read strictly, the remarks boilerplate for domain, nameserver and entity search results should appear not at the top level, as we currently do, but as part of each constituent object. However, the conformance checker does not seem to complain about that. So I have added this to the RDAP questions list, and am leaving the boilerplate at the top level for now. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117557594
This commit is contained in:
parent
c8d655e416
commit
c25cfa626b
8 changed files with 26 additions and 41 deletions
|
@ -99,7 +99,7 @@ public class RdapEntitySearchAction extends RdapActionBase {
|
|||
}
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("entitySearchResults", results);
|
||||
RdapJsonFormatter.addTopLevelEntries(builder, BoilerplateType.OTHER, null, rdapLinkBase);
|
||||
RdapJsonFormatter.addTopLevelEntries(builder, BoilerplateType.ENTITY, null, rdapLinkBase);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RdapIcannStandardInformation {
|
|||
ImmutableList.of(
|
||||
CONFORMANCE_REMARK, DOMAIN_STATUS_CODES_REMARK, INACCURACY_COMPLAINT_FORM_REMARK);
|
||||
|
||||
/** Boilerplate remarks required by non-domain responses. */
|
||||
static final ImmutableList<ImmutableMap<String, Object>> nonDomainBoilerplateRemarks =
|
||||
/** Boilerplate remarks required by nameserver and entity responses. */
|
||||
static final ImmutableList<ImmutableMap<String, Object>> nameserverAndEntityBoilerplateRemarks =
|
||||
ImmutableList.of(CONFORMANCE_REMARK);
|
||||
}
|
||||
|
|
|
@ -77,12 +77,16 @@ import javax.annotation.Nullable;
|
|||
public class RdapJsonFormatter {
|
||||
|
||||
/**
|
||||
* What type of boilerplate notices are required for the RDAP JSON messages? The ICANN RDAP
|
||||
* Profile specifies that, for instance, domain name responses should include a remark about
|
||||
* domain status codes. So we need to know when to include such boilerplate.
|
||||
* Indication of what type of boilerplate notices are required for the RDAP JSON messages. The
|
||||
* ICANN RDAP Profile specifies that, for instance, domain name responses should include a remark
|
||||
* about domain status codes. So we need to know when to include such boilerplate. On the other
|
||||
* hand, remarks are not allowed except in domain, nameserver and entity objects, so we need to
|
||||
* suppress them for other types of responses (e.g. help).
|
||||
*/
|
||||
public enum BoilerplateType {
|
||||
DOMAIN,
|
||||
NAMESERVER,
|
||||
ENTITY,
|
||||
OTHER
|
||||
}
|
||||
|
||||
|
@ -279,9 +283,17 @@ public class RdapJsonFormatter {
|
|||
noticesBuilder.add(tosNotice);
|
||||
}
|
||||
builder.put(NOTICES, noticesBuilder.build());
|
||||
builder.put(REMARKS, (boilerplateType == BoilerplateType.DOMAIN)
|
||||
? RdapIcannStandardInformation.domainBoilerplateRemarks
|
||||
: RdapIcannStandardInformation.nonDomainBoilerplateRemarks);
|
||||
switch (boilerplateType) {
|
||||
case DOMAIN:
|
||||
builder.put(REMARKS, RdapIcannStandardInformation.domainBoilerplateRemarks);
|
||||
break;
|
||||
case NAMESERVER:
|
||||
case ENTITY:
|
||||
builder.put(REMARKS, RdapIcannStandardInformation.nameserverAndEntityBoilerplateRemarks);
|
||||
break;
|
||||
default: // things other than domains, nameservers and entities cannot contain remarks
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** AutoValue class to build parameters to {@link #makeRdapJsonNotice}. */
|
||||
|
@ -507,7 +519,7 @@ public class RdapJsonFormatter {
|
|||
builder.put("port43", whoisServer);
|
||||
}
|
||||
if (isTopLevel) {
|
||||
addTopLevelEntries(builder, BoilerplateType.OTHER, null, linkBase);
|
||||
addTopLevelEntries(builder, BoilerplateType.NAMESERVER, null, linkBase);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
@ -576,7 +588,7 @@ public class RdapJsonFormatter {
|
|||
builder.put("port43", whoisServer);
|
||||
}
|
||||
if (isTopLevel) {
|
||||
addTopLevelEntries(builder, BoilerplateType.OTHER, null, linkBase);
|
||||
addTopLevelEntries(builder, BoilerplateType.ENTITY, null, linkBase);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
@ -656,7 +668,7 @@ public class RdapJsonFormatter {
|
|||
builder.put("port43", whoisServer);
|
||||
}
|
||||
if (isTopLevel) {
|
||||
addTopLevelEntries(builder, BoilerplateType.OTHER, null, linkBase);
|
||||
addTopLevelEntries(builder, BoilerplateType.ENTITY, null, linkBase);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ public class RdapNameserverSearchAction extends RdapActionBase {
|
|||
}
|
||||
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
|
||||
builder.put("nameserverSearchResults", results);
|
||||
RdapJsonFormatter.addTopLevelEntries(builder, BoilerplateType.OTHER, null, rdapLinkBase);
|
||||
RdapJsonFormatter.addTopLevelEntries(builder, BoilerplateType.NAMESERVER, null, rdapLinkBase);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue