Include the registry lock email in the JS object as a sensitive field (#658)

* Include the registry lock email in the JS object as a sensitive field

* Change wording of exceptions to be more consistent
This commit is contained in:
gbrodman
2020-07-01 13:05:21 -04:00
committed by GitHub
parent a1da32bfde
commit 7f62b7a89c
6 changed files with 85 additions and 17 deletions
@@ -454,7 +454,13 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
.orElseThrow(
() ->
new FormException(
"Not allowed to set registry lock password directly on new contact"));
"Cannot set registry lock password directly on new contact"));
// Can't modify registry lock email address
if (!Objects.equals(
updatedContact.getRegistryLockEmailAddress(),
existingContact.getRegistryLockEmailAddress())) {
throw new FormException("Cannot modify registryLockEmailAddress through the UI");
}
if (updatedContact.isRegistryLockAllowed()) {
// the password must have been set before or the user was allowed to set it now
if (!existingContact.isAllowedToSetRegistryLockPassword()
@@ -464,7 +470,8 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
}
if (updatedContact.isAllowedToSetRegistryLockPassword()) {
if (!existingContact.isAllowedToSetRegistryLockPassword()) {
throw new FormException("Cannot set isAllowedToSetRegistryLockPassword through UI");
throw new FormException(
"Cannot modify isAllowedToSetRegistryLockPassword through the UI");
}
}
}
@@ -180,7 +180,8 @@ registry.json.RegistrarAddress;
* faxNumber: (string?|undefined),
* types: (string?|undefined),
* allowedToSetRegistryLockPassword: boolean,
* registryLockAllowed: boolean
* registryLockAllowed: boolean,
* registryLockEmailAddress: (string?|undefined)
* }}
*/
registry.json.RegistrarContact;
@@ -176,6 +176,10 @@
{if isNonnull($item['gaeUserId'])}
<input type="hidden" name="{$namePrefix}gaeUserId" value="{$item['gaeUserId']}">
{/if}
{if isNonnull($item['registryLockEmailAddress'])}
<input type="hidden" name="{$namePrefix}registryLockEmailAddress"
value="{$item['registryLockEmailAddress']}">
{/if}
</div>
{/template}