mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00:00
Rename visibleInWhois fields to visibleInRdap (#2863)
Still part of b/454947209, removing references to WHOIS where we can. We keep the registrar type and the column names (at least for now) because changing those is much more complicated.
This commit is contained in:
@@ -47,9 +47,9 @@ export interface Contact {
|
|||||||
registrarId?: string;
|
registrarId?: string;
|
||||||
faxNumber?: string;
|
faxNumber?: string;
|
||||||
types: Array<contactType>;
|
types: Array<contactType>;
|
||||||
visibleInWhoisAsAdmin?: boolean;
|
visibleInRdapAsAdmin?: boolean;
|
||||||
visibleInWhoisAsTech?: boolean;
|
visibleInRdapAsTech?: boolean;
|
||||||
visibleInDomainWhoisAsAbuse?: boolean;
|
visibleInDomainRdapAsAbuse?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ViewReadyContact extends Contact {
|
export interface ViewReadyContact extends Contact {
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
<h1>RDAP Preferences</h1>
|
<h1>RDAP Preferences</h1>
|
||||||
<div>
|
<div>
|
||||||
<mat-checkbox
|
<mat-checkbox
|
||||||
[(ngModel)]="contactService.contactInEdit.visibleInWhoisAsAdmin"
|
[(ngModel)]="contactService.contactInEdit.visibleInRdapAsAdmin"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
>Show in Registrar RDAP record as admin contact</mat-checkbox
|
>Show in Registrar RDAP record as admin contact</mat-checkbox
|
||||||
>
|
>
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<mat-checkbox
|
<mat-checkbox
|
||||||
[(ngModel)]="contactService.contactInEdit.visibleInWhoisAsTech"
|
[(ngModel)]="contactService.contactInEdit.visibleInRdapAsTech"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
>Show in Registrar RDAP record as technical contact</mat-checkbox
|
>Show in Registrar RDAP record as technical contact</mat-checkbox
|
||||||
>
|
>
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<mat-checkbox
|
<mat-checkbox
|
||||||
[(ngModel)]="contactService.contactInEdit.visibleInDomainWhoisAsAbuse"
|
[(ngModel)]="contactService.contactInEdit.visibleInDomainRdapAsAbuse"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
>Show Phone and Email in Domain RDAP Record as registrar abuse contact
|
>Show Phone and Email in Domain RDAP Record as registrar abuse contact
|
||||||
(per CL&D requirements)</mat-checkbox
|
(per CL&D requirements)</mat-checkbox
|
||||||
@@ -189,24 +189,24 @@
|
|||||||
<mat-list-item role="listitem">
|
<mat-list-item role="listitem">
|
||||||
<h2>RDAP Preferences</h2>
|
<h2>RDAP Preferences</h2>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
@if(contactService.contactInEdit.visibleInWhoisAsAdmin) {
|
@if(contactService.contactInEdit.visibleInRdapAsAdmin) {
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<mat-list-item role="listitem">
|
<mat-list-item role="listitem">
|
||||||
<span class="console-app__list-value"
|
<span class="console-app__list-value"
|
||||||
>Show in Registrar RDAP record as admin contact</span
|
>Show in Registrar RDAP record as admin contact</span
|
||||||
>
|
>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
} @if(contactService.contactInEdit.visibleInWhoisAsTech) {
|
} @if(contactService.contactInEdit.visibleInRdapAsTech) {
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<mat-list-item
|
<mat-list-item
|
||||||
role="listitem"
|
role="listitem"
|
||||||
*ngIf="contactService.contactInEdit.visibleInWhoisAsTech"
|
*ngIf="contactService.contactInEdit.visibleInRdapAsTech"
|
||||||
>
|
>
|
||||||
<span class="console-app__list-value"
|
<span class="console-app__list-value"
|
||||||
>Show in Registrar RDAP record as technical contact</span
|
>Show in Registrar RDAP record as technical contact</span
|
||||||
>
|
>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
} @if(contactService.contactInEdit.visibleInDomainWhoisAsAbuse) {
|
} @if(contactService.contactInEdit.visibleInDomainRdapAsAbuse) {
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<mat-list-item role="listitem">
|
<mat-list-item role="listitem">
|
||||||
<span class="console-app__list-value"
|
<span class="console-app__list-value"
|
||||||
|
|||||||
@@ -1556,12 +1556,7 @@ public final class RegistryConfig {
|
|||||||
return CONFIG_SETTINGS.get().gSuite.outgoingEmailDisplayName;
|
return CONFIG_SETTINGS.get().gSuite.outgoingEmailDisplayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Returns default WHOIS server to use when {@code Registrar#getWhoisServer()} is null. */
|
||||||
* Returns default WHOIS server to use when {@code Registrar#getWhoisServer()} is {@code null}.
|
|
||||||
*
|
|
||||||
* @see "google.registry.whois.DomainWhoisResponse"
|
|
||||||
* @see "google.registry.whois.RegistrarWhoisResponse"
|
|
||||||
*/
|
|
||||||
public static String getDefaultRegistrarWhoisServer() {
|
public static String getDefaultRegistrarWhoisServer() {
|
||||||
return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarWhoisServer;
|
return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarWhoisServer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,10 +128,10 @@ class SyncRegistrarsSheet {
|
|||||||
builder.put("billingContacts", convertContacts(contacts, byType(BILLING)));
|
builder.put("billingContacts", convertContacts(contacts, byType(BILLING)));
|
||||||
builder.put(
|
builder.put(
|
||||||
"contactsMarkedAsWhoisAdmin",
|
"contactsMarkedAsWhoisAdmin",
|
||||||
convertContacts(contacts, RegistrarPoc::getVisibleInWhoisAsAdmin));
|
convertContacts(contacts, RegistrarPoc::getVisibleInRdapAsAdmin));
|
||||||
builder.put(
|
builder.put(
|
||||||
"contactsMarkedAsWhoisTech",
|
"contactsMarkedAsWhoisTech",
|
||||||
convertContacts(contacts, RegistrarPoc::getVisibleInWhoisAsTech));
|
convertContacts(contacts, RegistrarPoc::getVisibleInRdapAsTech));
|
||||||
builder.put("emailAddress", convert(registrar.getEmailAddress()));
|
builder.put("emailAddress", convert(registrar.getEmailAddress()));
|
||||||
builder.put("address.street", convert(address.getStreet()));
|
builder.put("address.street", convert(address.getStreet()));
|
||||||
builder.put("address.city", convert(address.getCity()));
|
builder.put("address.city", convert(address.getCity()));
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ public class Registrar extends UpdateAutoTimestampEntity implements Buildable, J
|
|||||||
immutableEnumSet(State.ACTIVE, State.SUSPENDED);
|
immutableEnumSet(State.ACTIVE, State.SUSPENDED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The types for which a {@link Registrar} should be included in WHOIS and RDAP output. We exclude
|
* The types for which a {@link Registrar} should be included in RDAP output. We exclude
|
||||||
* registrars of type TEST. We considered excluding INTERNAL as well, but decided that
|
* registrars of type TEST. We considered excluding INTERNAL as well, but decided that
|
||||||
* troubleshooting would be easier with INTERNAL registrars visible. Before removing other types
|
* troubleshooting would be easier with INTERNAL registrars visible. Before removing other types
|
||||||
* from view, carefully consider the effect on things like prober monitoring and OT&E.
|
* from view, carefully consider the effect on things like prober monitoring and OT&E.
|
||||||
@@ -416,13 +416,13 @@ public class Registrar extends UpdateAutoTimestampEntity implements Buildable, J
|
|||||||
String phonePasscode;
|
String phonePasscode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dirty bit for whether RegistrarContact changes have been made that haven't been synced to
|
* A dirty bit for whether RegistrarPoc changes have been made that haven't been synced to Google
|
||||||
* Google Groups yet. When creating a new instance, contacts require syncing by default.
|
* Groups yet. When creating a new instance, contacts require syncing by default.
|
||||||
*/
|
*/
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
boolean contactsRequireSyncing = true;
|
boolean contactsRequireSyncing = true;
|
||||||
|
|
||||||
/** Whether or not registry lock is allowed for this registrar. */
|
/** Whether registry lock is allowed for this registrar. */
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
@Expose
|
@Expose
|
||||||
boolean registryLockAllowed = false;
|
boolean registryLockAllowed = false;
|
||||||
@@ -612,11 +612,11 @@ public class Registrar extends UpdateAutoTimestampEntity implements Buildable, J
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link RegistrarPoc} that is the WHOIS abuse contact for this registrar, or empty
|
* Returns the {@link RegistrarPoc} that is the RDAP abuse contact for this registrar, or empty if
|
||||||
* if one does not exist.
|
* one does not exist.
|
||||||
*/
|
*/
|
||||||
public Optional<RegistrarPoc> getWhoisAbuseContact() {
|
public Optional<RegistrarPoc> getRdapAbuseContact() {
|
||||||
return getContacts().stream().filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse).findFirst();
|
return getContacts().stream().filter(RegistrarPoc::getVisibleInDomainRdapAsAbuse).findFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImmutableList<RegistrarPoc> getPocs(TransactionManager txnManager) {
|
private ImmutableList<RegistrarPoc> getPocs(TransactionManager txnManager) {
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ import java.util.Set;
|
|||||||
* A contact for a Registrar. Note, equality, hashCode and comparable have been overridden to only
|
* A contact for a Registrar. Note, equality, hashCode and comparable have been overridden to only
|
||||||
* enable key equality.
|
* enable key equality.
|
||||||
*
|
*
|
||||||
* <p>IMPORTANT NOTE: Any time that you change, update, or delete RegistrarContact entities, you
|
* <p>IMPORTANT NOTE: Any time that you change, update, or delete RegistrarPoc entities, you *MUST*
|
||||||
* *MUST* also modify the persisted Registrar entity with {@link Registrar#contactsRequireSyncing}
|
* also modify the persisted Registrar entity with {@link Registrar#contactsRequireSyncing} set to
|
||||||
* set to true.
|
* true.
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@IdClass(RegistrarPoc.RegistrarPocId.class)
|
@IdClass(RegistrarPoc.RegistrarPocId.class)
|
||||||
@@ -58,8 +58,8 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
/**
|
/**
|
||||||
* Registrar contacts types for partner communication tracking.
|
* Registrar contacts types for partner communication tracking.
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> These types only matter to the registry. They are not meant to be used for
|
* <p><b>Note:</b> These types only matter to the registry. They are not meant to be used for RDAP
|
||||||
* WHOIS or RDAP results.
|
* results.
|
||||||
*/
|
*/
|
||||||
public enum Type {
|
public enum Type {
|
||||||
ABUSE("abuse", true),
|
ABUSE("abuse", true),
|
||||||
@@ -115,32 +115,23 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
@Expose
|
@Expose
|
||||||
Set<Type> types;
|
Set<Type> types;
|
||||||
|
|
||||||
/**
|
/** If this contact is publicly visible in RDAP registrar query results as an Admin contact */
|
||||||
* Whether this contact is publicly visible in WHOIS registrar query results as an Admin contact.
|
@Column(nullable = false, name = "visibleInWhoisAsAdmin")
|
||||||
*/
|
|
||||||
@Column(nullable = false)
|
|
||||||
@Expose
|
@Expose
|
||||||
boolean visibleInWhoisAsAdmin = false;
|
boolean visibleInRdapAsAdmin = false;
|
||||||
|
|
||||||
|
/** If this contact is publicly visible in RDAP registrar query results as a Technical contact */
|
||||||
|
@Column(nullable = false, name = "visibleInWhoisAsTech")
|
||||||
|
@Expose
|
||||||
|
boolean visibleInRdapAsTech = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this contact is publicly visible in WHOIS registrar query results as a Technical
|
* If this contact's phone number and email address are publicly visible in RDAP domain query
|
||||||
* contact.
|
|
||||||
*/
|
|
||||||
@Column(nullable = false)
|
|
||||||
@Expose
|
|
||||||
boolean visibleInWhoisAsTech = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether this contact's phone number and email address is publicly visible in WHOIS domain query
|
|
||||||
* results as registrar abuse contact info.
|
* results as registrar abuse contact info.
|
||||||
*/
|
*/
|
||||||
@Column(nullable = false)
|
@Column(nullable = false, name = "visibleInDomainWhoisAsAbuse")
|
||||||
@Expose
|
@Expose
|
||||||
boolean visibleInDomainWhoisAsAbuse = false;
|
boolean visibleInDomainRdapAsAbuse = false;
|
||||||
|
|
||||||
/** Legacy field, around until we can remove the non-null constraint and the column from SQL. */
|
|
||||||
@Column(nullable = false)
|
|
||||||
boolean allowedToSetRegistryLockPassword = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to update the contacts associated with a Registrar. This requires querying for the
|
* Helper to update the contacts associated with a Registrar. This requires querying for the
|
||||||
@@ -188,16 +179,16 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
return nullToEmptyImmutableSortedCopy(types);
|
return nullToEmptyImmutableSortedCopy(types);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getVisibleInWhoisAsAdmin() {
|
public boolean getVisibleInRdapAsAdmin() {
|
||||||
return visibleInWhoisAsAdmin;
|
return visibleInRdapAsAdmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getVisibleInWhoisAsTech() {
|
public boolean getVisibleInRdapAsTech() {
|
||||||
return visibleInWhoisAsTech;
|
return visibleInRdapAsTech;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getVisibleInDomainWhoisAsAbuse() {
|
public boolean getVisibleInDomainRdapAsAbuse() {
|
||||||
return visibleInDomainWhoisAsAbuse;
|
return visibleInDomainRdapAsAbuse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder asBuilder() {
|
public Builder asBuilder() {
|
||||||
@@ -214,8 +205,8 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
* person@example.com
|
* person@example.com
|
||||||
* Tel: +1.2125650666
|
* Tel: +1.2125650666
|
||||||
* Types: [ADMIN, WHOIS]
|
* Types: [ADMIN, WHOIS]
|
||||||
* Visible in WHOIS as Admin contact: Yes
|
* Visible in RDAP as Admin contact: Yes
|
||||||
* Visible in WHOIS as Technical contact: No
|
* Visible in RDAP as Technical contact: No
|
||||||
* Registrar-Console access: Yes
|
* Registrar-Console access: Yes
|
||||||
* Login Email Address: person@registry.example
|
* Login Email Address: person@registry.example
|
||||||
* }</pre>
|
* }</pre>
|
||||||
@@ -232,18 +223,18 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
}
|
}
|
||||||
result.append("Types: ").append(getTypes()).append('\n');
|
result.append("Types: ").append(getTypes()).append('\n');
|
||||||
result
|
result
|
||||||
.append("Visible in registrar WHOIS query as Admin contact: ")
|
.append("Visible in registrar RDAP query as Admin contact: ")
|
||||||
.append(getVisibleInWhoisAsAdmin() ? "Yes" : "No")
|
.append(getVisibleInRdapAsAdmin() ? "Yes" : "No")
|
||||||
.append('\n');
|
.append('\n');
|
||||||
result
|
result
|
||||||
.append("Visible in registrar WHOIS query as Technical contact: ")
|
.append("Visible in registrar RDAP query as Technical contact: ")
|
||||||
.append(getVisibleInWhoisAsTech() ? "Yes" : "No")
|
.append(getVisibleInRdapAsTech() ? "Yes" : "No")
|
||||||
.append('\n');
|
.append('\n');
|
||||||
result
|
result
|
||||||
.append(
|
.append(
|
||||||
"Phone number and email visible in domain WHOIS query as "
|
"Phone number and email visible in domain RDAP query as "
|
||||||
+ "Registrar Abuse contact info: ")
|
+ "Registrar Abuse contact info: ")
|
||||||
.append(getVisibleInDomainWhoisAsAbuse() ? "Yes" : "No")
|
.append(getVisibleInDomainRdapAsAbuse() ? "Yes" : "No")
|
||||||
.append('\n');
|
.append('\n');
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
@@ -256,9 +247,9 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
.put("phoneNumber", phoneNumber)
|
.put("phoneNumber", phoneNumber)
|
||||||
.put("faxNumber", faxNumber)
|
.put("faxNumber", faxNumber)
|
||||||
.put("types", getTypes().stream().map(Object::toString).collect(joining(",")))
|
.put("types", getTypes().stream().map(Object::toString).collect(joining(",")))
|
||||||
.put("visibleInWhoisAsAdmin", visibleInWhoisAsAdmin)
|
.put("visibleInRdapAsAdmin", visibleInRdapAsAdmin)
|
||||||
.put("visibleInWhoisAsTech", visibleInWhoisAsTech)
|
.put("visibleInRdapAsTech", visibleInRdapAsTech)
|
||||||
.put("visibleInDomainWhoisAsAbuse", visibleInDomainWhoisAsAbuse)
|
.put("visibleInDomainRdapAsAbuse", visibleInDomainRdapAsAbuse)
|
||||||
.put("id", getId())
|
.put("id", getId())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
@@ -336,18 +327,18 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setVisibleInWhoisAsAdmin(boolean visible) {
|
public Builder setVisibleInRdapAsAdmin(boolean visible) {
|
||||||
getInstance().visibleInWhoisAsAdmin = visible;
|
getInstance().visibleInRdapAsAdmin = visible;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setVisibleInWhoisAsTech(boolean visible) {
|
public Builder setVisibleInRdapAsTech(boolean visible) {
|
||||||
getInstance().visibleInWhoisAsTech = visible;
|
getInstance().visibleInRdapAsTech = visible;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setVisibleInDomainWhoisAsAbuse(boolean visible) {
|
public Builder setVisibleInDomainRdapAsAbuse(boolean visible) {
|
||||||
getInstance().visibleInDomainWhoisAsAbuse = visible;
|
getInstance().visibleInDomainRdapAsAbuse = visible;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ public class RdapJsonFormatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the list of RDAP roles for a registrar POC, using the visibleInWhoisAs* flags.
|
* Creates the list of RDAP roles for a registrar POC, using the visibleInRdapAs* flags.
|
||||||
*
|
*
|
||||||
* <p>Only POCs with a non-empty role list should be visible.
|
* <p>Only POCs with a non-empty role list should be visible.
|
||||||
*
|
*
|
||||||
@@ -672,13 +672,13 @@ public class RdapJsonFormatter {
|
|||||||
*/
|
*/
|
||||||
private static ImmutableList<RdapEntity.Role> makeRdapRoleList(RegistrarPoc registrarPoc) {
|
private static ImmutableList<RdapEntity.Role> makeRdapRoleList(RegistrarPoc registrarPoc) {
|
||||||
ImmutableList.Builder<RdapEntity.Role> rolesBuilder = new ImmutableList.Builder<>();
|
ImmutableList.Builder<RdapEntity.Role> rolesBuilder = new ImmutableList.Builder<>();
|
||||||
if (registrarPoc.getVisibleInWhoisAsAdmin()) {
|
if (registrarPoc.getVisibleInRdapAsAdmin()) {
|
||||||
rolesBuilder.add(RdapEntity.Role.ADMIN);
|
rolesBuilder.add(RdapEntity.Role.ADMIN);
|
||||||
}
|
}
|
||||||
if (registrarPoc.getVisibleInWhoisAsTech()) {
|
if (registrarPoc.getVisibleInRdapAsTech()) {
|
||||||
rolesBuilder.add(RdapEntity.Role.TECH);
|
rolesBuilder.add(RdapEntity.Role.TECH);
|
||||||
}
|
}
|
||||||
if (registrarPoc.getVisibleInDomainWhoisAsAbuse()) {
|
if (registrarPoc.getVisibleInDomainRdapAsAbuse()) {
|
||||||
rolesBuilder.add(RdapEntity.Role.ABUSE);
|
rolesBuilder.add(RdapEntity.Role.ABUSE);
|
||||||
}
|
}
|
||||||
return rolesBuilder.build();
|
return rolesBuilder.build();
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ public class Spec11EmailUtils {
|
|||||||
|
|
||||||
private InternetAddress getEmailAddressForRegistrar(String registrarId)
|
private InternetAddress getEmailAddressForRegistrar(String registrarId)
|
||||||
throws MessagingException {
|
throws MessagingException {
|
||||||
// Attempt to use the registrar's WHOIS abuse contact, then fall back to the regular address.
|
// Attempt to use the registrar's RDAP abuse contact, then fall back to the regular address.
|
||||||
Registrar registrar =
|
Registrar registrar =
|
||||||
Registrar.loadByRegistrarIdCached(registrarId)
|
Registrar.loadByRegistrarIdCached(registrarId)
|
||||||
.orElseThrow(
|
.orElseThrow(
|
||||||
@@ -235,7 +235,7 @@ public class Spec11EmailUtils {
|
|||||||
String.format("Could not find registrar %s", registrarId)));
|
String.format("Could not find registrar %s", registrarId)));
|
||||||
return new InternetAddress(
|
return new InternetAddress(
|
||||||
registrar
|
registrar
|
||||||
.getWhoisAbuseContact()
|
.getRdapAbuseContact()
|
||||||
.map(RegistrarPoc::getEmailAddress)
|
.map(RegistrarPoc::getEmailAddress)
|
||||||
.orElse(registrar.getEmailAddress()));
|
.orElse(registrar.getEmailAddress()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ final class CreateRegistrarCommand extends CreateOrUpdateRegistrarCommand
|
|||||||
"Cannot add allowed TLDs when creating a REAL registrar in a production environment."
|
"Cannot add allowed TLDs when creating a REAL registrar in a production environment."
|
||||||
+ " Please create the registrar without allowed TLDs, then use `nomulus"
|
+ " Please create the registrar without allowed TLDs, then use `nomulus"
|
||||||
+ " registrar_contact` to create a registrar contact for it that is visible as the"
|
+ " registrar_contact` to create a registrar contact for it that is visible as the"
|
||||||
+ " abuse contact in WHOIS. Then use `nomulus update_registrar` to add the allowed"
|
+ " abuse contact in RDAP. Then use `nomulus update_registrar` to add the allowed"
|
||||||
+ " TLDs.");
|
+ " TLDs.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,28 +103,27 @@ final class RegistrarPocCommand extends MutatingCommand {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Parameter(
|
@Parameter(
|
||||||
names = "--visible_in_whois_as_admin",
|
names = "--visible_in_rdap_as_admin",
|
||||||
description = " Whether this contact is publicly visible in WHOIS results as an "
|
description = "If this contact is publicly visible in RDAP results as an " + "Admin contact.",
|
||||||
+ "Admin contact.",
|
|
||||||
arity = 1)
|
arity = 1)
|
||||||
private Boolean visibleInWhoisAsAdmin;
|
private Boolean visibleInRdapAsAdmin;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Parameter(
|
@Parameter(
|
||||||
names = "--visible_in_whois_as_tech",
|
names = "--visible_in_rdap_as_tech",
|
||||||
description = " Whether this contact is publicly visible in WHOIS results as a "
|
description = "If this contact is publicly visible in RDAP results as a " + "Tech contact.",
|
||||||
+ "Tech contact.",
|
|
||||||
arity = 1)
|
arity = 1)
|
||||||
private Boolean visibleInWhoisAsTech;
|
private Boolean visibleInRdapAsTech;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Parameter(
|
@Parameter(
|
||||||
names = "--visible_in_domain_whois_as_abuse",
|
names = "--visible_in_domain_rdap_as_abuse",
|
||||||
description = " Whether this contact is publicly visible in WHOIS domain results as the "
|
description =
|
||||||
+ "registry abuse phone and email. If this flag is set, it will be cleared from all "
|
" Whether this contact is publicly visible in RDAP domain results as the "
|
||||||
+ "other contacts for the same registrar.",
|
+ "registry abuse phone and email. If this flag is set, it will be cleared from all "
|
||||||
|
+ "other contacts for the same registrar.",
|
||||||
arity = 1)
|
arity = 1)
|
||||||
private Boolean visibleInDomainWhoisAsAbuse;
|
private Boolean visibleInDomainRdapAsAbuse;
|
||||||
|
|
||||||
@Parameter(
|
@Parameter(
|
||||||
names = {"-o", "--output"},
|
names = {"-o", "--output"},
|
||||||
@@ -166,8 +165,8 @@ final class RegistrarPocCommand extends MutatingCommand {
|
|||||||
case LIST -> listContacts(contacts);
|
case LIST -> listContacts(contacts);
|
||||||
case CREATE -> {
|
case CREATE -> {
|
||||||
stageEntityChange(null, createContact(registrar));
|
stageEntityChange(null, createContact(registrar));
|
||||||
if (visibleInDomainWhoisAsAbuse != null && visibleInDomainWhoisAsAbuse) {
|
if (visibleInDomainRdapAsAbuse != null && visibleInDomainRdapAsAbuse) {
|
||||||
unsetOtherWhoisAbuseFlags(contacts, null);
|
unsetOtherRdapAbuseFlags(contacts, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case UPDATE -> {
|
case UPDATE -> {
|
||||||
@@ -178,13 +177,13 @@ final class RegistrarPocCommand extends MutatingCommand {
|
|||||||
email);
|
email);
|
||||||
RegistrarPoc newContact = updateContact(oldContact, registrar);
|
RegistrarPoc newContact = updateContact(oldContact, registrar);
|
||||||
checkArgument(
|
checkArgument(
|
||||||
!oldContact.getVisibleInDomainWhoisAsAbuse()
|
!oldContact.getVisibleInDomainRdapAsAbuse()
|
||||||
|| newContact.getVisibleInDomainWhoisAsAbuse(),
|
|| newContact.getVisibleInDomainRdapAsAbuse(),
|
||||||
"Cannot clear visible_in_domain_whois_as_abuse flag, as that would leave no domain"
|
"Cannot clear visible_in_domain_rdap_as_abuse flag, as that would leave no domain"
|
||||||
+ " WHOIS abuse contacts; instead, set the flag on another contact");
|
+ " RDAP abuse contacts; instead, set the flag on another contact");
|
||||||
stageEntityChange(oldContact, newContact);
|
stageEntityChange(oldContact, newContact);
|
||||||
if (visibleInDomainWhoisAsAbuse != null && visibleInDomainWhoisAsAbuse) {
|
if (visibleInDomainRdapAsAbuse != null && visibleInDomainRdapAsAbuse) {
|
||||||
unsetOtherWhoisAbuseFlags(contacts, oldContact.getEmailAddress());
|
unsetOtherRdapAbuseFlags(contacts, oldContact.getEmailAddress());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case DELETE -> {
|
case DELETE -> {
|
||||||
@@ -194,8 +193,8 @@ final class RegistrarPocCommand extends MutatingCommand {
|
|||||||
"No contact with the given email: %s",
|
"No contact with the given email: %s",
|
||||||
email);
|
email);
|
||||||
checkArgument(
|
checkArgument(
|
||||||
!oldContact.getVisibleInDomainWhoisAsAbuse(),
|
!oldContact.getVisibleInDomainRdapAsAbuse(),
|
||||||
"Cannot delete the domain WHOIS abuse contact; set the flag on another contact first");
|
"Cannot delete the domain RDAP abuse contact; set the flag on another contact first");
|
||||||
stageEntityChange(oldContact, null);
|
stageEntityChange(oldContact, null);
|
||||||
}
|
}
|
||||||
default -> throw new AssertionError();
|
default -> throw new AssertionError();
|
||||||
@@ -228,14 +227,14 @@ final class RegistrarPocCommand extends MutatingCommand {
|
|||||||
}
|
}
|
||||||
builder.setTypes(nullToEmpty(contactTypes));
|
builder.setTypes(nullToEmpty(contactTypes));
|
||||||
|
|
||||||
if (visibleInWhoisAsAdmin != null) {
|
if (visibleInRdapAsAdmin != null) {
|
||||||
builder.setVisibleInWhoisAsAdmin(visibleInWhoisAsAdmin);
|
builder.setVisibleInRdapAsAdmin(visibleInRdapAsAdmin);
|
||||||
}
|
}
|
||||||
if (visibleInWhoisAsTech != null) {
|
if (visibleInRdapAsTech != null) {
|
||||||
builder.setVisibleInWhoisAsTech(visibleInWhoisAsTech);
|
builder.setVisibleInRdapAsTech(visibleInRdapAsTech);
|
||||||
}
|
}
|
||||||
if (visibleInDomainWhoisAsAbuse != null) {
|
if (visibleInDomainRdapAsAbuse != null) {
|
||||||
builder.setVisibleInDomainWhoisAsAbuse(visibleInDomainWhoisAsAbuse);
|
builder.setVisibleInDomainRdapAsAbuse(visibleInDomainRdapAsAbuse);
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
@@ -257,24 +256,24 @@ final class RegistrarPocCommand extends MutatingCommand {
|
|||||||
if (contactTypes != null) {
|
if (contactTypes != null) {
|
||||||
builder.setTypes(contactTypes);
|
builder.setTypes(contactTypes);
|
||||||
}
|
}
|
||||||
if (visibleInWhoisAsAdmin != null) {
|
if (visibleInRdapAsAdmin != null) {
|
||||||
builder.setVisibleInWhoisAsAdmin(visibleInWhoisAsAdmin);
|
builder.setVisibleInRdapAsAdmin(visibleInRdapAsAdmin);
|
||||||
}
|
}
|
||||||
if (visibleInWhoisAsTech != null) {
|
if (visibleInRdapAsTech != null) {
|
||||||
builder.setVisibleInWhoisAsTech(visibleInWhoisAsTech);
|
builder.setVisibleInRdapAsTech(visibleInRdapAsTech);
|
||||||
}
|
}
|
||||||
if (visibleInDomainWhoisAsAbuse != null) {
|
if (visibleInDomainRdapAsAbuse != null) {
|
||||||
builder.setVisibleInDomainWhoisAsAbuse(visibleInDomainWhoisAsAbuse);
|
builder.setVisibleInDomainRdapAsAbuse(visibleInDomainRdapAsAbuse);
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unsetOtherWhoisAbuseFlags(
|
private void unsetOtherRdapAbuseFlags(
|
||||||
ImmutableSet<RegistrarPoc> contacts, @Nullable String emailAddressNotToChange) {
|
ImmutableSet<RegistrarPoc> contacts, @Nullable String emailAddressNotToChange) {
|
||||||
for (RegistrarPoc contact : contacts) {
|
for (RegistrarPoc contact : contacts) {
|
||||||
if (!contact.getEmailAddress().equals(emailAddressNotToChange)
|
if (!contact.getEmailAddress().equals(emailAddressNotToChange)
|
||||||
&& contact.getVisibleInDomainWhoisAsAbuse()) {
|
&& contact.getVisibleInDomainRdapAsAbuse()) {
|
||||||
RegistrarPoc newContact = contact.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build();
|
RegistrarPoc newContact = contact.asBuilder().setVisibleInDomainRdapAsAbuse(false).build();
|
||||||
stageEntityChange(contact, newContact);
|
stageEntityChange(contact, newContact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ final class UpdateRegistrarCommand extends CreateOrUpdateRegistrarCommand {
|
|||||||
@Override
|
@Override
|
||||||
void checkModifyAllowedTlds(@Nullable Registrar oldRegistrar) {
|
void checkModifyAllowedTlds(@Nullable Registrar oldRegistrar) {
|
||||||
// Only allow modifying allowed TLDs if we're in a non-PRODUCTION environment, if the registrar
|
// Only allow modifying allowed TLDs if we're in a non-PRODUCTION environment, if the registrar
|
||||||
// is not REAL, or the registrar has a WHOIS abuse contact set.
|
// is not REAL, or the registrar has an RDAP abuse contact set.
|
||||||
checkArgumentNotNull(oldRegistrar, "Old registrar was not present during modification");
|
checkArgumentNotNull(oldRegistrar, "Old registrar was not present during modification");
|
||||||
|
|
||||||
boolean isRealRegistrar =
|
boolean isRealRegistrar =
|
||||||
@@ -43,9 +43,9 @@ final class UpdateRegistrarCommand extends CreateOrUpdateRegistrarCommand {
|
|||||||
|| (Registrar.Type.REAL.equals(oldRegistrar.getType()) && registrarType == null);
|
|| (Registrar.Type.REAL.equals(oldRegistrar.getType()) && registrarType == null);
|
||||||
if (RegistryEnvironment.PRODUCTION.equals(RegistryEnvironment.get()) && isRealRegistrar) {
|
if (RegistryEnvironment.PRODUCTION.equals(RegistryEnvironment.get()) && isRealRegistrar) {
|
||||||
checkArgumentPresent(
|
checkArgumentPresent(
|
||||||
oldRegistrar.getWhoisAbuseContact(),
|
oldRegistrar.getRdapAbuseContact(),
|
||||||
"Cannot modify allowed TLDs if there is no WHOIS abuse contact set. Please use the"
|
"Cannot modify allowed TLDs if there is no RDAP abuse contact set. Please use the"
|
||||||
+ " \"nomulus registrar_contact\" command on this registrar to set a WHOIS abuse"
|
+ " \"nomulus registrar_contact\" command on this registrar to set an RDAP abuse"
|
||||||
+ " contact.");
|
+ " contact.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,17 +79,17 @@ public class ConsoleUpdateRegistrarAction extends ConsoleApiAction {
|
|||||||
registrarParam.getRegistrarId());
|
registrarParam.getRegistrarId());
|
||||||
|
|
||||||
// Only allow modifying allowed TLDs if we're in a non-PRODUCTION environment, if the
|
// Only allow modifying allowed TLDs if we're in a non-PRODUCTION environment, if the
|
||||||
// registrar is not REAL, or the registrar has a WHOIS abuse contact set.
|
// registrar is not REAL, or the registrar has a RDAP abuse contact set.
|
||||||
if (!registrarParam.getAllowedTlds().isEmpty()) {
|
if (!registrarParam.getAllowedTlds().isEmpty()) {
|
||||||
boolean isRealRegistrar =
|
boolean isRealRegistrar =
|
||||||
Registrar.Type.REAL.equals(existingRegistrar.get().getType());
|
Registrar.Type.REAL.equals(existingRegistrar.get().getType());
|
||||||
if (RegistryEnvironment.PRODUCTION.equals(RegistryEnvironment.get())
|
if (RegistryEnvironment.PRODUCTION.equals(RegistryEnvironment.get())
|
||||||
&& isRealRegistrar) {
|
&& isRealRegistrar) {
|
||||||
checkArgumentPresent(
|
checkArgumentPresent(
|
||||||
existingRegistrar.get().getWhoisAbuseContact(),
|
existingRegistrar.get().getRdapAbuseContact(),
|
||||||
"Cannot modify allowed TLDs if there is no WHOIS abuse contact set. Please"
|
"Cannot modify allowed TLDs if there is no RDAP abuse contact set. Please"
|
||||||
+ " use the \"nomulus registrar_contact\" command on this registrar to"
|
+ " use the \"nomulus registrar_contact\" command on this registrar to"
|
||||||
+ " set a WHOIS abuse contact.");
|
+ " set a RDAP abuse contact.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ public class ContactAction extends ConsoleApiAction {
|
|||||||
new RegistrarPoc()
|
new RegistrarPoc()
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setTypes(newContact.getTypes())
|
.setTypes(newContact.getTypes())
|
||||||
.setVisibleInWhoisAsTech(newContact.getVisibleInWhoisAsTech())
|
.setVisibleInRdapAsTech(newContact.getVisibleInRdapAsTech())
|
||||||
.setVisibleInWhoisAsAdmin(newContact.getVisibleInWhoisAsAdmin())
|
.setVisibleInRdapAsAdmin(newContact.getVisibleInRdapAsAdmin())
|
||||||
.setVisibleInDomainWhoisAsAbuse(newContact.getVisibleInDomainWhoisAsAbuse())
|
.setVisibleInDomainRdapAsAbuse(newContact.getVisibleInDomainRdapAsAbuse())
|
||||||
.setFaxNumber(newContact.getFaxNumber())
|
.setFaxNumber(newContact.getFaxNumber())
|
||||||
.setName(newContact.getName())
|
.setName(newContact.getName())
|
||||||
.setEmailAddress(newContact.getEmailAddress())
|
.setEmailAddress(newContact.getEmailAddress())
|
||||||
@@ -133,10 +133,10 @@ public class ContactAction extends ConsoleApiAction {
|
|||||||
? oldContact
|
? oldContact
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setTypes(updatedContact.getTypes())
|
.setTypes(updatedContact.getTypes())
|
||||||
.setVisibleInWhoisAsTech(updatedContact.getVisibleInWhoisAsTech())
|
.setVisibleInRdapAsTech(updatedContact.getVisibleInRdapAsTech())
|
||||||
.setVisibleInWhoisAsAdmin(updatedContact.getVisibleInWhoisAsAdmin())
|
.setVisibleInRdapAsAdmin(updatedContact.getVisibleInRdapAsAdmin())
|
||||||
.setVisibleInDomainWhoisAsAbuse(
|
.setVisibleInDomainRdapAsAbuse(
|
||||||
updatedContact.getVisibleInDomainWhoisAsAbuse())
|
updatedContact.getVisibleInDomainRdapAsAbuse())
|
||||||
.setFaxNumber(updatedContact.getFaxNumber())
|
.setFaxNumber(updatedContact.getFaxNumber())
|
||||||
.setName(updatedContact.getName())
|
.setName(updatedContact.getName())
|
||||||
.setEmailAddress(updatedContact.getEmailAddress())
|
.setEmailAddress(updatedContact.getEmailAddress())
|
||||||
@@ -231,19 +231,19 @@ public class ContactAction extends ConsoleApiAction {
|
|||||||
|
|
||||||
enforcePrimaryContactRestrictions(oldContactsByType, newContactsByType);
|
enforcePrimaryContactRestrictions(oldContactsByType, newContactsByType);
|
||||||
ensurePhoneNumberNotRemovedForContactTypes(oldContactsByType, newContactsByType, Type.TECH);
|
ensurePhoneNumberNotRemovedForContactTypes(oldContactsByType, newContactsByType, Type.TECH);
|
||||||
Optional<RegistrarPoc> domainWhoisAbuseContact =
|
Optional<RegistrarPoc> domainRdapAbuseContact =
|
||||||
getDomainWhoisVisibleAbuseContact(updatedContacts);
|
getDomainRdapVisibleAbuseContact(updatedContacts);
|
||||||
// If the new set has a domain WHOIS abuse contact, it must have a phone number.
|
// If the new set has a domain RDAP abuse contact, it must have a phone number.
|
||||||
if (domainWhoisAbuseContact.isPresent()
|
if (domainRdapAbuseContact.isPresent()
|
||||||
&& domainWhoisAbuseContact.get().getPhoneNumber() == null) {
|
&& domainRdapAbuseContact.get().getPhoneNumber() == null) {
|
||||||
throw new ContactRequirementException(
|
throw new ContactRequirementException(
|
||||||
"The abuse contact visible in domain WHOIS query must have a phone number");
|
"The abuse contact visible in domain RDAP query must have a phone number");
|
||||||
}
|
}
|
||||||
// If there was a domain WHOIS abuse contact in the old set, the new set must have one.
|
// If there was a domain RDAP abuse contact in the old set, the new set must have one.
|
||||||
if (getDomainWhoisVisibleAbuseContact(existingContacts).isPresent()
|
if (getDomainRdapVisibleAbuseContact(existingContacts).isPresent()
|
||||||
&& domainWhoisAbuseContact.isEmpty()) {
|
&& domainRdapAbuseContact.isEmpty()) {
|
||||||
throw new ContactRequirementException(
|
throw new ContactRequirementException(
|
||||||
"An abuse contact visible in domain WHOIS query must be designated");
|
"An abuse contact visible in domain RDAP query must be designated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,17 +265,17 @@ public class ContactAction extends ConsoleApiAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the registrar contact whose phone number and email address is visible in domain WHOIS
|
* Retrieves the registrar contact whose phone number and email address is visible in domain RDAP
|
||||||
* query as abuse contact (if any).
|
* query as abuse contact (if any).
|
||||||
*
|
*
|
||||||
* <p>Frontend processing ensures that only one contact can be set as abuse contact in domain
|
* <p>Frontend processing ensures that only one contact can be set as abuse contact in domain RDAP
|
||||||
* WHOIS record.
|
* record.
|
||||||
*
|
*
|
||||||
* <p>Therefore, it is possible to return inside the loop once one such contact is found.
|
* <p>Therefore, it is possible to return inside the loop once one such contact is found.
|
||||||
*/
|
*/
|
||||||
private static Optional<RegistrarPoc> getDomainWhoisVisibleAbuseContact(
|
private static Optional<RegistrarPoc> getDomainRdapVisibleAbuseContact(
|
||||||
Set<RegistrarPoc> contacts) {
|
Set<RegistrarPoc> contacts) {
|
||||||
return contacts.stream().filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse).findFirst();
|
return contacts.stream().filter(RegistrarPoc::getVisibleInDomainRdapAsAbuse).findFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -221,8 +221,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
|||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.build());
|
.build());
|
||||||
persistResources(contacts);
|
persistResources(contacts);
|
||||||
RuntimeException thrown =
|
RuntimeException thrown =
|
||||||
@@ -511,8 +511,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
|||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -529,8 +529,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
|||||||
.setPhoneNumber("+1.3105551213")
|
.setPhoneNumber("+1.3105551213")
|
||||||
.setFaxNumber("+1.3105551213")
|
.setFaxNumber("+1.3105551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -547,7 +547,7 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
|||||||
.setPhoneNumber("+1.3105551215")
|
.setPhoneNumber("+1.3105551215")
|
||||||
.setFaxNumber("+1.3105551216")
|
.setFaxNumber("+1.3105551216")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.build());
|
.build());
|
||||||
persistResources(contacts);
|
persistResources(contacts);
|
||||||
assertThat(action.getEmailAddresses(registrar, Type.TECH))
|
assertThat(action.getEmailAddresses(registrar, Type.TECH))
|
||||||
|
|||||||
@@ -168,8 +168,8 @@ public class SyncRegistrarsSheetTest {
|
|||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
// Purposely flip the internal/external admin/tech
|
// Purposely flip the internal/external admin/tech
|
||||||
// distinction to make sure we're not relying on it. Sigh.
|
// distinction to make sure we're not relying on it. Sigh.
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInRdapAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -201,9 +201,9 @@ public class SyncRegistrarsSheetTest {
|
|||||||
contact@example.com
|
contact@example.com
|
||||||
Tel: +1.1234567890
|
Tel: +1.1234567890
|
||||||
Types: [ADMIN, BILLING]
|
Types: [ADMIN, BILLING]
|
||||||
Visible in registrar WHOIS query as Admin contact: No
|
Visible in registrar RDAP query as Admin contact: No
|
||||||
Visible in registrar WHOIS query as Technical contact: No
|
Visible in registrar RDAP query as Technical contact: No
|
||||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||||
info: No
|
info: No
|
||||||
|
|
||||||
John Doe
|
John Doe
|
||||||
@@ -211,9 +211,9 @@ public class SyncRegistrarsSheetTest {
|
|||||||
Tel: +1.1234567890
|
Tel: +1.1234567890
|
||||||
Fax: +1.1234567891
|
Fax: +1.1234567891
|
||||||
Types: [ADMIN]
|
Types: [ADMIN]
|
||||||
Visible in registrar WHOIS query as Admin contact: No
|
Visible in registrar RDAP query as Admin contact: No
|
||||||
Visible in registrar WHOIS query as Technical contact: Yes
|
Visible in registrar RDAP query as Technical contact: Yes
|
||||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||||
info: No
|
info: No
|
||||||
""");
|
""");
|
||||||
assertThat(row)
|
assertThat(row)
|
||||||
@@ -223,9 +223,9 @@ public class SyncRegistrarsSheetTest {
|
|||||||
Jane Smith
|
Jane Smith
|
||||||
pride@example.net
|
pride@example.net
|
||||||
Types: [TECH]
|
Types: [TECH]
|
||||||
Visible in registrar WHOIS query as Admin contact: No
|
Visible in registrar RDAP query as Admin contact: No
|
||||||
Visible in registrar WHOIS query as Technical contact: No
|
Visible in registrar RDAP query as Technical contact: No
|
||||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||||
info: No
|
info: No
|
||||||
""");
|
""");
|
||||||
assertThat(row).containsEntry("marketingContacts", "");
|
assertThat(row).containsEntry("marketingContacts", "");
|
||||||
@@ -240,9 +240,9 @@ public class SyncRegistrarsSheetTest {
|
|||||||
contact@example.com
|
contact@example.com
|
||||||
Tel: +1.1234567890
|
Tel: +1.1234567890
|
||||||
Types: [ADMIN, BILLING]
|
Types: [ADMIN, BILLING]
|
||||||
Visible in registrar WHOIS query as Admin contact: No
|
Visible in registrar RDAP query as Admin contact: No
|
||||||
Visible in registrar WHOIS query as Technical contact: No
|
Visible in registrar RDAP query as Technical contact: No
|
||||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||||
info: No
|
info: No
|
||||||
""");
|
""");
|
||||||
assertThat(row).containsEntry("contactsMarkedAsWhoisAdmin", "");
|
assertThat(row).containsEntry("contactsMarkedAsWhoisAdmin", "");
|
||||||
@@ -255,9 +255,9 @@ public class SyncRegistrarsSheetTest {
|
|||||||
Tel: +1.1234567890
|
Tel: +1.1234567890
|
||||||
Fax: +1.1234567891
|
Fax: +1.1234567891
|
||||||
Types: [ADMIN]
|
Types: [ADMIN]
|
||||||
Visible in registrar WHOIS query as Admin contact: No
|
Visible in registrar RDAP query as Admin contact: No
|
||||||
Visible in registrar WHOIS query as Technical contact: Yes
|
Visible in registrar RDAP query as Technical contact: Yes
|
||||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||||
info: No
|
info: No
|
||||||
""");
|
""");
|
||||||
assertThat(row).containsEntry("emailAddress", "nowhere@example.org");
|
assertThat(row).containsEntry("emailAddress", "nowhere@example.org");
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ class RegistrarTest extends EntityTestCase {
|
|||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Abused")
|
.setName("John Abused")
|
||||||
.setEmailAddress("johnabuse@example.com")
|
.setEmailAddress("johnabuse@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ABUSE, RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ABUSE, RegistrarPoc.Type.ADMIN))
|
||||||
@@ -323,8 +323,8 @@ class RegistrarTest extends EntityTestCase {
|
|||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jake Tech")
|
.setName("Jake Tech")
|
||||||
.setEmailAddress("jaketech@example.com")
|
.setEmailAddress("jaketech@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
@@ -335,8 +335,8 @@ class RegistrarTest extends EntityTestCase {
|
|||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Jim Tech-Abuse")
|
.setName("Jim Tech-Abuse")
|
||||||
.setEmailAddress("jimtechAbuse@example.com")
|
.setEmailAddress("jimtechAbuse@example.com")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setPhoneNumber("+1.2125551213")
|
.setPhoneNumber("+1.2125551213")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ABUSE))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ABUSE))
|
||||||
|
|||||||
@@ -407,8 +407,8 @@ public abstract class JpaTransactionManagerExtension
|
|||||||
return new RegistrarPoc.Builder()
|
return new RegistrarPoc.Builder()
|
||||||
.setRegistrar(makeRegistrar1())
|
.setRegistrar(makeRegistrar1())
|
||||||
.setName("Jane Doe")
|
.setName("Jane Doe")
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.setEmailAddress("janedoe@theregistrar.com")
|
.setEmailAddress("janedoe@theregistrar.com")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
|
|||||||
@@ -198,8 +198,8 @@ class RdapJsonFormatterTest {
|
|||||||
.setPhoneNumber("+1.2125551217")
|
.setPhoneNumber("+1.2125551217")
|
||||||
.setFaxNumber("+1.2125551218")
|
.setFaxNumber("+1.2125551218")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInRdapAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -207,8 +207,8 @@ class RdapJsonFormatterTest {
|
|||||||
.setEmailAddress("johndoe@example.com")
|
.setEmailAddress("johndoe@example.com")
|
||||||
.setFaxNumber("+1.2125551213")
|
.setFaxNumber("+1.2125551213")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInRdapAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -216,8 +216,8 @@ class RdapJsonFormatterTest {
|
|||||||
.setEmailAddress("janedoe@example.com")
|
.setEmailAddress("janedoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551215")
|
.setPhoneNumber("+1.2125551215")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -226,8 +226,8 @@ class RdapJsonFormatterTest {
|
|||||||
.setPhoneNumber("+1.2125551217")
|
.setPhoneNumber("+1.2125551217")
|
||||||
.setFaxNumber("+1.2125551218")
|
.setFaxNumber("+1.2125551218")
|
||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.BILLING))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.BILLING))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -354,13 +354,13 @@ class Spec11EmailUtilsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_useWhoisAbuseEmailIfAvailable() throws Exception {
|
void testSuccess_useRdapAbuseEmailIfAvailable() throws Exception {
|
||||||
// if John Doe is the whois abuse contact, email them instead of the regular email
|
// if John Doe is the RDAP abuse contact, email them instead of the regular email
|
||||||
persistResource(
|
persistResource(
|
||||||
makeRegistrarContact2()
|
makeRegistrarContact2()
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setEmailAddress("johndoe@theregistrar.com")
|
.setEmailAddress("johndoe@theregistrar.com")
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
emailUtils.emailSpec11Reports(
|
emailUtils.emailSpec11Reports(
|
||||||
date,
|
date,
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ class RegistrarPocTest {
|
|||||||
.setPhoneNumber("+1.2125650000")
|
.setPhoneNumber("+1.2125650000")
|
||||||
.setFaxNumber("+1.2125650001")
|
.setFaxNumber("+1.2125650001")
|
||||||
.setTypes(ImmutableSet.of(WHOIS))
|
.setTypes(ImmutableSet.of(WHOIS))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.setVisibleInDomainWhoisAsAbuse(false)
|
.setVisibleInDomainRdapAsAbuse(false)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import java.util.Optional;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/** Test helper methods for the rdap and whois packages. */
|
/** Test helper methods for the RDAP package. */
|
||||||
public final class FullFieldsTestEntityHelper {
|
public final class FullFieldsTestEntityHelper {
|
||||||
|
|
||||||
public static Registrar makeRegistrar(
|
public static Registrar makeRegistrar(
|
||||||
@@ -100,8 +100,8 @@ public final class FullFieldsTestEntityHelper {
|
|||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||||
// Purposely flip the internal/external admin/tech
|
// Purposely flip the internal/external admin/tech
|
||||||
// distinction to make sure we're not relying on it. Sigh.
|
// distinction to make sure we're not relying on it. Sigh.
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInRdapAsAdmin(false)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -112,8 +112,8 @@ public final class FullFieldsTestEntityHelper {
|
|||||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||||
// Purposely flip the internal/external admin/tech
|
// Purposely flip the internal/external admin/tech
|
||||||
// distinction to make sure we're not relying on it. Sigh.
|
// distinction to make sure we're not relying on it. Sigh.
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.build(),
|
.build(),
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
@@ -121,7 +121,7 @@ public final class FullFieldsTestEntityHelper {
|
|||||||
.setEmailAddress("jakedoe@example.com")
|
.setEmailAddress("jakedoe@example.com")
|
||||||
.setPhoneNumber("+1.2125551216")
|
.setPhoneNumber("+1.2125551216")
|
||||||
.setFaxNumber("+1.2125551216")
|
.setFaxNumber("+1.2125551216")
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setTypes(ImmutableSet.of(ADMIN))
|
.setTypes(ImmutableSet.of(ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.build())));
|
.build())));
|
||||||
runCommandForced("--mode=LIST", "--output=" + output, "NewRegistrar");
|
runCommandForced("--mode=LIST", "--output=" + output, "NewRegistrar");
|
||||||
assertThat(Files.readAllLines(Paths.get(output), UTF_8))
|
assertThat(Files.readAllLines(Paths.get(output), UTF_8))
|
||||||
@@ -67,9 +67,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
"John Doe",
|
"John Doe",
|
||||||
"john.doe@example.com",
|
"john.doe@example.com",
|
||||||
"Types: [ADMIN]",
|
"Types: [ADMIN]",
|
||||||
"Visible in registrar WHOIS query as Admin contact: Yes",
|
"Visible in registrar RDAP query as Admin contact: Yes",
|
||||||
"Visible in registrar WHOIS query as Technical contact: No",
|
"Visible in registrar RDAP query as Technical contact: No",
|
||||||
"Phone number and email visible in domain WHOIS query as "
|
"Phone number and email visible in domain RDAP query as "
|
||||||
+ "Registrar Abuse contact info: No");
|
+ "Registrar Abuse contact info: No");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,9 +83,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setName("Judith Doe")
|
.setName("Judith Doe")
|
||||||
.setEmailAddress("judith.doe@example.com")
|
.setEmailAddress("judith.doe@example.com")
|
||||||
.setTypes(ImmutableSet.of(WHOIS))
|
.setTypes(ImmutableSet.of(WHOIS))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setVisibleInDomainWhoisAsAbuse(false)
|
.setVisibleInDomainRdapAsAbuse(false)
|
||||||
.build());
|
.build());
|
||||||
persistResources(contacts);
|
persistResources(contacts);
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
@@ -95,9 +95,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
"--phone=+1.2125650000",
|
"--phone=+1.2125650000",
|
||||||
"--fax=+1.2125650001",
|
"--fax=+1.2125650001",
|
||||||
"--contact_type=WHOIS",
|
"--contact_type=WHOIS",
|
||||||
"--visible_in_whois_as_admin=true",
|
"--visible_in_rdap_as_admin=true",
|
||||||
"--visible_in_whois_as_tech=false",
|
"--visible_in_rdap_as_tech=false",
|
||||||
"--visible_in_domain_whois_as_abuse=false",
|
"--visible_in_domain_rdap_as_abuse=false",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertAboutImmutableObjects()
|
assertAboutImmutableObjects()
|
||||||
@@ -110,15 +110,15 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setPhoneNumber("+1.2125650000")
|
.setPhoneNumber("+1.2125650000")
|
||||||
.setFaxNumber("+1.2125650001")
|
.setFaxNumber("+1.2125650001")
|
||||||
.setTypes(ImmutableSet.of(WHOIS))
|
.setTypes(ImmutableSet.of(WHOIS))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.setVisibleInDomainWhoisAsAbuse(false)
|
.setVisibleInDomainRdapAsAbuse(false)
|
||||||
.build(),
|
.build(),
|
||||||
"id");
|
"id");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_unsetOtherWhoisAbuseFlags() throws Exception {
|
void testUpdate_unsetOtherRdapAbuseFlags() throws Exception {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistResource(
|
persistResource(
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
@@ -131,33 +131,33 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("Johnna Doe")
|
.setName("Johnna Doe")
|
||||||
.setEmailAddress("johnna.doe@example.com")
|
.setEmailAddress("johnna.doe@example.com")
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=UPDATE",
|
"--mode=UPDATE",
|
||||||
"--email=john.doe@example.com",
|
"--email=john.doe@example.com",
|
||||||
"--visible_in_domain_whois_as_abuse=true",
|
"--visible_in_domain_rdap_as_abuse=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
ImmutableList<RegistrarPoc> registrarPocs =
|
ImmutableList<RegistrarPoc> registrarPocs =
|
||||||
loadRegistrar("NewRegistrar").getContacts().asList();
|
loadRegistrar("NewRegistrar").getContacts().asList();
|
||||||
for (RegistrarPoc registrarPoc : registrarPocs) {
|
for (RegistrarPoc registrarPoc : registrarPocs) {
|
||||||
if ("John Doe".equals(registrarPoc.getName())) {
|
if ("John Doe".equals(registrarPoc.getName())) {
|
||||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse()).isTrue();
|
||||||
} else {
|
} else {
|
||||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isFalse();
|
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse()).isFalse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_cannotUnsetOnlyWhoisAbuseContact() {
|
void testUpdate_cannotUnsetOnlyRdapAbuseContact() {
|
||||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||||
persistResource(
|
persistResource(
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
.setRegistrar(registrar)
|
.setRegistrar(registrar)
|
||||||
.setName("John Doe")
|
.setName("John Doe")
|
||||||
.setEmailAddress("john.doe@example.com")
|
.setEmailAddress("john.doe@example.com")
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
@@ -166,13 +166,13 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=UPDATE",
|
"--mode=UPDATE",
|
||||||
"--email=john.doe@example.com",
|
"--email=john.doe@example.com",
|
||||||
"--visible_in_domain_whois_as_abuse=false",
|
"--visible_in_domain_rdap_as_abuse=false",
|
||||||
"NewRegistrar"));
|
"NewRegistrar"));
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
.hasMessageThat()
|
.hasMessageThat()
|
||||||
.contains("Cannot clear visible_in_domain_whois_as_abuse flag");
|
.contains("Cannot clear visible_in_domain_rdap_as_abuse flag");
|
||||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -187,9 +187,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setPhoneNumber("123-456-7890")
|
.setPhoneNumber("123-456-7890")
|
||||||
.setFaxNumber("123-456-7890")
|
.setFaxNumber("123-456-7890")
|
||||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced("--mode=UPDATE", "--email=john.doe@example.com", "NewRegistrar");
|
runCommandForced("--mode=UPDATE", "--email=john.doe@example.com", "NewRegistrar");
|
||||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
@@ -198,12 +198,12 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
assertThat(registrarPoc.getPhoneNumber()).isEqualTo(existingContact.getPhoneNumber());
|
assertThat(registrarPoc.getPhoneNumber()).isEqualTo(existingContact.getPhoneNumber());
|
||||||
assertThat(registrarPoc.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
|
assertThat(registrarPoc.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
|
||||||
assertThat(registrarPoc.getTypes()).isEqualTo(existingContact.getTypes());
|
assertThat(registrarPoc.getTypes()).isEqualTo(existingContact.getTypes());
|
||||||
assertThat(registrarPoc.getVisibleInWhoisAsAdmin())
|
assertThat(registrarPoc.getVisibleInRdapAsAdmin())
|
||||||
.isEqualTo(existingContact.getVisibleInWhoisAsAdmin());
|
.isEqualTo(existingContact.getVisibleInRdapAsAdmin());
|
||||||
assertThat(registrarPoc.getVisibleInWhoisAsTech())
|
assertThat(registrarPoc.getVisibleInRdapAsTech())
|
||||||
.isEqualTo(existingContact.getVisibleInWhoisAsTech());
|
.isEqualTo(existingContact.getVisibleInRdapAsTech());
|
||||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse())
|
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse())
|
||||||
.isEqualTo(existingContact.getVisibleInDomainWhoisAsAbuse());
|
.isEqualTo(existingContact.getVisibleInDomainRdapAsAbuse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -217,9 +217,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setPhoneNumber("123-456-7890")
|
.setPhoneNumber("123-456-7890")
|
||||||
.setFaxNumber("123-456-7890")
|
.setFaxNumber("123-456-7890")
|
||||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=UPDATE",
|
"--mode=UPDATE",
|
||||||
@@ -254,9 +254,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
"--name=Jim Doe",
|
"--name=Jim Doe",
|
||||||
"--email=jim.doe@example.com",
|
"--email=jim.doe@example.com",
|
||||||
"--contact_type=ADMIN,ABUSE",
|
"--contact_type=ADMIN,ABUSE",
|
||||||
"--visible_in_whois_as_admin=true",
|
"--visible_in_rdap_as_admin=true",
|
||||||
"--visible_in_whois_as_tech=false",
|
"--visible_in_rdap_as_tech=false",
|
||||||
"--visible_in_domain_whois_as_abuse=true",
|
"--visible_in_domain_rdap_as_abuse=true",
|
||||||
"NewRegistrar");
|
"NewRegistrar");
|
||||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||||
assertAboutImmutableObjects()
|
assertAboutImmutableObjects()
|
||||||
@@ -267,9 +267,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
.setName("Jim Doe")
|
.setName("Jim Doe")
|
||||||
.setEmailAddress("jim.doe@example.com")
|
.setEmailAddress("jim.doe@example.com")
|
||||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build(),
|
.build(),
|
||||||
"id");
|
"id");
|
||||||
}
|
}
|
||||||
@@ -282,16 +282,16 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testDelete_failsOnDomainWhoisAbuseContact() {
|
void testDelete_failsOnDomainRdapAbuseContact() {
|
||||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().getFirst();
|
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().getFirst();
|
||||||
persistResource(registrarPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
|
persistResource(registrarPoc.asBuilder().setVisibleInDomainRdapAsAbuse(true).build());
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
() ->
|
() ->
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--mode=DELETE", "--email=janedoe@theregistrar.com", "NewRegistrar"));
|
"--mode=DELETE", "--email=janedoe@theregistrar.com", "NewRegistrar"));
|
||||||
assertThat(thrown).hasMessageThat().contains("Cannot delete the domain WHOIS abuse contact");
|
assertThat(thrown).hasMessageThat().contains("Cannot delete the domain RDAP abuse contact");
|
||||||
assertThat(loadRegistrar("NewRegistrar").getContacts()).isNotEmpty();
|
assertThat(loadRegistrar("NewRegistrar").getContacts()).isNotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_allowedTlds() throws Exception {
|
void testSuccess_allowedTlds() throws Exception {
|
||||||
persistWhoisAbuseContact();
|
persistRdapAbuseContact();
|
||||||
createTlds("xn--q9jyb4c", "foobar");
|
createTlds("xn--q9jyb4c", "foobar");
|
||||||
persistResource(
|
persistResource(
|
||||||
loadRegistrar("NewRegistrar")
|
loadRegistrar("NewRegistrar")
|
||||||
@@ -126,7 +126,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_addAllowedTlds() throws Exception {
|
void testSuccess_addAllowedTlds() throws Exception {
|
||||||
persistWhoisAbuseContact();
|
persistRdapAbuseContact();
|
||||||
createTlds("xn--q9jyb4c", "foo", "bar");
|
createTlds("xn--q9jyb4c", "foo", "bar");
|
||||||
persistResource(
|
persistResource(
|
||||||
loadRegistrar("NewRegistrar")
|
loadRegistrar("NewRegistrar")
|
||||||
@@ -144,7 +144,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_addAllowedTldsWithDupes() throws Exception {
|
void testSuccess_addAllowedTldsWithDupes() throws Exception {
|
||||||
persistWhoisAbuseContact();
|
persistRdapAbuseContact();
|
||||||
createTlds("xn--q9jyb4c", "foo", "bar");
|
createTlds("xn--q9jyb4c", "foo", "bar");
|
||||||
persistResource(
|
persistResource(
|
||||||
loadRegistrar("NewRegistrar")
|
loadRegistrar("NewRegistrar")
|
||||||
@@ -968,11 +968,11 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
|||||||
.isEqualTo("Provided email lolcat is not a valid email address");
|
.isEqualTo("Provided email lolcat is not a valid email address");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void persistWhoisAbuseContact() {
|
private void persistRdapAbuseContact() {
|
||||||
persistResource(
|
persistResource(
|
||||||
JpaTransactionManagerExtension.makeRegistrarContact1()
|
JpaTransactionManagerExtension.makeRegistrarContact1()
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class ConsoleUpdateRegistrarActionTest extends ConsoleActionBaseTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFails_missingWhoisContact() throws IOException {
|
void testFails_missingRdapContact() throws IOException {
|
||||||
RegistryEnvironment.PRODUCTION.setup(systemPropertyExtension);
|
RegistryEnvironment.PRODUCTION.setup(systemPropertyExtension);
|
||||||
var action =
|
var action =
|
||||||
createAction(
|
createAction(
|
||||||
@@ -148,11 +148,11 @@ class ConsoleUpdateRegistrarActionTest extends ConsoleActionBaseTestCase {
|
|||||||
action.run();
|
action.run();
|
||||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||||
assertThat((String) response.getPayload())
|
assertThat((String) response.getPayload())
|
||||||
.contains("Cannot modify allowed TLDs if there is no WHOIS abuse contact set");
|
.contains("Cannot modify allowed TLDs if there is no RDAP abuse contact set");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_presentWhoisContact() throws IOException {
|
void testSuccess_presentRdapContact() throws IOException {
|
||||||
RegistryEnvironment.PRODUCTION.setup(systemPropertyExtension);
|
RegistryEnvironment.PRODUCTION.setup(systemPropertyExtension);
|
||||||
RegistrarPoc contact =
|
RegistrarPoc contact =
|
||||||
new RegistrarPoc.Builder()
|
new RegistrarPoc.Builder()
|
||||||
@@ -162,9 +162,9 @@ class ConsoleUpdateRegistrarActionTest extends ConsoleActionBaseTestCase {
|
|||||||
.setPhoneNumber("+1.9999999999")
|
.setPhoneNumber("+1.9999999999")
|
||||||
.setFaxNumber("+1.9999999991")
|
.setFaxNumber("+1.9999999991")
|
||||||
.setTypes(ImmutableSet.of(WHOIS))
|
.setTypes(ImmutableSet.of(WHOIS))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setVisibleInDomainWhoisAsAbuse(true)
|
.setVisibleInDomainRdapAsAbuse(true)
|
||||||
.build();
|
.build();
|
||||||
persistResource(contact);
|
persistResource(contact);
|
||||||
var action =
|
var action =
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
package google.registry.ui.server.console.settings;
|
package google.registry.ui.server.console.settings;
|
||||||
|
|
||||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.model.registrar.RegistrarPoc.Type.ABUSE;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ABUSE;
|
||||||
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
|
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
|
||||||
@@ -63,8 +62,8 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
+ "\"emailAddress\":\"test.registrar1@example.com\","
|
+ "\"emailAddress\":\"test.registrar1@example.com\","
|
||||||
+ "\"registrarId\":\"registrarId\","
|
+ "\"registrarId\":\"registrarId\","
|
||||||
+ "\"phoneNumber\":\"+1.9999999999\",\"faxNumber\":\"+1.9999999991\","
|
+ "\"phoneNumber\":\"+1.9999999999\",\"faxNumber\":\"+1.9999999991\","
|
||||||
+ "\"types\":[\"ADMIN\"],\"visibleInWhoisAsAdmin\":true,"
|
+ "\"types\":[\"ADMIN\"],\"visibleInRdapAsAdmin\":true,"
|
||||||
+ "\"visibleInWhoisAsTech\":false,\"visibleInDomainWhoisAsAbuse\":false}";
|
+ "\"visibleInRdapAsTech\":false,\"visibleInDomainRdapAsAbuse\":false}";
|
||||||
|
|
||||||
private Registrar testRegistrar;
|
private Registrar testRegistrar;
|
||||||
private RegistrarPoc adminPoc;
|
private RegistrarPoc adminPoc;
|
||||||
@@ -83,17 +82,17 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
.setPhoneNumber("+1.9999999999")
|
.setPhoneNumber("+1.9999999999")
|
||||||
.setFaxNumber("+1.9999999991")
|
.setFaxNumber("+1.9999999991")
|
||||||
.setTypes(ImmutableSet.of(ADMIN))
|
.setTypes(ImmutableSet.of(ADMIN))
|
||||||
.setVisibleInWhoisAsAdmin(true)
|
.setVisibleInRdapAsAdmin(true)
|
||||||
.setVisibleInWhoisAsTech(false)
|
.setVisibleInRdapAsTech(false)
|
||||||
.setVisibleInDomainWhoisAsAbuse(false)
|
.setVisibleInDomainRdapAsAbuse(false)
|
||||||
.build());
|
.build());
|
||||||
techPoc =
|
techPoc =
|
||||||
adminPoc
|
adminPoc
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setName("Test Registrar 2")
|
.setName("Test Registrar 2")
|
||||||
.setTypes(ImmutableSet.of(TECH))
|
.setTypes(ImmutableSet.of(TECH))
|
||||||
.setVisibleInWhoisAsTech(true)
|
.setVisibleInRdapAsTech(true)
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInRdapAsAdmin(false)
|
||||||
.setEmailAddress("test.registrar2@example.com")
|
.setEmailAddress("test.registrar2@example.com")
|
||||||
.setPhoneNumber("+1.1234567890")
|
.setPhoneNumber("+1.1234567890")
|
||||||
.setFaxNumber("+1.1234567891")
|
.setFaxNumber("+1.1234567891")
|
||||||
@@ -103,7 +102,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setName("Test Registrar 3")
|
.setName("Test Registrar 3")
|
||||||
.setTypes(ImmutableSet.of(MARKETING))
|
.setTypes(ImmutableSet.of(MARKETING))
|
||||||
.setVisibleInWhoisAsAdmin(false)
|
.setVisibleInRdapAsAdmin(false)
|
||||||
.setEmailAddress("test.registrar3@example.com")
|
.setEmailAddress("test.registrar3@example.com")
|
||||||
.setPhoneNumber("+1.1238675309")
|
.setPhoneNumber("+1.1238675309")
|
||||||
.setFaxNumber("+1.1238675309")
|
.setFaxNumber("+1.1238675309")
|
||||||
@@ -137,8 +136,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
assertThat(
|
assertThat(
|
||||||
loadAllOf(RegistrarPoc.class).stream()
|
loadAllOf(RegistrarPoc.class).stream()
|
||||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||||
.map(r -> r.getName())
|
.map(r -> r.getName()))
|
||||||
.collect(toImmutableList()))
|
|
||||||
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,8 +181,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
assertThat(
|
assertThat(
|
||||||
loadAllOf(RegistrarPoc.class).stream()
|
loadAllOf(RegistrarPoc.class).stream()
|
||||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||||
.map(r -> r.getName())
|
.map(r -> r.getName()))
|
||||||
.collect(toImmutableList()))
|
|
||||||
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,8 +198,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
assertThat(response.getPayload()).isEqualTo("Must have at least one primary contact");
|
assertThat(response.getPayload()).isEqualTo("Must have at least one primary contact");
|
||||||
assertThat(
|
assertThat(
|
||||||
loadAllOf(RegistrarPoc.class).stream()
|
loadAllOf(RegistrarPoc.class).stream()
|
||||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId())))
|
||||||
.collect(toImmutableList()))
|
|
||||||
.containsExactly(adminPoc);
|
.containsExactly(adminPoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,42 +221,40 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
|||||||
.isEqualTo("Please provide a phone number for at least one technical contact");
|
.isEqualTo("Please provide a phone number for at least one technical contact");
|
||||||
assertThat(
|
assertThat(
|
||||||
loadAllOf(RegistrarPoc.class).stream()
|
loadAllOf(RegistrarPoc.class).stream()
|
||||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId())))
|
||||||
.collect(toImmutableList()))
|
|
||||||
.containsExactly(adminPoc);
|
.containsExactly(adminPoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_postUpdateContactInfo_whoisContactMissingPhoneNumber() throws IOException {
|
void testFailure_postUpdateContactInfo_rdapContactMissingPhoneNumber() throws IOException {
|
||||||
ContactAction action =
|
ContactAction action =
|
||||||
createAction(
|
createAction(
|
||||||
Action.Method.POST,
|
Action.Method.POST,
|
||||||
fteUser,
|
fteUser,
|
||||||
testRegistrar.getRegistrarId(),
|
testRegistrar.getRegistrarId(),
|
||||||
techPoc.asBuilder().setPhoneNumber(null).setVisibleInDomainWhoisAsAbuse(true).build());
|
techPoc.asBuilder().setPhoneNumber(null).setVisibleInDomainRdapAsAbuse(true).build());
|
||||||
action.run();
|
action.run();
|
||||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||||
assertThat(response.getPayload())
|
assertThat(response.getPayload())
|
||||||
.isEqualTo("The abuse contact visible in domain WHOIS query must have a phone number");
|
.isEqualTo("The abuse contact visible in domain RDAP query must have a phone number");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_postUpdateContactInfo_whoisContactPhoneNumberRemoved() throws IOException {
|
void testFailure_postUpdateContactInfo_rdapContactPhoneNumberRemoved() throws IOException {
|
||||||
adminPoc = persistResource(adminPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
|
adminPoc = persistResource(adminPoc.asBuilder().setVisibleInDomainRdapAsAbuse(true).build());
|
||||||
ContactAction action =
|
ContactAction action =
|
||||||
createAction(
|
createAction(
|
||||||
Action.Method.PUT,
|
Action.Method.PUT,
|
||||||
fteUser,
|
fteUser,
|
||||||
testRegistrar.getRegistrarId(),
|
testRegistrar.getRegistrarId(),
|
||||||
adminPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build());
|
adminPoc.asBuilder().setVisibleInDomainRdapAsAbuse(false).build());
|
||||||
action.run();
|
action.run();
|
||||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||||
assertThat(response.getPayload())
|
assertThat(response.getPayload())
|
||||||
.isEqualTo("An abuse contact visible in domain WHOIS query must be designated");
|
.isEqualTo("An abuse contact visible in domain RDAP query must be designated");
|
||||||
assertThat(
|
assertThat(
|
||||||
loadAllOf(RegistrarPoc.class).stream()
|
loadAllOf(RegistrarPoc.class).stream()
|
||||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId())))
|
||||||
.collect(toImmutableList()))
|
|
||||||
.containsExactly(adminPoc);
|
.containsExactly(adminPoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,19 +285,16 @@ by admin fte@email.tld:
|
|||||||
contacts:
|
contacts:
|
||||||
ADDED:
|
ADDED:
|
||||||
{id=5, name=Test Registrar 2, emailAddress=incorrect@example.com, registrarId=registrarId, \
|
{id=5, name=Test Registrar 2, emailAddress=incorrect@example.com, registrarId=registrarId, \
|
||||||
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInWhoisAsAdmin=false, \
|
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInRdapAsAdmin=false, \
|
||||||
visibleInWhoisAsTech=true, visibleInDomainWhoisAsAbuse=false, \
|
visibleInRdapAsTech=true, visibleInDomainRdapAsAbuse=false}
|
||||||
allowedToSetRegistryLockPassword=false}
|
|
||||||
REMOVED:
|
REMOVED:
|
||||||
{id=5, name=Test Registrar 2, emailAddress=test.registrar2@example.com, \
|
{id=5, name=Test Registrar 2, emailAddress=test.registrar2@example.com, \
|
||||||
registrarId=registrarId, phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], \
|
registrarId=registrarId, phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], \
|
||||||
visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=true, visibleInDomainWhoisAsAbuse=false, \
|
visibleInRdapAsAdmin=false, visibleInRdapAsTech=true, visibleInDomainRdapAsAbuse=false}
|
||||||
allowedToSetRegistryLockPassword=false}
|
|
||||||
FINAL CONTENTS:
|
FINAL CONTENTS:
|
||||||
{id=5, name=Test Registrar 2, emailAddress=incorrect@example.com, registrarId=registrarId, \
|
{id=5, name=Test Registrar 2, emailAddress=incorrect@example.com, registrarId=registrarId, \
|
||||||
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInWhoisAsAdmin=false, \
|
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInRdapAsAdmin=false, \
|
||||||
visibleInWhoisAsTech=true, visibleInDomainWhoisAsAbuse=false, \
|
visibleInRdapAsTech=true, visibleInDomainRdapAsAbuse=false}
|
||||||
allowedToSetRegistryLockPassword=false}
|
|
||||||
""")
|
""")
|
||||||
.setRecipients(ImmutableList.of(new InternetAddress("notification@test.example")))
|
.setRecipients(ImmutableList.of(new InternetAddress("notification@test.example")))
|
||||||
.build());
|
.build());
|
||||||
@@ -319,8 +310,7 @@ allowedToSetRegistryLockPassword=false}
|
|||||||
assertThat(
|
assertThat(
|
||||||
loadAllOf(RegistrarPoc.class).stream()
|
loadAllOf(RegistrarPoc.class).stream()
|
||||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||||
.map(r -> r.getName())
|
.map(r -> r.getName()))
|
||||||
.collect(toImmutableList()))
|
|
||||||
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ td.section {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="property_name">generated on</td>
|
<td class="property_name">generated on</td>
|
||||||
<td class="property_value">2025-10-27 19:43:48</td>
|
<td class="property_value">2025-10-28 16:31:44</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="property_name">last flyway file</td>
|
<td class="property_name">last flyway file</td>
|
||||||
@@ -273,7 +273,7 @@ td.section {
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
<svg viewBox="0.00 0.00 4846.00 3765.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="erDiagram" style="overflow: hidden; width: 100%; height: 800px">
|
<svg viewBox="0.00 0.00 4846.00 3765.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="erDiagram" style="overflow: hidden; width: 100%; height: 800px">
|
||||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 3761)">
|
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 3761)">
|
||||||
<title>SchemaCrawler_Diagram</title> <polygon fill="white" stroke="transparent" points="-4,4 -4,-3761 4842,-3761 4842,4 -4,4" /> <text text-anchor="start" x="4598" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">generated by</text> <text text-anchor="start" x="4681" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">SchemaCrawler 16.27.1</text> <text text-anchor="start" x="4597" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">generated on</text> <text text-anchor="start" x="4681" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">2025-10-27 19:43:48</text> <polygon fill="none" stroke="#888888" points="4594,-4 4594,-44 4830,-44 4830,-4 4594,-4" /> <!-- allocationtoken_a08ccbef -->
|
<title>SchemaCrawler_Diagram</title> <polygon fill="white" stroke="transparent" points="-4,4 -4,-3761 4842,-3761 4842,4 -4,4" /> <text text-anchor="start" x="4598" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">generated by</text> <text text-anchor="start" x="4681" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">SchemaCrawler 16.27.1</text> <text text-anchor="start" x="4597" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">generated on</text> <text text-anchor="start" x="4681" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">2025-10-28 16:31:44</text> <polygon fill="none" stroke="#888888" points="4594,-4 4594,-44 4830,-44 4830,-4 4594,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||||
<g id="node1" class="node">
|
<g id="node1" class="node">
|
||||||
<title>allocationtoken_a08ccbef</title> <polygon fill="#e9c2f2" stroke="transparent" points="525.5,-1272 525.5,-1291 711.5,-1291 711.5,-1272 525.5,-1272" /> <text text-anchor="start" x="527.5" y="-1278.8" font-family="Helvetica,sans-Serif" font-weight="bold" font-style="italic" font-size="14.00">public."AllocationToken"</text> <polygon fill="#e9c2f2" stroke="transparent" points="711.5,-1272 711.5,-1291 785.5,-1291 785.5,-1272 711.5,-1272" /> <text text-anchor="start" x="746.5" y="-1277.8" font-family="Helvetica,sans-Serif" font-size="14.00">[table]</text> <text text-anchor="start" x="527.5" y="-1259.8" font-family="Helvetica,sans-Serif" font-weight="bold" font-style="italic" font-size="14.00">token</text> <text text-anchor="start" x="705.5" y="-1258.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1258.8" font-family="Helvetica,sans-Serif" font-size="14.00">text not null</text> <text text-anchor="start" x="527.5" y="-1239.8" font-family="Helvetica,sans-Serif" font-size="14.00">domain_name</text> <text text-anchor="start" x="705.5" y="-1239.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1239.8" font-family="Helvetica,sans-Serif" font-size="14.00">text</text> <text text-anchor="start" x="527.5" y="-1220.8" font-family="Helvetica,sans-Serif" font-size="14.00">redemption_domain_repo_id</text> <text text-anchor="start" x="705.5" y="-1220.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1220.8" font-family="Helvetica,sans-Serif" font-size="14.00">text</text> <text text-anchor="start" x="527.5" y="-1201.8" font-family="Helvetica,sans-Serif" font-size="14.00">token_type</text> <text text-anchor="start" x="705.5" y="-1201.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1201.8" font-family="Helvetica,sans-Serif" font-size="14.00">text</text> <polygon fill="none" stroke="#888888" points="524.5,-1195.5 524.5,-1292.5 786.5,-1292.5 786.5,-1195.5 524.5,-1195.5" />
|
<title>allocationtoken_a08ccbef</title> <polygon fill="#e9c2f2" stroke="transparent" points="525.5,-1272 525.5,-1291 711.5,-1291 711.5,-1272 525.5,-1272" /> <text text-anchor="start" x="527.5" y="-1278.8" font-family="Helvetica,sans-Serif" font-weight="bold" font-style="italic" font-size="14.00">public."AllocationToken"</text> <polygon fill="#e9c2f2" stroke="transparent" points="711.5,-1272 711.5,-1291 785.5,-1291 785.5,-1272 711.5,-1272" /> <text text-anchor="start" x="746.5" y="-1277.8" font-family="Helvetica,sans-Serif" font-size="14.00">[table]</text> <text text-anchor="start" x="527.5" y="-1259.8" font-family="Helvetica,sans-Serif" font-weight="bold" font-style="italic" font-size="14.00">token</text> <text text-anchor="start" x="705.5" y="-1258.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1258.8" font-family="Helvetica,sans-Serif" font-size="14.00">text not null</text> <text text-anchor="start" x="527.5" y="-1239.8" font-family="Helvetica,sans-Serif" font-size="14.00">domain_name</text> <text text-anchor="start" x="705.5" y="-1239.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1239.8" font-family="Helvetica,sans-Serif" font-size="14.00">text</text> <text text-anchor="start" x="527.5" y="-1220.8" font-family="Helvetica,sans-Serif" font-size="14.00">redemption_domain_repo_id</text> <text text-anchor="start" x="705.5" y="-1220.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1220.8" font-family="Helvetica,sans-Serif" font-size="14.00">text</text> <text text-anchor="start" x="527.5" y="-1201.8" font-family="Helvetica,sans-Serif" font-size="14.00">token_type</text> <text text-anchor="start" x="705.5" y="-1201.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text> <text text-anchor="start" x="713.5" y="-1201.8" font-family="Helvetica,sans-Serif" font-size="14.00">text</text> <polygon fill="none" stroke="#888888" points="524.5,-1195.5 524.5,-1292.5 786.5,-1292.5 786.5,-1195.5 524.5,-1195.5" />
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -683,7 +683,6 @@
|
|||||||
create table "RegistrarPoc" (
|
create table "RegistrarPoc" (
|
||||||
email_address text not null,
|
email_address text not null,
|
||||||
registrar_id text not null,
|
registrar_id text not null,
|
||||||
allowed_to_set_registry_lock_password boolean not null,
|
|
||||||
fax_number text,
|
fax_number text,
|
||||||
id bigint,
|
id bigint,
|
||||||
name text,
|
name text,
|
||||||
|
|||||||
Reference in New Issue
Block a user