mirror of
https://github.com/google/nomulus
synced 2026-01-08 23:23:32 +00:00
Fix nits on flows:
Rename existingResource flows variable to be specific to EPP resource type and replace some explicit checks with helper methods. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133774229
This commit is contained in:
@@ -31,6 +31,7 @@ import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Work;
|
||||
import google.registry.flows.EppException.AuthorizationErrorException;
|
||||
import google.registry.flows.EppException.InvalidAuthorizationInformationErrorException;
|
||||
import google.registry.flows.exceptions.MissingTransferRequestAuthInfoException;
|
||||
import google.registry.flows.exceptions.ResourceAlreadyExistsException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
||||
@@ -314,6 +315,15 @@ public class ResourceFlowUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/** Check that the given AuthInfo is present and valid for a resource being transferred. */
|
||||
public static void verifyRequiredAuthInfoForResourceTransfer(
|
||||
Optional<AuthInfo> authInfo, ContactResource existingContact) throws EppException {
|
||||
if (!authInfo.isPresent()) {
|
||||
throw new MissingTransferRequestAuthInfoException();
|
||||
}
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingContact);
|
||||
}
|
||||
|
||||
/** Check that the given AuthInfo is valid for the given resource. */
|
||||
public static void verifyAuthInfoForResource(AuthInfo authInfo, EppResource resource)
|
||||
throws EppException {
|
||||
|
||||
Reference in New Issue
Block a user