mirror of
https://github.com/google/nomulus
synced 2026-04-20 08:10:50 +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;
|
||||
faxNumber?: string;
|
||||
types: Array<contactType>;
|
||||
visibleInWhoisAsAdmin?: boolean;
|
||||
visibleInWhoisAsTech?: boolean;
|
||||
visibleInDomainWhoisAsAbuse?: boolean;
|
||||
visibleInRdapAsAdmin?: boolean;
|
||||
visibleInRdapAsTech?: boolean;
|
||||
visibleInDomainRdapAsAbuse?: boolean;
|
||||
}
|
||||
|
||||
export interface ViewReadyContact extends Contact {
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<h1>RDAP Preferences</h1>
|
||||
<div>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="contactService.contactInEdit.visibleInWhoisAsAdmin"
|
||||
[(ngModel)]="contactService.contactInEdit.visibleInRdapAsAdmin"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
>Show in Registrar RDAP record as admin contact</mat-checkbox
|
||||
>
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
<div>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="contactService.contactInEdit.visibleInWhoisAsTech"
|
||||
[(ngModel)]="contactService.contactInEdit.visibleInRdapAsTech"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
>Show in Registrar RDAP record as technical contact</mat-checkbox
|
||||
>
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
<div>
|
||||
<mat-checkbox
|
||||
[(ngModel)]="contactService.contactInEdit.visibleInDomainWhoisAsAbuse"
|
||||
[(ngModel)]="contactService.contactInEdit.visibleInDomainRdapAsAbuse"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
>Show Phone and Email in Domain RDAP Record as registrar abuse contact
|
||||
(per CL&D requirements)</mat-checkbox
|
||||
@@ -189,24 +189,24 @@
|
||||
<mat-list-item role="listitem">
|
||||
<h2>RDAP Preferences</h2>
|
||||
</mat-list-item>
|
||||
@if(contactService.contactInEdit.visibleInWhoisAsAdmin) {
|
||||
@if(contactService.contactInEdit.visibleInRdapAsAdmin) {
|
||||
<mat-divider></mat-divider>
|
||||
<mat-list-item role="listitem">
|
||||
<span class="console-app__list-value"
|
||||
>Show in Registrar RDAP record as admin contact</span
|
||||
>
|
||||
</mat-list-item>
|
||||
} @if(contactService.contactInEdit.visibleInWhoisAsTech) {
|
||||
} @if(contactService.contactInEdit.visibleInRdapAsTech) {
|
||||
<mat-divider></mat-divider>
|
||||
<mat-list-item
|
||||
role="listitem"
|
||||
*ngIf="contactService.contactInEdit.visibleInWhoisAsTech"
|
||||
*ngIf="contactService.contactInEdit.visibleInRdapAsTech"
|
||||
>
|
||||
<span class="console-app__list-value"
|
||||
>Show in Registrar RDAP record as technical contact</span
|
||||
>
|
||||
</mat-list-item>
|
||||
} @if(contactService.contactInEdit.visibleInDomainWhoisAsAbuse) {
|
||||
} @if(contactService.contactInEdit.visibleInDomainRdapAsAbuse) {
|
||||
<mat-divider></mat-divider>
|
||||
<mat-list-item role="listitem">
|
||||
<span class="console-app__list-value"
|
||||
|
||||
@@ -1556,12 +1556,7 @@ public final class RegistryConfig {
|
||||
return CONFIG_SETTINGS.get().gSuite.outgoingEmailDisplayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns default WHOIS server to use when {@code Registrar#getWhoisServer()} is {@code null}.
|
||||
*
|
||||
* @see "google.registry.whois.DomainWhoisResponse"
|
||||
* @see "google.registry.whois.RegistrarWhoisResponse"
|
||||
*/
|
||||
/** Returns default WHOIS server to use when {@code Registrar#getWhoisServer()} is null. */
|
||||
public static String getDefaultRegistrarWhoisServer() {
|
||||
return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarWhoisServer;
|
||||
}
|
||||
|
||||
@@ -128,10 +128,10 @@ class SyncRegistrarsSheet {
|
||||
builder.put("billingContacts", convertContacts(contacts, byType(BILLING)));
|
||||
builder.put(
|
||||
"contactsMarkedAsWhoisAdmin",
|
||||
convertContacts(contacts, RegistrarPoc::getVisibleInWhoisAsAdmin));
|
||||
convertContacts(contacts, RegistrarPoc::getVisibleInRdapAsAdmin));
|
||||
builder.put(
|
||||
"contactsMarkedAsWhoisTech",
|
||||
convertContacts(contacts, RegistrarPoc::getVisibleInWhoisAsTech));
|
||||
convertContacts(contacts, RegistrarPoc::getVisibleInRdapAsTech));
|
||||
builder.put("emailAddress", convert(registrar.getEmailAddress()));
|
||||
builder.put("address.street", convert(address.getStreet()));
|
||||
builder.put("address.city", convert(address.getCity()));
|
||||
|
||||
@@ -192,7 +192,7 @@ public class Registrar extends UpdateAutoTimestampEntity implements Buildable, J
|
||||
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
|
||||
* 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.
|
||||
@@ -416,13 +416,13 @@ public class Registrar extends UpdateAutoTimestampEntity implements Buildable, J
|
||||
String phonePasscode;
|
||||
|
||||
/**
|
||||
* A dirty bit for whether RegistrarContact changes have been made that haven't been synced to
|
||||
* Google Groups yet. When creating a new instance, contacts require syncing by default.
|
||||
* A dirty bit for whether RegistrarPoc changes have been made that haven't been synced to Google
|
||||
* Groups yet. When creating a new instance, contacts require syncing by default.
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
boolean contactsRequireSyncing = true;
|
||||
|
||||
/** Whether or not registry lock is allowed for this registrar. */
|
||||
/** Whether registry lock is allowed for this registrar. */
|
||||
@Column(nullable = false)
|
||||
@Expose
|
||||
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
|
||||
* if one does not exist.
|
||||
* Returns the {@link RegistrarPoc} that is the RDAP abuse contact for this registrar, or empty if
|
||||
* one does not exist.
|
||||
*/
|
||||
public Optional<RegistrarPoc> getWhoisAbuseContact() {
|
||||
return getContacts().stream().filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse).findFirst();
|
||||
public Optional<RegistrarPoc> getRdapAbuseContact() {
|
||||
return getContacts().stream().filter(RegistrarPoc::getVisibleInDomainRdapAsAbuse).findFirst();
|
||||
}
|
||||
|
||||
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
|
||||
* enable key equality.
|
||||
*
|
||||
* <p>IMPORTANT NOTE: Any time that you change, update, or delete RegistrarContact entities, you
|
||||
* *MUST* also modify the persisted Registrar entity with {@link Registrar#contactsRequireSyncing}
|
||||
* set to true.
|
||||
* <p>IMPORTANT NOTE: Any time that you change, update, or delete RegistrarPoc entities, you *MUST*
|
||||
* also modify the persisted Registrar entity with {@link Registrar#contactsRequireSyncing} set to
|
||||
* true.
|
||||
*/
|
||||
@Entity
|
||||
@IdClass(RegistrarPoc.RegistrarPocId.class)
|
||||
@@ -58,8 +58,8 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
||||
/**
|
||||
* 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
|
||||
* WHOIS or RDAP results.
|
||||
* <p><b>Note:</b> These types only matter to the registry. They are not meant to be used for RDAP
|
||||
* results.
|
||||
*/
|
||||
public enum Type {
|
||||
ABUSE("abuse", true),
|
||||
@@ -115,32 +115,23 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
||||
@Expose
|
||||
Set<Type> types;
|
||||
|
||||
/**
|
||||
* Whether this contact is publicly visible in WHOIS registrar query results as an Admin contact.
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
/** If this contact is publicly visible in RDAP registrar query results as an Admin contact */
|
||||
@Column(nullable = false, name = "visibleInWhoisAsAdmin")
|
||||
@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
|
||||
* contact.
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
@Expose
|
||||
boolean visibleInWhoisAsTech = false;
|
||||
|
||||
/**
|
||||
* Whether this contact's phone number and email address is publicly visible in WHOIS domain query
|
||||
* If this contact's phone number and email address are publicly visible in RDAP domain query
|
||||
* results as registrar abuse contact info.
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
@Column(nullable = false, name = "visibleInDomainWhoisAsAbuse")
|
||||
@Expose
|
||||
boolean visibleInDomainWhoisAsAbuse = false;
|
||||
|
||||
/** Legacy field, around until we can remove the non-null constraint and the column from SQL. */
|
||||
@Column(nullable = false)
|
||||
boolean allowedToSetRegistryLockPassword = false;
|
||||
boolean visibleInDomainRdapAsAbuse = false;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
public boolean getVisibleInWhoisAsAdmin() {
|
||||
return visibleInWhoisAsAdmin;
|
||||
public boolean getVisibleInRdapAsAdmin() {
|
||||
return visibleInRdapAsAdmin;
|
||||
}
|
||||
|
||||
public boolean getVisibleInWhoisAsTech() {
|
||||
return visibleInWhoisAsTech;
|
||||
public boolean getVisibleInRdapAsTech() {
|
||||
return visibleInRdapAsTech;
|
||||
}
|
||||
|
||||
public boolean getVisibleInDomainWhoisAsAbuse() {
|
||||
return visibleInDomainWhoisAsAbuse;
|
||||
public boolean getVisibleInDomainRdapAsAbuse() {
|
||||
return visibleInDomainRdapAsAbuse;
|
||||
}
|
||||
|
||||
public Builder asBuilder() {
|
||||
@@ -214,8 +205,8 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
||||
* person@example.com
|
||||
* Tel: +1.2125650666
|
||||
* Types: [ADMIN, WHOIS]
|
||||
* Visible in WHOIS as Admin contact: Yes
|
||||
* Visible in WHOIS as Technical contact: No
|
||||
* Visible in RDAP as Admin contact: Yes
|
||||
* Visible in RDAP as Technical contact: No
|
||||
* Registrar-Console access: Yes
|
||||
* Login Email Address: person@registry.example
|
||||
* }</pre>
|
||||
@@ -232,18 +223,18 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
||||
}
|
||||
result.append("Types: ").append(getTypes()).append('\n');
|
||||
result
|
||||
.append("Visible in registrar WHOIS query as Admin contact: ")
|
||||
.append(getVisibleInWhoisAsAdmin() ? "Yes" : "No")
|
||||
.append("Visible in registrar RDAP query as Admin contact: ")
|
||||
.append(getVisibleInRdapAsAdmin() ? "Yes" : "No")
|
||||
.append('\n');
|
||||
result
|
||||
.append("Visible in registrar WHOIS query as Technical contact: ")
|
||||
.append(getVisibleInWhoisAsTech() ? "Yes" : "No")
|
||||
.append("Visible in registrar RDAP query as Technical contact: ")
|
||||
.append(getVisibleInRdapAsTech() ? "Yes" : "No")
|
||||
.append('\n');
|
||||
result
|
||||
.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: ")
|
||||
.append(getVisibleInDomainWhoisAsAbuse() ? "Yes" : "No")
|
||||
.append(getVisibleInDomainRdapAsAbuse() ? "Yes" : "No")
|
||||
.append('\n');
|
||||
return result.toString();
|
||||
}
|
||||
@@ -256,9 +247,9 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
||||
.put("phoneNumber", phoneNumber)
|
||||
.put("faxNumber", faxNumber)
|
||||
.put("types", getTypes().stream().map(Object::toString).collect(joining(",")))
|
||||
.put("visibleInWhoisAsAdmin", visibleInWhoisAsAdmin)
|
||||
.put("visibleInWhoisAsTech", visibleInWhoisAsTech)
|
||||
.put("visibleInDomainWhoisAsAbuse", visibleInDomainWhoisAsAbuse)
|
||||
.put("visibleInRdapAsAdmin", visibleInRdapAsAdmin)
|
||||
.put("visibleInRdapAsTech", visibleInRdapAsTech)
|
||||
.put("visibleInDomainRdapAsAbuse", visibleInDomainRdapAsAbuse)
|
||||
.put("id", getId())
|
||||
.build();
|
||||
}
|
||||
@@ -336,18 +327,18 @@ public class RegistrarPoc extends ImmutableObject implements Jsonifiable, Unsafe
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setVisibleInWhoisAsAdmin(boolean visible) {
|
||||
getInstance().visibleInWhoisAsAdmin = visible;
|
||||
public Builder setVisibleInRdapAsAdmin(boolean visible) {
|
||||
getInstance().visibleInRdapAsAdmin = visible;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setVisibleInWhoisAsTech(boolean visible) {
|
||||
getInstance().visibleInWhoisAsTech = visible;
|
||||
public Builder setVisibleInRdapAsTech(boolean visible) {
|
||||
getInstance().visibleInRdapAsTech = visible;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setVisibleInDomainWhoisAsAbuse(boolean visible) {
|
||||
getInstance().visibleInDomainWhoisAsAbuse = visible;
|
||||
public Builder setVisibleInDomainRdapAsAbuse(boolean visible) {
|
||||
getInstance().visibleInDomainRdapAsAbuse = visible;
|
||||
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.
|
||||
*
|
||||
@@ -672,13 +672,13 @@ public class RdapJsonFormatter {
|
||||
*/
|
||||
private static ImmutableList<RdapEntity.Role> makeRdapRoleList(RegistrarPoc registrarPoc) {
|
||||
ImmutableList.Builder<RdapEntity.Role> rolesBuilder = new ImmutableList.Builder<>();
|
||||
if (registrarPoc.getVisibleInWhoisAsAdmin()) {
|
||||
if (registrarPoc.getVisibleInRdapAsAdmin()) {
|
||||
rolesBuilder.add(RdapEntity.Role.ADMIN);
|
||||
}
|
||||
if (registrarPoc.getVisibleInWhoisAsTech()) {
|
||||
if (registrarPoc.getVisibleInRdapAsTech()) {
|
||||
rolesBuilder.add(RdapEntity.Role.TECH);
|
||||
}
|
||||
if (registrarPoc.getVisibleInDomainWhoisAsAbuse()) {
|
||||
if (registrarPoc.getVisibleInDomainRdapAsAbuse()) {
|
||||
rolesBuilder.add(RdapEntity.Role.ABUSE);
|
||||
}
|
||||
return rolesBuilder.build();
|
||||
|
||||
@@ -226,7 +226,7 @@ public class Spec11EmailUtils {
|
||||
|
||||
private InternetAddress getEmailAddressForRegistrar(String registrarId)
|
||||
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.loadByRegistrarIdCached(registrarId)
|
||||
.orElseThrow(
|
||||
@@ -235,7 +235,7 @@ public class Spec11EmailUtils {
|
||||
String.format("Could not find registrar %s", registrarId)));
|
||||
return new InternetAddress(
|
||||
registrar
|
||||
.getWhoisAbuseContact()
|
||||
.getRdapAbuseContact()
|
||||
.map(RegistrarPoc::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."
|
||||
+ " Please create the registrar without allowed TLDs, then use `nomulus"
|
||||
+ " 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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -103,28 +103,27 @@ final class RegistrarPocCommand extends MutatingCommand {
|
||||
|
||||
@Nullable
|
||||
@Parameter(
|
||||
names = "--visible_in_whois_as_admin",
|
||||
description = " Whether this contact is publicly visible in WHOIS results as an "
|
||||
+ "Admin contact.",
|
||||
names = "--visible_in_rdap_as_admin",
|
||||
description = "If this contact is publicly visible in RDAP results as an " + "Admin contact.",
|
||||
arity = 1)
|
||||
private Boolean visibleInWhoisAsAdmin;
|
||||
private Boolean visibleInRdapAsAdmin;
|
||||
|
||||
@Nullable
|
||||
@Parameter(
|
||||
names = "--visible_in_whois_as_tech",
|
||||
description = " Whether this contact is publicly visible in WHOIS results as a "
|
||||
+ "Tech contact.",
|
||||
names = "--visible_in_rdap_as_tech",
|
||||
description = "If this contact is publicly visible in RDAP results as a " + "Tech contact.",
|
||||
arity = 1)
|
||||
private Boolean visibleInWhoisAsTech;
|
||||
private Boolean visibleInRdapAsTech;
|
||||
|
||||
@Nullable
|
||||
@Parameter(
|
||||
names = "--visible_in_domain_whois_as_abuse",
|
||||
description = " Whether this contact is publicly visible in WHOIS domain results as the "
|
||||
+ "registry abuse phone and email. If this flag is set, it will be cleared from all "
|
||||
+ "other contacts for the same registrar.",
|
||||
names = "--visible_in_domain_rdap_as_abuse",
|
||||
description =
|
||||
" Whether this contact is publicly visible in RDAP domain results as the "
|
||||
+ "registry abuse phone and email. If this flag is set, it will be cleared from all "
|
||||
+ "other contacts for the same registrar.",
|
||||
arity = 1)
|
||||
private Boolean visibleInDomainWhoisAsAbuse;
|
||||
private Boolean visibleInDomainRdapAsAbuse;
|
||||
|
||||
@Parameter(
|
||||
names = {"-o", "--output"},
|
||||
@@ -166,8 +165,8 @@ final class RegistrarPocCommand extends MutatingCommand {
|
||||
case LIST -> listContacts(contacts);
|
||||
case CREATE -> {
|
||||
stageEntityChange(null, createContact(registrar));
|
||||
if (visibleInDomainWhoisAsAbuse != null && visibleInDomainWhoisAsAbuse) {
|
||||
unsetOtherWhoisAbuseFlags(contacts, null);
|
||||
if (visibleInDomainRdapAsAbuse != null && visibleInDomainRdapAsAbuse) {
|
||||
unsetOtherRdapAbuseFlags(contacts, null);
|
||||
}
|
||||
}
|
||||
case UPDATE -> {
|
||||
@@ -178,13 +177,13 @@ final class RegistrarPocCommand extends MutatingCommand {
|
||||
email);
|
||||
RegistrarPoc newContact = updateContact(oldContact, registrar);
|
||||
checkArgument(
|
||||
!oldContact.getVisibleInDomainWhoisAsAbuse()
|
||||
|| newContact.getVisibleInDomainWhoisAsAbuse(),
|
||||
"Cannot clear visible_in_domain_whois_as_abuse flag, as that would leave no domain"
|
||||
+ " WHOIS abuse contacts; instead, set the flag on another contact");
|
||||
!oldContact.getVisibleInDomainRdapAsAbuse()
|
||||
|| newContact.getVisibleInDomainRdapAsAbuse(),
|
||||
"Cannot clear visible_in_domain_rdap_as_abuse flag, as that would leave no domain"
|
||||
+ " RDAP abuse contacts; instead, set the flag on another contact");
|
||||
stageEntityChange(oldContact, newContact);
|
||||
if (visibleInDomainWhoisAsAbuse != null && visibleInDomainWhoisAsAbuse) {
|
||||
unsetOtherWhoisAbuseFlags(contacts, oldContact.getEmailAddress());
|
||||
if (visibleInDomainRdapAsAbuse != null && visibleInDomainRdapAsAbuse) {
|
||||
unsetOtherRdapAbuseFlags(contacts, oldContact.getEmailAddress());
|
||||
}
|
||||
}
|
||||
case DELETE -> {
|
||||
@@ -194,8 +193,8 @@ final class RegistrarPocCommand extends MutatingCommand {
|
||||
"No contact with the given email: %s",
|
||||
email);
|
||||
checkArgument(
|
||||
!oldContact.getVisibleInDomainWhoisAsAbuse(),
|
||||
"Cannot delete the domain WHOIS abuse contact; set the flag on another contact first");
|
||||
!oldContact.getVisibleInDomainRdapAsAbuse(),
|
||||
"Cannot delete the domain RDAP abuse contact; set the flag on another contact first");
|
||||
stageEntityChange(oldContact, null);
|
||||
}
|
||||
default -> throw new AssertionError();
|
||||
@@ -228,14 +227,14 @@ final class RegistrarPocCommand extends MutatingCommand {
|
||||
}
|
||||
builder.setTypes(nullToEmpty(contactTypes));
|
||||
|
||||
if (visibleInWhoisAsAdmin != null) {
|
||||
builder.setVisibleInWhoisAsAdmin(visibleInWhoisAsAdmin);
|
||||
if (visibleInRdapAsAdmin != null) {
|
||||
builder.setVisibleInRdapAsAdmin(visibleInRdapAsAdmin);
|
||||
}
|
||||
if (visibleInWhoisAsTech != null) {
|
||||
builder.setVisibleInWhoisAsTech(visibleInWhoisAsTech);
|
||||
if (visibleInRdapAsTech != null) {
|
||||
builder.setVisibleInRdapAsTech(visibleInRdapAsTech);
|
||||
}
|
||||
if (visibleInDomainWhoisAsAbuse != null) {
|
||||
builder.setVisibleInDomainWhoisAsAbuse(visibleInDomainWhoisAsAbuse);
|
||||
if (visibleInDomainRdapAsAbuse != null) {
|
||||
builder.setVisibleInDomainRdapAsAbuse(visibleInDomainRdapAsAbuse);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
@@ -257,24 +256,24 @@ final class RegistrarPocCommand extends MutatingCommand {
|
||||
if (contactTypes != null) {
|
||||
builder.setTypes(contactTypes);
|
||||
}
|
||||
if (visibleInWhoisAsAdmin != null) {
|
||||
builder.setVisibleInWhoisAsAdmin(visibleInWhoisAsAdmin);
|
||||
if (visibleInRdapAsAdmin != null) {
|
||||
builder.setVisibleInRdapAsAdmin(visibleInRdapAsAdmin);
|
||||
}
|
||||
if (visibleInWhoisAsTech != null) {
|
||||
builder.setVisibleInWhoisAsTech(visibleInWhoisAsTech);
|
||||
if (visibleInRdapAsTech != null) {
|
||||
builder.setVisibleInRdapAsTech(visibleInRdapAsTech);
|
||||
}
|
||||
if (visibleInDomainWhoisAsAbuse != null) {
|
||||
builder.setVisibleInDomainWhoisAsAbuse(visibleInDomainWhoisAsAbuse);
|
||||
if (visibleInDomainRdapAsAbuse != null) {
|
||||
builder.setVisibleInDomainRdapAsAbuse(visibleInDomainRdapAsAbuse);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private void unsetOtherWhoisAbuseFlags(
|
||||
private void unsetOtherRdapAbuseFlags(
|
||||
ImmutableSet<RegistrarPoc> contacts, @Nullable String emailAddressNotToChange) {
|
||||
for (RegistrarPoc contact : contacts) {
|
||||
if (!contact.getEmailAddress().equals(emailAddressNotToChange)
|
||||
&& contact.getVisibleInDomainWhoisAsAbuse()) {
|
||||
RegistrarPoc newContact = contact.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build();
|
||||
&& contact.getVisibleInDomainRdapAsAbuse()) {
|
||||
RegistrarPoc newContact = contact.asBuilder().setVisibleInDomainRdapAsAbuse(false).build();
|
||||
stageEntityChange(contact, newContact);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ final class UpdateRegistrarCommand extends CreateOrUpdateRegistrarCommand {
|
||||
@Override
|
||||
void checkModifyAllowedTlds(@Nullable Registrar oldRegistrar) {
|
||||
// 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");
|
||||
|
||||
boolean isRealRegistrar =
|
||||
@@ -43,9 +43,9 @@ final class UpdateRegistrarCommand extends CreateOrUpdateRegistrarCommand {
|
||||
|| (Registrar.Type.REAL.equals(oldRegistrar.getType()) && registrarType == null);
|
||||
if (RegistryEnvironment.PRODUCTION.equals(RegistryEnvironment.get()) && isRealRegistrar) {
|
||||
checkArgumentPresent(
|
||||
oldRegistrar.getWhoisAbuseContact(),
|
||||
"Cannot modify allowed TLDs if there is no WHOIS abuse contact set. Please use the"
|
||||
+ " \"nomulus registrar_contact\" command on this registrar to set a WHOIS abuse"
|
||||
oldRegistrar.getRdapAbuseContact(),
|
||||
"Cannot modify allowed TLDs if there is no RDAP abuse contact set. Please use the"
|
||||
+ " \"nomulus registrar_contact\" command on this registrar to set an RDAP abuse"
|
||||
+ " contact.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,17 +79,17 @@ public class ConsoleUpdateRegistrarAction extends ConsoleApiAction {
|
||||
registrarParam.getRegistrarId());
|
||||
|
||||
// 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()) {
|
||||
boolean isRealRegistrar =
|
||||
Registrar.Type.REAL.equals(existingRegistrar.get().getType());
|
||||
if (RegistryEnvironment.PRODUCTION.equals(RegistryEnvironment.get())
|
||||
&& isRealRegistrar) {
|
||||
checkArgumentPresent(
|
||||
existingRegistrar.get().getWhoisAbuseContact(),
|
||||
"Cannot modify allowed TLDs if there is no WHOIS abuse contact set. Please"
|
||||
existingRegistrar.get().getRdapAbuseContact(),
|
||||
"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 contact.");
|
||||
+ " set a RDAP abuse contact.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,9 +106,9 @@ public class ContactAction extends ConsoleApiAction {
|
||||
new RegistrarPoc()
|
||||
.asBuilder()
|
||||
.setTypes(newContact.getTypes())
|
||||
.setVisibleInWhoisAsTech(newContact.getVisibleInWhoisAsTech())
|
||||
.setVisibleInWhoisAsAdmin(newContact.getVisibleInWhoisAsAdmin())
|
||||
.setVisibleInDomainWhoisAsAbuse(newContact.getVisibleInDomainWhoisAsAbuse())
|
||||
.setVisibleInRdapAsTech(newContact.getVisibleInRdapAsTech())
|
||||
.setVisibleInRdapAsAdmin(newContact.getVisibleInRdapAsAdmin())
|
||||
.setVisibleInDomainRdapAsAbuse(newContact.getVisibleInDomainRdapAsAbuse())
|
||||
.setFaxNumber(newContact.getFaxNumber())
|
||||
.setName(newContact.getName())
|
||||
.setEmailAddress(newContact.getEmailAddress())
|
||||
@@ -133,10 +133,10 @@ public class ContactAction extends ConsoleApiAction {
|
||||
? oldContact
|
||||
.asBuilder()
|
||||
.setTypes(updatedContact.getTypes())
|
||||
.setVisibleInWhoisAsTech(updatedContact.getVisibleInWhoisAsTech())
|
||||
.setVisibleInWhoisAsAdmin(updatedContact.getVisibleInWhoisAsAdmin())
|
||||
.setVisibleInDomainWhoisAsAbuse(
|
||||
updatedContact.getVisibleInDomainWhoisAsAbuse())
|
||||
.setVisibleInRdapAsTech(updatedContact.getVisibleInRdapAsTech())
|
||||
.setVisibleInRdapAsAdmin(updatedContact.getVisibleInRdapAsAdmin())
|
||||
.setVisibleInDomainRdapAsAbuse(
|
||||
updatedContact.getVisibleInDomainRdapAsAbuse())
|
||||
.setFaxNumber(updatedContact.getFaxNumber())
|
||||
.setName(updatedContact.getName())
|
||||
.setEmailAddress(updatedContact.getEmailAddress())
|
||||
@@ -231,19 +231,19 @@ public class ContactAction extends ConsoleApiAction {
|
||||
|
||||
enforcePrimaryContactRestrictions(oldContactsByType, newContactsByType);
|
||||
ensurePhoneNumberNotRemovedForContactTypes(oldContactsByType, newContactsByType, Type.TECH);
|
||||
Optional<RegistrarPoc> domainWhoisAbuseContact =
|
||||
getDomainWhoisVisibleAbuseContact(updatedContacts);
|
||||
// If the new set has a domain WHOIS abuse contact, it must have a phone number.
|
||||
if (domainWhoisAbuseContact.isPresent()
|
||||
&& domainWhoisAbuseContact.get().getPhoneNumber() == null) {
|
||||
Optional<RegistrarPoc> domainRdapAbuseContact =
|
||||
getDomainRdapVisibleAbuseContact(updatedContacts);
|
||||
// If the new set has a domain RDAP abuse contact, it must have a phone number.
|
||||
if (domainRdapAbuseContact.isPresent()
|
||||
&& domainRdapAbuseContact.get().getPhoneNumber() == null) {
|
||||
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 (getDomainWhoisVisibleAbuseContact(existingContacts).isPresent()
|
||||
&& domainWhoisAbuseContact.isEmpty()) {
|
||||
// If there was a domain RDAP abuse contact in the old set, the new set must have one.
|
||||
if (getDomainRdapVisibleAbuseContact(existingContacts).isPresent()
|
||||
&& domainRdapAbuseContact.isEmpty()) {
|
||||
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).
|
||||
*
|
||||
* <p>Frontend processing ensures that only one contact can be set as abuse contact in domain
|
||||
* WHOIS record.
|
||||
* <p>Frontend processing ensures that only one contact can be set as abuse contact in domain RDAP
|
||||
* record.
|
||||
*
|
||||
* <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) {
|
||||
return contacts.stream().filter(RegistrarPoc::getVisibleInDomainWhoisAsAbuse).findFirst();
|
||||
return contacts.stream().filter(RegistrarPoc::getVisibleInDomainRdapAsAbuse).findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -221,8 +221,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||
.setPhoneNumber("+1.3105551213")
|
||||
.setFaxNumber("+1.3105551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.build());
|
||||
persistResources(contacts);
|
||||
RuntimeException thrown =
|
||||
@@ -511,8 +511,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||
.setPhoneNumber("+1.3105551213")
|
||||
.setFaxNumber("+1.3105551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -529,8 +529,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||
.setPhoneNumber("+1.3105551213")
|
||||
.setFaxNumber("+1.3105551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -547,7 +547,7 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||
.setPhoneNumber("+1.3105551215")
|
||||
.setFaxNumber("+1.3105551216")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.build());
|
||||
persistResources(contacts);
|
||||
assertThat(action.getEmailAddresses(registrar, Type.TECH))
|
||||
|
||||
@@ -168,8 +168,8 @@ public class SyncRegistrarsSheetTest {
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||
// Purposely flip the internal/external admin/tech
|
||||
// distinction to make sure we're not relying on it. Sigh.
|
||||
.setVisibleInWhoisAsAdmin(false)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(false)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -201,9 +201,9 @@ public class SyncRegistrarsSheetTest {
|
||||
contact@example.com
|
||||
Tel: +1.1234567890
|
||||
Types: [ADMIN, BILLING]
|
||||
Visible in registrar WHOIS query as Admin contact: No
|
||||
Visible in registrar WHOIS query as Technical contact: No
|
||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
||||
Visible in registrar RDAP query as Admin contact: No
|
||||
Visible in registrar RDAP query as Technical contact: No
|
||||
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||
info: No
|
||||
|
||||
John Doe
|
||||
@@ -211,9 +211,9 @@ public class SyncRegistrarsSheetTest {
|
||||
Tel: +1.1234567890
|
||||
Fax: +1.1234567891
|
||||
Types: [ADMIN]
|
||||
Visible in registrar WHOIS query as Admin contact: No
|
||||
Visible in registrar WHOIS query as Technical contact: Yes
|
||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
||||
Visible in registrar RDAP query as Admin contact: No
|
||||
Visible in registrar RDAP query as Technical contact: Yes
|
||||
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||
info: No
|
||||
""");
|
||||
assertThat(row)
|
||||
@@ -223,9 +223,9 @@ public class SyncRegistrarsSheetTest {
|
||||
Jane Smith
|
||||
pride@example.net
|
||||
Types: [TECH]
|
||||
Visible in registrar WHOIS query as Admin contact: No
|
||||
Visible in registrar WHOIS query as Technical contact: No
|
||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
||||
Visible in registrar RDAP query as Admin contact: No
|
||||
Visible in registrar RDAP query as Technical contact: No
|
||||
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||
info: No
|
||||
""");
|
||||
assertThat(row).containsEntry("marketingContacts", "");
|
||||
@@ -240,9 +240,9 @@ public class SyncRegistrarsSheetTest {
|
||||
contact@example.com
|
||||
Tel: +1.1234567890
|
||||
Types: [ADMIN, BILLING]
|
||||
Visible in registrar WHOIS query as Admin contact: No
|
||||
Visible in registrar WHOIS query as Technical contact: No
|
||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
||||
Visible in registrar RDAP query as Admin contact: No
|
||||
Visible in registrar RDAP query as Technical contact: No
|
||||
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||
info: No
|
||||
""");
|
||||
assertThat(row).containsEntry("contactsMarkedAsWhoisAdmin", "");
|
||||
@@ -255,9 +255,9 @@ public class SyncRegistrarsSheetTest {
|
||||
Tel: +1.1234567890
|
||||
Fax: +1.1234567891
|
||||
Types: [ADMIN]
|
||||
Visible in registrar WHOIS query as Admin contact: No
|
||||
Visible in registrar WHOIS query as Technical contact: Yes
|
||||
Phone number and email visible in domain WHOIS query as Registrar Abuse contact\
|
||||
Visible in registrar RDAP query as Admin contact: No
|
||||
Visible in registrar RDAP query as Technical contact: Yes
|
||||
Phone number and email visible in domain RDAP query as Registrar Abuse contact\
|
||||
info: No
|
||||
""");
|
||||
assertThat(row).containsEntry("emailAddress", "nowhere@example.org");
|
||||
|
||||
@@ -126,8 +126,8 @@ class RegistrarTest extends EntityTestCase {
|
||||
.setRegistrar(registrar)
|
||||
.setName("John Abused")
|
||||
.setEmailAddress("johnabuse@example.com")
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.setPhoneNumber("+1.2125551213")
|
||||
.setFaxNumber("+1.2125551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ABUSE, RegistrarPoc.Type.ADMIN))
|
||||
@@ -323,8 +323,8 @@ class RegistrarTest extends EntityTestCase {
|
||||
.setRegistrar(registrar)
|
||||
.setName("Jake Tech")
|
||||
.setEmailAddress("jaketech@example.com")
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setPhoneNumber("+1.2125551213")
|
||||
.setFaxNumber("+1.2125551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||
@@ -335,8 +335,8 @@ class RegistrarTest extends EntityTestCase {
|
||||
.setRegistrar(registrar)
|
||||
.setName("Jim Tech-Abuse")
|
||||
.setEmailAddress("jimtechAbuse@example.com")
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setPhoneNumber("+1.2125551213")
|
||||
.setFaxNumber("+1.2125551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ABUSE))
|
||||
|
||||
@@ -407,8 +407,8 @@ public abstract class JpaTransactionManagerExtension
|
||||
return new RegistrarPoc.Builder()
|
||||
.setRegistrar(makeRegistrar1())
|
||||
.setName("Jane Doe")
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.setEmailAddress("janedoe@theregistrar.com")
|
||||
.setPhoneNumber("+1.1234567890")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||
|
||||
@@ -198,8 +198,8 @@ class RdapJsonFormatterTest {
|
||||
.setPhoneNumber("+1.2125551217")
|
||||
.setFaxNumber("+1.2125551218")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||
.setVisibleInWhoisAsAdmin(false)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(false)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -207,8 +207,8 @@ class RdapJsonFormatterTest {
|
||||
.setEmailAddress("johndoe@example.com")
|
||||
.setFaxNumber("+1.2125551213")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||
.setVisibleInWhoisAsAdmin(false)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(false)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -216,8 +216,8 @@ class RdapJsonFormatterTest {
|
||||
.setEmailAddress("janedoe@example.com")
|
||||
.setPhoneNumber("+1.2125551215")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ADMIN))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -226,8 +226,8 @@ class RdapJsonFormatterTest {
|
||||
.setPhoneNumber("+1.2125551217")
|
||||
.setFaxNumber("+1.2125551218")
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.BILLING))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
@@ -354,13 +354,13 @@ class Spec11EmailUtilsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_useWhoisAbuseEmailIfAvailable() throws Exception {
|
||||
// if John Doe is the whois abuse contact, email them instead of the regular email
|
||||
void testSuccess_useRdapAbuseEmailIfAvailable() throws Exception {
|
||||
// if John Doe is the RDAP abuse contact, email them instead of the regular email
|
||||
persistResource(
|
||||
makeRegistrarContact2()
|
||||
.asBuilder()
|
||||
.setEmailAddress("johndoe@theregistrar.com")
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
emailUtils.emailSpec11Reports(
|
||||
date,
|
||||
|
||||
@@ -53,9 +53,9 @@ class RegistrarPocTest {
|
||||
.setPhoneNumber("+1.2125650000")
|
||||
.setFaxNumber("+1.2125650001")
|
||||
.setTypes(ImmutableSet.of(WHOIS))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInDomainWhoisAsAbuse(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.setVisibleInDomainRdapAsAbuse(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ import java.util.Optional;
|
||||
import javax.annotation.Nullable;
|
||||
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 static Registrar makeRegistrar(
|
||||
@@ -100,8 +100,8 @@ public final class FullFieldsTestEntityHelper {
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
|
||||
// Purposely flip the internal/external admin/tech
|
||||
// distinction to make sure we're not relying on it. Sigh.
|
||||
.setVisibleInWhoisAsAdmin(false)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(false)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -112,8 +112,8 @@ public final class FullFieldsTestEntityHelper {
|
||||
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
|
||||
// Purposely flip the internal/external admin/tech
|
||||
// distinction to make sure we're not relying on it. Sigh.
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.build(),
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
@@ -121,7 +121,7 @@ public final class FullFieldsTestEntityHelper {
|
||||
.setEmailAddress("jakedoe@example.com")
|
||||
.setPhoneNumber("+1.2125551216")
|
||||
.setFaxNumber("+1.2125551216")
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setName("John Doe")
|
||||
.setEmailAddress("john.doe@example.com")
|
||||
.setTypes(ImmutableSet.of(ADMIN))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.build())));
|
||||
runCommandForced("--mode=LIST", "--output=" + output, "NewRegistrar");
|
||||
assertThat(Files.readAllLines(Paths.get(output), UTF_8))
|
||||
@@ -67,9 +67,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
"John Doe",
|
||||
"john.doe@example.com",
|
||||
"Types: [ADMIN]",
|
||||
"Visible in registrar WHOIS query as Admin contact: Yes",
|
||||
"Visible in registrar WHOIS query as Technical contact: No",
|
||||
"Phone number and email visible in domain WHOIS query as "
|
||||
"Visible in registrar RDAP query as Admin contact: Yes",
|
||||
"Visible in registrar RDAP query as Technical contact: No",
|
||||
"Phone number and email visible in domain RDAP query as "
|
||||
+ "Registrar Abuse contact info: No");
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setName("Judith Doe")
|
||||
.setEmailAddress("judith.doe@example.com")
|
||||
.setTypes(ImmutableSet.of(WHOIS))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInDomainWhoisAsAbuse(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setVisibleInDomainRdapAsAbuse(false)
|
||||
.build());
|
||||
persistResources(contacts);
|
||||
runCommandForced(
|
||||
@@ -95,9 +95,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
"--phone=+1.2125650000",
|
||||
"--fax=+1.2125650001",
|
||||
"--contact_type=WHOIS",
|
||||
"--visible_in_whois_as_admin=true",
|
||||
"--visible_in_whois_as_tech=false",
|
||||
"--visible_in_domain_whois_as_abuse=false",
|
||||
"--visible_in_rdap_as_admin=true",
|
||||
"--visible_in_rdap_as_tech=false",
|
||||
"--visible_in_domain_rdap_as_abuse=false",
|
||||
"NewRegistrar");
|
||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||
assertAboutImmutableObjects()
|
||||
@@ -110,15 +110,15 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setPhoneNumber("+1.2125650000")
|
||||
.setFaxNumber("+1.2125650001")
|
||||
.setTypes(ImmutableSet.of(WHOIS))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInDomainWhoisAsAbuse(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.setVisibleInDomainRdapAsAbuse(false)
|
||||
.build(),
|
||||
"id");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdate_unsetOtherWhoisAbuseFlags() throws Exception {
|
||||
void testUpdate_unsetOtherRdapAbuseFlags() throws Exception {
|
||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||
persistResource(
|
||||
new RegistrarPoc.Builder()
|
||||
@@ -131,33 +131,33 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setRegistrar(registrar)
|
||||
.setName("Johnna Doe")
|
||||
.setEmailAddress("johnna.doe@example.com")
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
runCommandForced(
|
||||
"--mode=UPDATE",
|
||||
"--email=john.doe@example.com",
|
||||
"--visible_in_domain_whois_as_abuse=true",
|
||||
"--visible_in_domain_rdap_as_abuse=true",
|
||||
"NewRegistrar");
|
||||
ImmutableList<RegistrarPoc> registrarPocs =
|
||||
loadRegistrar("NewRegistrar").getContacts().asList();
|
||||
for (RegistrarPoc registrarPoc : registrarPocs) {
|
||||
if ("John Doe".equals(registrarPoc.getName())) {
|
||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
||||
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse()).isTrue();
|
||||
} else {
|
||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isFalse();
|
||||
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse()).isFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdate_cannotUnsetOnlyWhoisAbuseContact() {
|
||||
void testUpdate_cannotUnsetOnlyRdapAbuseContact() {
|
||||
Registrar registrar = loadRegistrar("NewRegistrar");
|
||||
persistResource(
|
||||
new RegistrarPoc.Builder()
|
||||
.setRegistrar(registrar)
|
||||
.setName("John Doe")
|
||||
.setEmailAddress("john.doe@example.com")
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
@@ -166,13 +166,13 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
runCommandForced(
|
||||
"--mode=UPDATE",
|
||||
"--email=john.doe@example.com",
|
||||
"--visible_in_domain_whois_as_abuse=false",
|
||||
"--visible_in_domain_rdap_as_abuse=false",
|
||||
"NewRegistrar"));
|
||||
assertThat(thrown)
|
||||
.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);
|
||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
|
||||
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -187,9 +187,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setPhoneNumber("123-456-7890")
|
||||
.setFaxNumber("123-456-7890")
|
||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
runCommandForced("--mode=UPDATE", "--email=john.doe@example.com", "NewRegistrar");
|
||||
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.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
|
||||
assertThat(registrarPoc.getTypes()).isEqualTo(existingContact.getTypes());
|
||||
assertThat(registrarPoc.getVisibleInWhoisAsAdmin())
|
||||
.isEqualTo(existingContact.getVisibleInWhoisAsAdmin());
|
||||
assertThat(registrarPoc.getVisibleInWhoisAsTech())
|
||||
.isEqualTo(existingContact.getVisibleInWhoisAsTech());
|
||||
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse())
|
||||
.isEqualTo(existingContact.getVisibleInDomainWhoisAsAbuse());
|
||||
assertThat(registrarPoc.getVisibleInRdapAsAdmin())
|
||||
.isEqualTo(existingContact.getVisibleInRdapAsAdmin());
|
||||
assertThat(registrarPoc.getVisibleInRdapAsTech())
|
||||
.isEqualTo(existingContact.getVisibleInRdapAsTech());
|
||||
assertThat(registrarPoc.getVisibleInDomainRdapAsAbuse())
|
||||
.isEqualTo(existingContact.getVisibleInDomainRdapAsAbuse());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -217,9 +217,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setPhoneNumber("123-456-7890")
|
||||
.setFaxNumber("123-456-7890")
|
||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
runCommandForced(
|
||||
"--mode=UPDATE",
|
||||
@@ -254,9 +254,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
"--name=Jim Doe",
|
||||
"--email=jim.doe@example.com",
|
||||
"--contact_type=ADMIN,ABUSE",
|
||||
"--visible_in_whois_as_admin=true",
|
||||
"--visible_in_whois_as_tech=false",
|
||||
"--visible_in_domain_whois_as_abuse=true",
|
||||
"--visible_in_rdap_as_admin=true",
|
||||
"--visible_in_rdap_as_tech=false",
|
||||
"--visible_in_domain_rdap_as_abuse=true",
|
||||
"NewRegistrar");
|
||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
|
||||
assertAboutImmutableObjects()
|
||||
@@ -267,9 +267,9 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
.setName("Jim Doe")
|
||||
.setEmailAddress("jim.doe@example.com")
|
||||
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build(),
|
||||
"id");
|
||||
}
|
||||
@@ -282,16 +282,16 @@ class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDelete_failsOnDomainWhoisAbuseContact() {
|
||||
void testDelete_failsOnDomainRdapAbuseContact() {
|
||||
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().getFirst();
|
||||
persistResource(registrarPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
|
||||
persistResource(registrarPoc.asBuilder().setVisibleInDomainRdapAsAbuse(true).build());
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--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();
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
|
||||
@Test
|
||||
void testSuccess_allowedTlds() throws Exception {
|
||||
persistWhoisAbuseContact();
|
||||
persistRdapAbuseContact();
|
||||
createTlds("xn--q9jyb4c", "foobar");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
@@ -126,7 +126,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
|
||||
@Test
|
||||
void testSuccess_addAllowedTlds() throws Exception {
|
||||
persistWhoisAbuseContact();
|
||||
persistRdapAbuseContact();
|
||||
createTlds("xn--q9jyb4c", "foo", "bar");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
@@ -144,7 +144,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
|
||||
@Test
|
||||
void testSuccess_addAllowedTldsWithDupes() throws Exception {
|
||||
persistWhoisAbuseContact();
|
||||
persistRdapAbuseContact();
|
||||
createTlds("xn--q9jyb4c", "foo", "bar");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
@@ -968,11 +968,11 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
.isEqualTo("Provided email lolcat is not a valid email address");
|
||||
}
|
||||
|
||||
private void persistWhoisAbuseContact() {
|
||||
private void persistRdapAbuseContact() {
|
||||
persistResource(
|
||||
JpaTransactionManagerExtension.makeRegistrarContact1()
|
||||
.asBuilder()
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class ConsoleUpdateRegistrarActionTest extends ConsoleActionBaseTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFails_missingWhoisContact() throws IOException {
|
||||
void testFails_missingRdapContact() throws IOException {
|
||||
RegistryEnvironment.PRODUCTION.setup(systemPropertyExtension);
|
||||
var action =
|
||||
createAction(
|
||||
@@ -148,11 +148,11 @@ class ConsoleUpdateRegistrarActionTest extends ConsoleActionBaseTestCase {
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||
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
|
||||
void testSuccess_presentWhoisContact() throws IOException {
|
||||
void testSuccess_presentRdapContact() throws IOException {
|
||||
RegistryEnvironment.PRODUCTION.setup(systemPropertyExtension);
|
||||
RegistrarPoc contact =
|
||||
new RegistrarPoc.Builder()
|
||||
@@ -162,9 +162,9 @@ class ConsoleUpdateRegistrarActionTest extends ConsoleActionBaseTestCase {
|
||||
.setPhoneNumber("+1.9999999999")
|
||||
.setFaxNumber("+1.9999999991")
|
||||
.setTypes(ImmutableSet.of(WHOIS))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInDomainWhoisAsAbuse(true)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setVisibleInDomainRdapAsAbuse(true)
|
||||
.build();
|
||||
persistResource(contact);
|
||||
var action =
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
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 google.registry.model.registrar.RegistrarPoc.Type.ABUSE;
|
||||
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
|
||||
@@ -63,8 +62,8 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
||||
+ "\"emailAddress\":\"test.registrar1@example.com\","
|
||||
+ "\"registrarId\":\"registrarId\","
|
||||
+ "\"phoneNumber\":\"+1.9999999999\",\"faxNumber\":\"+1.9999999991\","
|
||||
+ "\"types\":[\"ADMIN\"],\"visibleInWhoisAsAdmin\":true,"
|
||||
+ "\"visibleInWhoisAsTech\":false,\"visibleInDomainWhoisAsAbuse\":false}";
|
||||
+ "\"types\":[\"ADMIN\"],\"visibleInRdapAsAdmin\":true,"
|
||||
+ "\"visibleInRdapAsTech\":false,\"visibleInDomainRdapAsAbuse\":false}";
|
||||
|
||||
private Registrar testRegistrar;
|
||||
private RegistrarPoc adminPoc;
|
||||
@@ -83,17 +82,17 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
||||
.setPhoneNumber("+1.9999999999")
|
||||
.setFaxNumber("+1.9999999991")
|
||||
.setTypes(ImmutableSet.of(ADMIN))
|
||||
.setVisibleInWhoisAsAdmin(true)
|
||||
.setVisibleInWhoisAsTech(false)
|
||||
.setVisibleInDomainWhoisAsAbuse(false)
|
||||
.setVisibleInRdapAsAdmin(true)
|
||||
.setVisibleInRdapAsTech(false)
|
||||
.setVisibleInDomainRdapAsAbuse(false)
|
||||
.build());
|
||||
techPoc =
|
||||
adminPoc
|
||||
.asBuilder()
|
||||
.setName("Test Registrar 2")
|
||||
.setTypes(ImmutableSet.of(TECH))
|
||||
.setVisibleInWhoisAsTech(true)
|
||||
.setVisibleInWhoisAsAdmin(false)
|
||||
.setVisibleInRdapAsTech(true)
|
||||
.setVisibleInRdapAsAdmin(false)
|
||||
.setEmailAddress("test.registrar2@example.com")
|
||||
.setPhoneNumber("+1.1234567890")
|
||||
.setFaxNumber("+1.1234567891")
|
||||
@@ -103,7 +102,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
||||
.asBuilder()
|
||||
.setName("Test Registrar 3")
|
||||
.setTypes(ImmutableSet.of(MARKETING))
|
||||
.setVisibleInWhoisAsAdmin(false)
|
||||
.setVisibleInRdapAsAdmin(false)
|
||||
.setEmailAddress("test.registrar3@example.com")
|
||||
.setPhoneNumber("+1.1238675309")
|
||||
.setFaxNumber("+1.1238675309")
|
||||
@@ -137,8 +136,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
||||
assertThat(
|
||||
loadAllOf(RegistrarPoc.class).stream()
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||
.map(r -> r.getName())
|
||||
.collect(toImmutableList()))
|
||||
.map(r -> r.getName()))
|
||||
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
||||
}
|
||||
|
||||
@@ -183,8 +181,7 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
||||
assertThat(
|
||||
loadAllOf(RegistrarPoc.class).stream()
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||
.map(r -> r.getName())
|
||||
.collect(toImmutableList()))
|
||||
.map(r -> r.getName()))
|
||||
.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(
|
||||
loadAllOf(RegistrarPoc.class).stream()
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||
.collect(toImmutableList()))
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId())))
|
||||
.containsExactly(adminPoc);
|
||||
}
|
||||
|
||||
@@ -225,42 +221,40 @@ class ContactActionTest extends ConsoleActionBaseTestCase {
|
||||
.isEqualTo("Please provide a phone number for at least one technical contact");
|
||||
assertThat(
|
||||
loadAllOf(RegistrarPoc.class).stream()
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||
.collect(toImmutableList()))
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId())))
|
||||
.containsExactly(adminPoc);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_postUpdateContactInfo_whoisContactMissingPhoneNumber() throws IOException {
|
||||
void testFailure_postUpdateContactInfo_rdapContactMissingPhoneNumber() throws IOException {
|
||||
ContactAction action =
|
||||
createAction(
|
||||
Action.Method.POST,
|
||||
fteUser,
|
||||
testRegistrar.getRegistrarId(),
|
||||
techPoc.asBuilder().setPhoneNumber(null).setVisibleInDomainWhoisAsAbuse(true).build());
|
||||
techPoc.asBuilder().setPhoneNumber(null).setVisibleInDomainRdapAsAbuse(true).build());
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||
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
|
||||
void testFailure_postUpdateContactInfo_whoisContactPhoneNumberRemoved() throws IOException {
|
||||
adminPoc = persistResource(adminPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
|
||||
void testFailure_postUpdateContactInfo_rdapContactPhoneNumberRemoved() throws IOException {
|
||||
adminPoc = persistResource(adminPoc.asBuilder().setVisibleInDomainRdapAsAbuse(true).build());
|
||||
ContactAction action =
|
||||
createAction(
|
||||
Action.Method.PUT,
|
||||
fteUser,
|
||||
testRegistrar.getRegistrarId(),
|
||||
adminPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build());
|
||||
adminPoc.asBuilder().setVisibleInDomainRdapAsAbuse(false).build());
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||
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(
|
||||
loadAllOf(RegistrarPoc.class).stream()
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||
.collect(toImmutableList()))
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId())))
|
||||
.containsExactly(adminPoc);
|
||||
}
|
||||
|
||||
@@ -291,19 +285,16 @@ by admin fte@email.tld:
|
||||
contacts:
|
||||
ADDED:
|
||||
{id=5, name=Test Registrar 2, emailAddress=incorrect@example.com, registrarId=registrarId, \
|
||||
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInWhoisAsAdmin=false, \
|
||||
visibleInWhoisAsTech=true, visibleInDomainWhoisAsAbuse=false, \
|
||||
allowedToSetRegistryLockPassword=false}
|
||||
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInRdapAsAdmin=false, \
|
||||
visibleInRdapAsTech=true, visibleInDomainRdapAsAbuse=false}
|
||||
REMOVED:
|
||||
{id=5, name=Test Registrar 2, emailAddress=test.registrar2@example.com, \
|
||||
registrarId=registrarId, phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], \
|
||||
visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=true, visibleInDomainWhoisAsAbuse=false, \
|
||||
allowedToSetRegistryLockPassword=false}
|
||||
visibleInRdapAsAdmin=false, visibleInRdapAsTech=true, visibleInDomainRdapAsAbuse=false}
|
||||
FINAL CONTENTS:
|
||||
{id=5, name=Test Registrar 2, emailAddress=incorrect@example.com, registrarId=registrarId, \
|
||||
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInWhoisAsAdmin=false, \
|
||||
visibleInWhoisAsTech=true, visibleInDomainWhoisAsAbuse=false, \
|
||||
allowedToSetRegistryLockPassword=false}
|
||||
phoneNumber=+1.1234567890, faxNumber=+1.1234567891, types=[TECH], visibleInRdapAsAdmin=false, \
|
||||
visibleInRdapAsTech=true, visibleInDomainRdapAsAbuse=false}
|
||||
""")
|
||||
.setRecipients(ImmutableList.of(new InternetAddress("notification@test.example")))
|
||||
.build());
|
||||
@@ -319,8 +310,7 @@ allowedToSetRegistryLockPassword=false}
|
||||
assertThat(
|
||||
loadAllOf(RegistrarPoc.class).stream()
|
||||
.filter(r -> r.registrarId.equals(testRegistrar.getRegistrarId()))
|
||||
.map(r -> r.getName())
|
||||
.collect(toImmutableList()))
|
||||
.map(r -> r.getName()))
|
||||
.containsExactly("Test Registrar 1", "Test Registrar 2");
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ td.section {
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
<td class="property_name">last flyway file</td>
|
||||
@@ -273,7 +273,7 @@ td.section {
|
||||
<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">
|
||||
<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">
|
||||
<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>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -683,7 +683,6 @@
|
||||
create table "RegistrarPoc" (
|
||||
email_address text not null,
|
||||
registrar_id text not null,
|
||||
allowed_to_set_registry_lock_password boolean not null,
|
||||
fax_number text,
|
||||
id bigint,
|
||||
name text,
|
||||
|
||||
Reference in New Issue
Block a user