mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Set the registrar WHOIS email in the web console creation endpoint
We set the initial value to the "icann referral email", but registrars can change it later if they want. Although this value isn't strictly required, we assume it exists in the spec11 report. Also changed the name of the contact email from "email" to "consoleUserEmail" ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=235734200
This commit is contained in:
parent
92458f4363
commit
e9f2a49e9a
5 changed files with 35 additions and 26 deletions
|
@ -117,7 +117,7 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
@Inject @Parameter("ianaId") Optional<Integer> ianaId;
|
||||
@Inject @Parameter("referralEmail") Optional<String> referralEmail;
|
||||
@Inject @Parameter("driveId") Optional<String> driveId;
|
||||
@Inject @Parameter("email") Optional<String> email;
|
||||
@Inject @Parameter("consoleUserEmail") Optional<String> consoleUserEmail;
|
||||
|
||||
// Address fields, some of which are required and others are optional.
|
||||
@Inject @Parameter("street1") Optional<String> street1;
|
||||
|
@ -229,7 +229,7 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
checkPresent(ianaId, "ianaId");
|
||||
checkPresent(referralEmail, "referralEmail");
|
||||
checkPresent(driveId, "driveId");
|
||||
checkPresent(email, "email");
|
||||
checkPresent(consoleUserEmail, "consoleUserEmail");
|
||||
checkPresent(street1, "street");
|
||||
checkPresent(city, "city");
|
||||
checkPresent(countryCode, "countryCode");
|
||||
|
@ -240,7 +240,7 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
data.put("referralEmail", referralEmail.get());
|
||||
data.put("billingAccount", billingAccount.get());
|
||||
data.put("driveId", driveId.get());
|
||||
data.put("email", email.get());
|
||||
data.put("consoleUserEmail", consoleUserEmail.get());
|
||||
|
||||
data.put("street1", street1.get());
|
||||
optionalStreet2.ifPresent(street2 -> data.put("street2", street2));
|
||||
|
@ -252,9 +252,9 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
|
||||
String gaeUserId =
|
||||
checkNotNull(
|
||||
convertEmailAddressToGaeUserId(email.get()),
|
||||
convertEmailAddressToGaeUserId(consoleUserEmail.get()),
|
||||
"Email address %s is not associated with any GAE ID",
|
||||
email.get());
|
||||
consoleUserEmail.get());
|
||||
String password = optionalPassword.orElse(passwordGenerator.createString(PASSWORD_LENGTH));
|
||||
String phonePasscode =
|
||||
optionalPasscode.orElse(passcodeGenerator.createString(PASSCODE_LENGTH));
|
||||
|
@ -265,6 +265,7 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
.setBillingAccountMap(parseBillingAccount(billingAccount.get()))
|
||||
.setIanaIdentifier(Long.valueOf(ianaId.get()))
|
||||
.setIcannReferralEmail(referralEmail.get())
|
||||
.setEmailAddress(referralEmail.get())
|
||||
.setDriveFolderId(driveId.get())
|
||||
.setType(Registrar.Type.REAL)
|
||||
.setPassword(password)
|
||||
|
@ -286,8 +287,8 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
RegistrarContact contact =
|
||||
new RegistrarContact.Builder()
|
||||
.setParent(registrar)
|
||||
.setName(email.get())
|
||||
.setEmailAddress(email.get())
|
||||
.setName(consoleUserEmail.get())
|
||||
.setEmailAddress(consoleUserEmail.get())
|
||||
.setGaeUserId(gaeUserId)
|
||||
.build();
|
||||
ofy()
|
||||
|
@ -331,7 +332,7 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
data.put("ianaId", ianaId.orElse(null));
|
||||
data.put("referralEmail", referralEmail.orElse(null));
|
||||
data.put("driveId", driveId.orElse(null));
|
||||
data.put("email", email.orElse(null));
|
||||
data.put("consoleUserEmail", consoleUserEmail.orElse(null));
|
||||
|
||||
response.setPayload(
|
||||
TOFU_SUPPLIER
|
||||
|
@ -362,7 +363,8 @@ public final class ConsoleRegistrarCreatorAction implements Runnable {
|
|||
.append(toEmailLine(ianaId, "ianaId"))
|
||||
.append(toEmailLine(referralEmail, "referralEmail"))
|
||||
.append(toEmailLine(driveId, "driveId"))
|
||||
.append(String.format("Gave user %s web access to the registrar\n", email.get()));
|
||||
.append(
|
||||
String.format("Gave user %s web access to the registrar\n", consoleUserEmail.get()));
|
||||
sendEmailUtils.sendEmail(
|
||||
String.format("Registrar %s created in %s", clientId.get(), environment),
|
||||
builder.toString());
|
||||
|
|
|
@ -73,6 +73,12 @@ public final class RegistrarConsoleModule {
|
|||
return extractOptionalParameter(req, "referralEmail");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("consoleUserEmail")
|
||||
static Optional<String> provideOptionalConsoleUserEmail(HttpServletRequest req) {
|
||||
return extractOptionalParameter(req, "consoleUserEmail");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("email")
|
||||
static Optional<String> provideOptionalEmail(HttpServletRequest req) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue