mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Enforce abuse WHOIS contact for REAL registrars when adding TLDs
We do not enforce this for non-REAL registrars or in any environment other than UNITTEST or PRODUCTION. This is similar but separate to [] since we can add allowed TLDs in either location. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=239510275
This commit is contained in:
parent
9bf6a860bb
commit
7ff6667bdf
6 changed files with 210 additions and 12 deletions
|
@ -258,6 +258,8 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
|||
@Nullable
|
||||
abstract Registrar getOldRegistrar(String clientId);
|
||||
|
||||
abstract void checkModifyAllowedTlds(@Nullable Registrar oldRegistrar);
|
||||
|
||||
protected void initRegistrarCommand() {}
|
||||
|
||||
@Override
|
||||
|
@ -300,9 +302,12 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
|||
if (driveFolderId != null) {
|
||||
builder.setDriveFolderId(driveFolderId.orElse(null));
|
||||
}
|
||||
if (!allowedTlds.isEmpty() || !addAllowedTlds.isEmpty()) {
|
||||
checkModifyAllowedTlds(oldRegistrar);
|
||||
}
|
||||
if (!allowedTlds.isEmpty()) {
|
||||
checkArgument(addAllowedTlds.isEmpty(),
|
||||
"Can't specify both --allowedTlds and --addAllowedTlds");
|
||||
checkArgument(
|
||||
addAllowedTlds.isEmpty(), "Can't specify both --allowedTlds and --addAllowedTlds");
|
||||
ImmutableSet.Builder<String> allowedTldsBuilder = new ImmutableSet.Builder<>();
|
||||
for (String allowedTld : allowedTlds) {
|
||||
allowedTldsBuilder.add(canonicalizeDomainName(allowedTld));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue