mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Standardize usage of some transfer flow verification helpers
We were using verifyHasPendingTransfer() only in the domain transfer flows; now we use it in both. I also added a helper verifyTransferInitiator() even though it's only used in two places (the transfer cancel flows), because I think it streamlines the flow and makes it more consistent with the whole section of verification checking. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150324823
This commit is contained in:
parent
7622e71dcf
commit
d8349aa0ee
5 changed files with 21 additions and 29 deletions
|
@ -41,6 +41,7 @@ import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
|||
import google.registry.flows.EppException.ParameterValueRangeErrorException;
|
||||
import google.registry.flows.exceptions.MissingTransferRequestAuthInfoException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.NotTransferInitiatorException;
|
||||
import google.registry.flows.exceptions.ResourceAlreadyExistsException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
||||
|
@ -288,6 +289,13 @@ public final class ResourceFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static <R extends EppResource & ResourceWithTransferData> void verifyTransferInitiator(
|
||||
String clientId, R resource) throws NotTransferInitiatorException {
|
||||
if (!resource.getTransferData().getGainingClientId().equals(clientId)) {
|
||||
throw new NotTransferInitiatorException();
|
||||
}
|
||||
}
|
||||
|
||||
public static <R extends EppResource & ForeignKeyedEppResource> R loadAndVerifyExistence(
|
||||
Class<R> clazz, String targetId, DateTime now)
|
||||
throws ResourceDoesNotExistException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue