1
0
mirror of https://github.com/google/nomulus synced 2026-04-24 02:00:50 +00:00

Allow superuser ext to override client/server transfer prohibited (#2890)

The superuser can remove/add those statuses anyway, so there's not
really any point. This also saves us trouble if we need to do a BTAPPA
transfer.
This commit is contained in:
gbrodman
2025-12-05 15:22:15 -05:00
committed by GitHub
parent f9cd167ae4
commit 0777be3d6c
2 changed files with 55 additions and 5 deletions

View File

@@ -1004,6 +1004,40 @@ class DomainTransferRequestFlowTest
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "5")));
}
@Test
void testSuccess_superuserExtension_clientTransferProhibited() throws Exception {
setupDomain("example", "tld");
eppRequestSource = EppRequestSource.TOOL;
domain =
persistResource(
domain.asBuilder().addStatusValue(StatusValue.CLIENT_TRANSFER_PROHIBITED).build());
doSuccessfulSuperuserExtensionTest(
"domain_transfer_request_superuser_extension.xml",
"domain_transfer_request_response_su_ext_zero_period_zero_transfer_length.xml",
domain.getRegistrationExpirationTime().plusYears(0),
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0"),
Optional.empty(),
Period.create(0, Unit.YEARS),
Duration.ZERO);
}
@Test
void testSuccess_superuserExtension_serverTransferProhibited() throws Exception {
setupDomain("example", "tld");
eppRequestSource = EppRequestSource.TOOL;
domain =
persistResource(
domain.asBuilder().addStatusValue(StatusValue.SERVER_TRANSFER_PROHIBITED).build());
doSuccessfulSuperuserExtensionTest(
"domain_transfer_request_superuser_extension.xml",
"domain_transfer_request_response_su_ext_zero_period_zero_transfer_length.xml",
domain.getRegistrationExpirationTime().plusYears(0),
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0"),
Optional.empty(),
Period.create(0, Unit.YEARS),
Duration.ZERO);
}
@Test
void testSuccess_cappedExpiration() throws Exception {
setupDomain("example", "tld");
@@ -1809,6 +1843,22 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains("pendingDelete");
}
@Test
void testFailure_pendingDelete_evenWhenSuperuser() {
setupDomain("example", "tld");
eppRequestSource = EppRequestSource.TOOL;
domain = persistResource(domain.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build());
ResourceStatusProhibitsOperationException thrown =
assertThrows(
ResourceStatusProhibitsOperationException.class,
() ->
runTest(
"domain_transfer_request_superuser_extension.xml",
UserPrivileges.SUPERUSER,
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0")));
assertThat(thrown).hasMessageThat().contains("pendingDelete");
}
@Test
void testIcannActivityReportField_getsLogged() throws Exception {
setupDomain("example", "tld");