mirror of
https://github.com/google/nomulus
synced 2026-09-30 19:55:45 +00:00
Remove OT&E account creation domain restriction (#3242)
we implemented this in https://github.com/google/nomulus/pull/3178/ as part of the security changes but as it turns out, we'll still want to use @registry.google email addresses in sandbox as well
This commit is contained in:
@@ -64,7 +64,6 @@ public class ConsoleOteAction extends ConsoleApiAction {
|
||||
private final Optional<OteCreateData> oteCreateData;
|
||||
private final Optional<String> maybeGroupEmailAddress;
|
||||
private final Optional<String> consoleIapServiceId;
|
||||
private final String gSuiteDomainName;
|
||||
private final String registrarId;
|
||||
|
||||
@Inject
|
||||
@@ -75,7 +74,6 @@ public class ConsoleOteAction extends ConsoleApiAction {
|
||||
@Parameter("oteCreateData") Optional<OteCreateData> oteCreateData,
|
||||
@Config("gSuiteConsoleUserGroupEmailAddress") Optional<String> maybeGroupEmailAddress,
|
||||
@Config("consoleIapServiceId") Optional<String> consoleIapServiceId,
|
||||
@Config("gSuiteDomainName") String gSuiteDomainName,
|
||||
@Parameter("registrarId") String registrarId) {
|
||||
super(consoleApiParams);
|
||||
this.iamClient = iamClient;
|
||||
@@ -83,7 +81,6 @@ public class ConsoleOteAction extends ConsoleApiAction {
|
||||
this.oteCreateData = oteCreateData;
|
||||
this.maybeGroupEmailAddress = maybeGroupEmailAddress;
|
||||
this.consoleIapServiceId = consoleIapServiceId;
|
||||
this.gSuiteDomainName = gSuiteDomainName;
|
||||
this.registrarId = registrarId;
|
||||
}
|
||||
|
||||
@@ -101,10 +98,6 @@ public class ConsoleOteAction extends ConsoleApiAction {
|
||||
&& !this.oteCreateData.get().registrarId.isEmpty()
|
||||
&& !this.oteCreateData.get().registrarEmail.isEmpty();
|
||||
checkArgument(isBodyValid, "OT&E create body is invalid");
|
||||
checkArgument(
|
||||
this.oteCreateData.get().registrarEmail.endsWith("@" + gSuiteDomainName),
|
||||
"Email address must exist in the %s domain",
|
||||
gSuiteDomainName);
|
||||
|
||||
String password = passwordGenerator.createString(PASSWORD_LENGTH);
|
||||
|
||||
|
||||
@@ -203,24 +203,6 @@ class ConsoleOteActionTest extends ConsoleActionBaseTestCase {
|
||||
ImmutableList.of("domain creates idn", "domain restores", "host deletes"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_invalidEmailDomain() {
|
||||
AuthResult authResult = AuthResult.createUser(fteUser);
|
||||
consoleApiParams = ConsoleApiParamsUtils.createFake(authResult);
|
||||
ConsoleOteAction action =
|
||||
createAction(
|
||||
Action.Method.POST,
|
||||
authResult,
|
||||
"theregistrar",
|
||||
Optional.of("someRandomString@email.test"),
|
||||
Optional.of(new OteCreateData("theregistrar", "contact@invalid.com")));
|
||||
action.cloudTasksUtils = cloudTasksHelper.getTestCloudTasksUtils();
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(SC_BAD_REQUEST);
|
||||
assertThat(response.getPayload())
|
||||
.isEqualTo("Email address must exist in the registry.example domain");
|
||||
}
|
||||
|
||||
private ConsoleOteAction createAction(
|
||||
Action.Method method,
|
||||
AuthResult authResult,
|
||||
@@ -237,7 +219,6 @@ class ConsoleOteActionTest extends ConsoleActionBaseTestCase {
|
||||
oteCreateData,
|
||||
maybeGroupEmailAddress,
|
||||
Optional.of("consoleIapServiceId"),
|
||||
"registry.example",
|
||||
registrarId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user