mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Make host flows only accept canonicalized host names as input
This now throws errors when a non-lower-cased, non-puny-coded, or non-canonicalized host name is passed in as an input parameter. The approach we'll take is to first notify registrars which hosts we'll be renaming, then issue EPP host update commands to effect those renames as superuser, then push this code live to production. This fixes #38 on GitHub. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138441130
This commit is contained in:
parent
cbe76e8615
commit
9aa2f3b96e
12 changed files with 215 additions and 8 deletions
|
@ -16,6 +16,7 @@ package google.registry.flows.host;
|
|||
|
||||
import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.host.HostFlowUtils.validateHostName;
|
||||
import static google.registry.model.EppResourceUtils.cloneResourceWithLinkedStatus;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
|
@ -36,6 +37,9 @@ import org.joda.time.DateTime;
|
|||
* transfer if it has ever been transferred. Any registrar can see the information for any host.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link HostFlowUtils.HostNameNotLowerCaseException}
|
||||
* @error {@link HostFlowUtils.HostNameNotNormalizedException}
|
||||
* @error {@link HostFlowUtils.HostNameNotPunyCodedException}
|
||||
*/
|
||||
public final class HostInfoFlow implements Flow {
|
||||
|
||||
|
@ -49,7 +53,8 @@ public final class HostInfoFlow implements Flow {
|
|||
@Override
|
||||
public EppResponse run() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
validateClientIsLoggedIn(clientId);
|
||||
validateClientIsLoggedIn(clientId);
|
||||
validateHostName(targetId);
|
||||
DateTime now = clock.nowUtc();
|
||||
HostResource host = loadAndVerifyExistence(HostResource.class, targetId, now);
|
||||
return responseBuilder.setResData(cloneResourceWithLinkedStatus(host, now)).build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue