mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Flatten the domain check flows
Also pull out a small bit of common functionality across contact and host checks. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133977324
This commit is contained in:
parent
b5e421cee3
commit
025a4ae012
7 changed files with 161 additions and 101 deletions
|
@ -39,6 +39,7 @@ import google.registry.flows.exceptions.ResourceStatusProhibitsOperationExceptio
|
|||
import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.flows.exceptions.TooManyResourceChecksException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.EppResource.Builder;
|
||||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
|
@ -316,13 +317,6 @@ public class ResourceFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** The specified resource belongs to another client. */
|
||||
public static class ResourceNotOwnedException extends AuthorizationErrorException {
|
||||
public ResourceNotOwnedException() {
|
||||
super("The specified resource belongs to another client");
|
||||
}
|
||||
}
|
||||
|
||||
/** Check that the given AuthInfo is either missing or else is valid for the given resource. */
|
||||
public static void verifyOptionalAuthInfoForResource(
|
||||
Optional<AuthInfo> authInfo, EppResource resource) throws EppException {
|
||||
|
@ -359,6 +353,21 @@ public class ResourceFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** Get the list of target ids from a check command. */
|
||||
public static void verifyTargetIdCount(List<String> targetIds, int maxChecks)
|
||||
throws TooManyResourceChecksException {
|
||||
if (targetIds.size() > maxChecks) {
|
||||
throw new TooManyResourceChecksException(maxChecks);
|
||||
}
|
||||
}
|
||||
|
||||
/** The specified resource belongs to another client. */
|
||||
public static class ResourceNotOwnedException extends AuthorizationErrorException {
|
||||
public ResourceNotOwnedException() {
|
||||
super("The specified resource belongs to another client");
|
||||
}
|
||||
}
|
||||
|
||||
/** Authorization information for accessing resource is invalid. */
|
||||
public static class BadAuthInfoForResourceException
|
||||
extends InvalidAuthorizationInformationErrorException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue