mirror of
https://github.com/google/nomulus
synced 2026-04-11 20:17:22 +00:00
Break SessionSource out of SessionMetadata and rename it EppRequestSource.
The "SessionSource" has nothing to do with sessions (and it's often used in sessionless contexts). What it does indicate is the endpoint used to make the request. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125295224
This commit is contained in:
@@ -20,7 +20,6 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import com.googlecode.objectify.Key;
|
||||
|
||||
import google.registry.flows.EppException.AuthorizationErrorException;
|
||||
import google.registry.flows.SessionMetadata.SessionSource;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
@@ -124,8 +123,7 @@ public abstract class ResourceCreateOrMutateFlow
|
||||
|
||||
/** Ensure that, if a metadata command exists, it is being passed from a tool-created session. */
|
||||
void validateMetadataExtension() throws EppException {
|
||||
if (!(metadataExtension == null
|
||||
|| sessionMetadata.getSessionSource().equals(SessionSource.TOOL))) {
|
||||
if (!(metadataExtension == null || eppRequestSource.equals(EppRequestSource.TOOL))) {
|
||||
throw new OnlyToolCanPassMetadataException();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user