Class PolicyEnforcementPoint
- Direct Known Subclasses:
ContextPolicyEnforcementPoint,InstancesPolicyEnforcementPoint,QueryTemplatePolicyEnforcementPoint,SystemPolicyEnforcementPoint,TypePolicyEnforcementPoint
A PEP is the single coupling point between the HTTP/REST layer and the role-agnostic backend Management classes. Each collection (Contexts, Types, Instances, Queries, …) has exactly one PEP subclass.
State and utilities shared across all PEPs:
getUriInfo()— the JAX-RSUriInfofor the current request, used to read query parameters and build response headers.isPrivilegedUser()— checks whether the current caller holds a globally-privileged role (IS-Manager or Infrastructure-Manager).
- Author:
- Luca Frosini (ISTI - CNR)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSpecification for an entire HTTP endpoint's policy.static classSpecification for query parameter authorization and validation.static enumDefines rules for binding the Context in the caller's JWT token to the target resource. -
Field Summary
FieldsModifier and TypeFieldDescriptionSet of all administrative roles (both global and subtree).Set of all operational roles in the system.static final StringRole constant representing the Context-Manager role.static final intDefault value for thedepthquery parameter (mirrorsContextPath.DEPTH_QUERY_PARAMETER_DEFAULT_READ_VALUE).Set of globally privileged administrative roles.static final StringRole constant representing the Infrastructure-Manager role.static final StringRole constant representing the IS-Admin role.static final StringRole constant representing the IS-Contributor role.static final StringRole constant representing the IS-Editor role.static final StringRole constant representing the IS-Manager role.static final StringRole constant representing the IS-Member role.static final StringLegacy query parameter kept for server-side operational compatibility only.static final StringLegacy query parameter kept for server-side operational compatibility only.static final intDefault value for thelimitpagination parameter (mirrorsInstancePath.LIMIT_QUERY_PARAMETER_DEFAULT_VALUE).static final intSystem-enforced maximum value for thelimitparameter (anti-DoS cap).static final intDefault value for theoffsetpagination parameter (mirrorsInstancePath.OFFSET_QUERY_PARAMETER_DEFAULT_VALUE).protected jakarta.ws.rs.container.ContainerRequestContextJAX-RS request context for the current request.Set of subtree administrative roles. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPolicyEnforcementPoint(jakarta.ws.rs.container.ContainerRequestContext requestContext) Creates a newPolicyEnforcementPointinstance for the current HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddContentWarning(ContentWarning warning) Adds a structured content warning produced by the Management/backend layer.protected voidAdds a structured ignored-fields-on-write warning (called internally by PEP subclasses after deserializing a write request body).protected voidRecords an RFC 8288Linkheader relation to be emitted on the response, perappendix/08-hateoas-navigation.md.protected voidaddPaginationLinks(PageResult page) Emits the standard RFC 8288 paginationLinkrelations for a paginated response, pointing at the current request path withlimit/offsetsubstituted.protected voidaddPreferenceApplied(org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn operationReturn) Records theOperationReturnpreference honored for the current request's Operation Envelope response.protected voidAdds a structured query-parameter warning (called internally byresolve*methods), also recording it on theContainerRequestContext"warnings" property from which the globalWarningResponseFilteremits it as anX-Warningresponse header.protected voidaddResultScope(org.gcube.informationsystem.resourceregistry.api.rest.ResultScope scope) Records that the response was affected by the givenResultScope(e.g. a hierarchical lookup succeeded via descendant expansion, or the response was role- or state-filtered).protected StringBuilds an absolute target URI by joining the current request's base URI with the given path segments, e.g.protected voidenforcePolicy(PolicyEnforcementPoint.EndpointPolicySpec policy, UUID targetUuid, UUID parentUuid) Enforces the endpoint-level and context-level authorization rules specified by the given policy specification, and automatically validates query parameters.protected voidenforceTargetContextWithinTokenSubtree(UUID targetContextUuid, String operationName) Enforces that the given target Context is either the caller's token Context itself or one of its descendants (the token Context's subtree is self-inclusive).Returns an aggregated, immutable view of all warnings accumulated during this request: query-parameter warnings first, content warnings second, ignored-fields warnings third.Returns the canonical URI recorded for this request's single-instance read, ornullif none was recorded (e.g. a List/Query response, or a write handled by the request-path-based fallback inContentLocationResponseFilter).Returns an immutable view of only the content warnings accumulated during this request.Returns an immutable view of only the ignored-fields-on-write warnings accumulated during this request.getLinks()Returns an immutable view of the Link relations accumulated during this request.org.gcube.informationsystem.resourceregistry.api.rest.OperationReturnReturns the operation-envelope return preference honored during this request, ornullif none was recorded.Returns an immutable view of only the query-parameter warnings accumulated during this request.Returns the resolved current Context path recorded during this request, ornullif none was recorded.Set<org.gcube.informationsystem.resourceregistry.api.rest.ResultScope>Returns an immutable view of the result scopes accumulated during this request.jakarta.ws.rs.core.UriInfoReturns the JAX-RSUriInfofor the current request.protected booleanReturnstrueif at least one descendant of the caller's current Context has aneffectiveStateother thanACTIVE.protected booleanReturnstrueif the current caller holds at least one administrative role (ALL_ADMIN_ROLES: IS-Manager, Infrastructure-Manager, IS-Admin, or Context-Manager).protected booleanReturnstrueif the current caller holds at least one globally-privileged role (IS-Manager or Infrastructure-Manager).protected booleanisUserAllowed(Set<String> allowedRoles) Helper method to check if the current user holds at least one of the allowed roles.protected booleanResolves theallMetaquery parameter from the current request.protected booleanresolveBoolean(String paramName, boolean defaultValue) Low-level helper: resolves a boolean query parameter with strict validation.protected booleanResolves thebypassHierarchyCheckquery parameter from the current request (admin add-to-context endpoint only).protected intResolves thedepthquery parameter from the current request.protected intresolveDepth(int defaultValue) Resolves thedepthquery parameter from the current request, falling back to an explicit caller-supplied default instead of the globalDEPTH_DEFAULT.protected booleanResolves thedryRunquery parameter from the current request.protected booleanResolves thehierarchicalquery parameter from the current request.protected booleanResolves theincludeContextsquery parameter from the current request.protected booleanResolves theincludeMetaquery parameter from the current request.protected intResolves thelimitpagination parameter from the current request.protected org.gcube.informationsystem.resourceregistry.api.rest.MetadataPolicyResolves metadata inclusion policy for the current request.protected intResolves theoffsetpagination parameter from the current request.protected booleanResolves thepolymorphicquery parameter from the current request.protected org.gcube.informationsystem.resourceregistry.api.rest.PropagationModeResolves thepropagationModequery parameter from the current request.protected booleanResolves therawResultquery parameter from the current request (raw-query endpoint only).protected booleanResolves thesyncExistingHierarchyquery parameter from the current request.protected UUIDResolves the Context UUID bound to the caller's authorization token.protected voidsetContentLocation(String targetUri) Records the canonical URI of the single-instance representation this request is about to return, forContentLocationResponseFilterto emit as theContent-Locationresponse header (RFC 9110 Section 8.7), per07-api-foundations-and-roles.md.protected voidsetResolvedContextPath(String path) Records the current path a caller'spreviousPaths-matched token resolved to, later emitted as theX-Resolved-Context-Pathresponse header.protected voidvalidateQueryParameters(Set<String> acceptedParams) Validates the query parameters of the current request against the given set of accepted parameter names and accumulates anIGNOREDwarning for any parameter that is not inacceptedParams.protected voidReports thatmetadataPolicy/includeContextswere requested but had no effect because the query's_emitprojection replaced the full instance representation with a flat, projection-only response (Canonical_emitPrecedence Rules,appendix/07-json-query-syntax-reference.md).
-
Field Details
-
IS_MANAGER
Role constant representing the IS-Manager role.- See Also:
-
INFRASTRUCTURE_MANAGER
Role constant representing the Infrastructure-Manager role.- See Also:
-
IS_ADMIN
Role constant representing the IS-Admin role.- See Also:
-
CONTEXT_MANAGER
Role constant representing the Context-Manager role.- See Also:
-
IS_EDITOR
Role constant representing the IS-Editor role.- See Also:
-
IS_CONTRIBUTOR
Role constant representing the IS-Contributor role.- See Also:
-
IS_MEMBER
Role constant representing the IS-Member role.- See Also:
-
GLOBAL_PRIVILEGED_ROLES
Set of globally privileged administrative roles. -
SUBTREE_ADMIN_ROLES
Set of subtree administrative roles. -
ALL_ADMIN_ROLES
Set of all administrative roles (both global and subtree). -
ALL_OPERATIONAL_ROLES
Set of all operational roles in the system. -
DEPTH_DEFAULT
public static final int DEPTH_DEFAULTDefault value for thedepthquery parameter (mirrorsContextPath.DEPTH_QUERY_PARAMETER_DEFAULT_READ_VALUE). -
LIMIT_DEFAULT
public static final int LIMIT_DEFAULTDefault value for thelimitpagination parameter (mirrorsInstancePath.LIMIT_QUERY_PARAMETER_DEFAULT_VALUE).- See Also:
-
LIMIT_MAX
public static final int LIMIT_MAXSystem-enforced maximum value for thelimitparameter (anti-DoS cap).- See Also:
-
OFFSET_DEFAULT
public static final int OFFSET_DEFAULTDefault value for theoffsetpagination parameter (mirrorsInstancePath.OFFSET_QUERY_PARAMETER_DEFAULT_VALUE).- See Also:
-
LEGACY_INCLUDE_META_QUERY_PARAMETER
Legacy query parameter kept for server-side operational compatibility only.- See Also:
-
LEGACY_ALL_META_QUERY_PARAMETER
Legacy query parameter kept for server-side operational compatibility only.- See Also:
-
requestContext
protected jakarta.ws.rs.container.ContainerRequestContext requestContextJAX-RS request context for the current request.
-
-
Constructor Details
-
PolicyEnforcementPoint
protected PolicyEnforcementPoint(jakarta.ws.rs.container.ContainerRequestContext requestContext) Creates a newPolicyEnforcementPointinstance for the current HTTP request.- Parameters:
requestContext- the JAX-RSContainerRequestContextfor the current request
-
-
Method Details
-
getUriInfo
public jakarta.ws.rs.core.UriInfo getUriInfo()Returns the JAX-RSUriInfofor the current request.- Returns:
- the request URI information
-
addQueryParameterWarning
Adds a structured query-parameter warning (called internally byresolve*methods), also recording it on theContainerRequestContext"warnings" property from which the globalWarningResponseFilteremits it as anX-Warningresponse header.- Parameters:
warning- the query-parameter warning to accumulate
-
addContentWarning
Adds a structured content warning produced by the Management/backend layer. Typically called by the PEP subclass after invoking a Management method, to propagate any backend warnings into the HTTP response.- Parameters:
warning- the content warning to accumulate
-
addIgnoredFieldsWarning
Adds a structured ignored-fields-on-write warning (called internally by PEP subclasses after deserializing a write request body).- Parameters:
warning- the ignored-fields warning to accumulate
-
getQueryParameterWarnings
Returns an immutable view of only the query-parameter warnings accumulated during this request.- Returns:
- immutable list of query-parameter warnings
-
getContentWarnings
Returns an immutable view of only the content warnings accumulated during this request.- Returns:
- immutable list of content warnings
-
getIgnoredFieldsWarnings
Returns an immutable view of only the ignored-fields-on-write warnings accumulated during this request.- Returns:
- immutable list of ignored-fields warnings
-
getAllWarnings
Returns an aggregated, immutable view of all warnings accumulated during this request: query-parameter warnings first, content warnings second, ignored-fields warnings third. This accessor is a convenience for tests and callers holding this PEP instance directly; the actualX-Warningresponse headers are emitted by the globalWarningResponseFilterfrom the same warnings, independently accumulated on the JAX-RSContainerRequestContext"warnings" property byaddQueryParameterWarning(org.gcube.informationsystem.resourceregistry.http.headers.warning.QueryParameterWarning),addContentWarning(org.gcube.informationsystem.resourceregistry.http.headers.warning.ContentWarning), andaddIgnoredFieldsWarning(org.gcube.informationsystem.resourceregistry.http.headers.warning.IgnoredFieldsWarning).- Returns:
- immutable list of all accumulated warnings
-
addResultScope
protected void addResultScope(org.gcube.informationsystem.resourceregistry.api.rest.ResultScope scope) Records that the response was affected by the givenResultScope(e.g. a hierarchical lookup succeeded via descendant expansion, or the response was role- or state-filtered). The REST layer emits these as a single combinedX-Result-Scoperesponse header viaResultScopeResponseFilter.- Parameters:
scope- the result scope to accumulate
-
getResultScopes
Returns an immutable view of the result scopes accumulated during this request.- Returns:
- immutable set of accumulated result scopes
-
addPreferenceApplied
protected void addPreferenceApplied(org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn operationReturn) Records theOperationReturnpreference honored for the current request's Operation Envelope response. The REST layer emits this as thePreference-Appliedresponse header viaPreferenceAppliedResponseFilter. UnlikeaddResultScope(ResultScope), this is a single value, not an accumulated set: exactly oneOperationReturnever applies per request.- Parameters:
operationReturn- the operation-return preference that was honored
-
getPreferenceApplied
public org.gcube.informationsystem.resourceregistry.api.rest.OperationReturn getPreferenceApplied()Returns the operation-envelope return preference honored during this request, ornullif none was recorded.- Returns:
- the honored operation-return preference, or
null
-
setResolvedContextPath
Records the current path a caller'spreviousPaths-matched token resolved to, later emitted as theX-Resolved-Context-Pathresponse header.- Parameters:
path- the resolved current Context path
-
getResolvedContextPath
Returns the resolved current Context path recorded during this request, ornullif none was recorded.- Returns:
- the resolved current Context path, or
null
-
addLink
Records an RFC 8288Linkheader relation to be emitted on the response, perappendix/08-hateoas-navigation.md. The REST layer never builds these headers itself: the response is finalized byLinkResponseFilter, mirroringaddResultScope(ResultScope)/addQueryParameterWarning(QueryParameterWarning).- Parameters:
rel- the link relation type (e.g."parent","collection","up")targetUri- the absolute target URI of the related resource
-
addPaginationLinks
Emits the standard RFC 8288 paginationLinkrelations for a paginated response, pointing at the current request path withlimit/offsetsubstituted.Emitted relations:
first(always),prev(whenoffset > 0),next(whenpage.hasNext()).- Parameters:
page- the paginated page result whoselimit/offset/hasNextdrive link computation
-
buildUri
Builds an absolute target URI by joining the current request's base URI with the given path segments, e.g.buildUri("contexts", parentUuid)yieldshttps://host/rest-path/contexts/<uuid>.- Parameters:
pathSegments- the path segments to append to the base URI, in order- Returns:
- the absolute URI string, or
nullif noUriInfois available
-
getLinks
Returns an immutable view of the Link relations accumulated during this request.- Returns:
- immutable list of accumulated Link relations
-
setContentLocation
Records the canonical URI of the single-instance representation this request is about to return, forContentLocationResponseFilterto emit as theContent-Locationresponse header (RFC 9110 Section 8.7), per07-api-foundations-and-roles.md.Only single-instance reads call this (Context/Type/Instance/Query Template
read()); aList/Queryresponse is a collection, not "the" representation of one URI, so it must never call this. Most callers simply pass their own request path back (the common case: the addressed URI already is the canonical one) - the one exception isContextPolicyEnforcementPoint.readCurrent(), which delegates toread(UUID)and therefore reports the resolved Context's own UUID-based URI, not the@currentalias the client actually requested.- Parameters:
targetUri- the absolute canonical URI of the returned representation
-
getContentLocation
Returns the canonical URI recorded for this request's single-instance read, ornullif none was recorded (e.g. a List/Query response, or a write handled by the request-path-based fallback inContentLocationResponseFilter).- Returns:
- the recorded canonical URI, or
null
-
isPrivilegedUser
protected boolean isPrivilegedUser()Returnstrueif the current caller holds at least one globally-privileged role (IS-Manager or Infrastructure-Manager).- Returns:
trueif the caller is globally privileged,falseotherwise
-
isAdministrativeUser
protected boolean isAdministrativeUser()Returnstrueif the current caller holds at least one administrative role (ALL_ADMIN_ROLES: IS-Manager, Infrastructure-Manager, IS-Admin, or Context-Manager).Broader than
isPrivilegedUser()(which only covers the two global roles). These roles already bypass the write-side operational lock on non-ACTIVEdescendant Contexts (per11-api-query-parameters.md's "Admin Overrides" row), so they must also see the unfiltered read view - a role that can write into a subtree it cannot read would be incoherent.- Returns:
trueif the caller is administrative,falseotherwise
-
isUserAllowed
Helper method to check if the current user holds at least one of the allowed roles.- Parameters:
allowedRoles- the set of allowed roles to check- Returns:
- true if the user has at least one of the roles, false otherwise
-
resolveTokenContextUuid
Resolves the Context UUID bound to the caller's authorization token.- Returns:
- the token's Context UUID, or
nullif it cannot be resolved
-
hasNonActiveDescendant
protected boolean hasNonActiveDescendant() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturnstrueif at least one descendant of the caller's current Context has aneffectiveStateother thanACTIVE. Used to decide whether a hierarchical read/query for a non-administrative caller should reportResultScope.STATE_FILTERED: this signals that the filtering mechanism was live for the request, not that a specific response actually excluded a row (the exclusion itself happens transparently at the permission layer, with no per-request signal of its own to check against).- Returns:
trueif a non-ACTIVEdescendant exists,falseotherwise- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the caller's current Context cannot be resolved
-
enforceTargetContextWithinTokenSubtree
Enforces that the given target Context is either the caller's token Context itself or one of its descendants (the token Context's subtree is self-inclusive).This check is a fail-closed Level 2 (Token Scope Binding) safeguard for endpoints whose target is a Context UUID that must be validated independently of any instance UUID also being enforced by
enforcePolicy(EndpointPolicySpec, UUID, UUID)(e.g. Add to Context, whosetargetUuidfor role/query-parameter enforcement is the instance being shared, not the destination Context).- Parameters:
targetContextUuid- the Context UUID to validate against the token's subtreeoperationName- the operation name to include in the rejection message- Throws:
jakarta.ws.rs.ForbiddenException- if the token Context cannot be resolved, or iftargetContextUuidlies outside the token Context's subtree
-
enforcePolicy
protected void enforcePolicy(PolicyEnforcementPoint.EndpointPolicySpec policy, UUID targetUuid, UUID parentUuid) Enforces the endpoint-level and context-level authorization rules specified by the given policy specification, and automatically validates query parameters.- Parameters:
policy- the policy specification to enforcetargetUuid- the UUID of the target resource, or null if noneparentUuid- the UUID of the parent resource (for PARENT scope checks), or null if none- Throws:
jakarta.ws.rs.ForbiddenException- if the caller lacks required roles or scope clearancejakarta.ws.rs.NotAuthorizedException- if the caller lacks parent context authorization
-
validateQueryParameters
Validates the query parameters of the current request against the given set of accepted parameter names and accumulates anIGNOREDwarning for any parameter that is not inacceptedParams.All unrecognised parameters are grouped into a single warning entry so that the caller receives one
X-Warningheader per validation call rather than one per stray parameter.This method is a no-op when
getUriInfo()isnull(e.g. in unit tests that invoke PEP methods directly without a JAX-RS context).- Parameters:
acceptedParams- the set of parameter names that are valid for the calling endpoint; all other parameters will be reported as ignored
-
resolveBoolean
Low-level helper: resolves a boolean query parameter with strict validation.Only
"true"and"false"(case-insensitive) are accepted as valid. Any other non-nullvalue emits aMODIFIEDwarning and falls back todefaultValue.Prefer the parameter-specific methods (
resolvePolymorphic(),resolveIncludeMeta(), …) over calling this directly.- Parameters:
paramName- the query parameter namedefaultValue- the value to return when the parameter is absent- Returns:
- the resolved boolean value
-
resolveLimit
protected int resolveLimit()Resolves thelimitpagination parameter from the current request.- Absent or
null→ returnsLIMIT_DEFAULT. -1or value>LIMIT_MAX→ clamped toLIMIT_MAXwith aMODIFIEDwarning ("Clamped to system maximum").0or value< -1→ invalid;MODIFIEDwarning, fallback toLIMIT_DEFAULT.- Non-integer string →
MODIFIEDwarning, fallback toLIMIT_DEFAULT. [1..LIMIT_MAX]→ returned as-is.
- Returns:
- the resolved limit, always in
[1..LIMIT_MAX]
- Absent or
-
resolveOffset
protected int resolveOffset()Resolves theoffsetpagination parameter from the current request.- Absent or
null→ returnsOFFSET_DEFAULT(0). - Valid integer
>= 0→ returned as-is. - Negative integer →
MODIFIEDwarning, fallback toOFFSET_DEFAULT. - Non-integer string →
MODIFIEDwarning, fallback toOFFSET_DEFAULT.
- Returns:
- the resolved offset, always
>= 0
- Absent or
-
resolvePolymorphic
protected boolean resolvePolymorphic()Resolves thepolymorphicquery parameter from the current request.Default:
true.- Returns:
- the resolved value
-
resolveDepth
protected int resolveDepth()Resolves thedepthquery parameter from the current request.- Absent or
null→ returnsDEPTH_DEFAULT. - Valid integer
>= -1→ returned as-is. - Integer
< -1→MODIFIEDwarning, fallback toDEPTH_DEFAULT. - Non-integer string →
MODIFIEDwarning, fallback toDEPTH_DEFAULT.
- Returns:
- the resolved depth, always
>= -1
- Absent or
-
resolveDepth
protected int resolveDepth(int defaultValue) Resolves thedepthquery parameter from the current request, falling back to an explicit caller-supplied default instead of the globalDEPTH_DEFAULT.Used by endpoints whose default differs from
DEPTH_DEFAULT(e.g.QUERY /types, which defaults to-1for polymorphic-equivalent matching, unlike the0default of the Read endpoints).- Parameters:
defaultValue- the depth to fall back to when absent or invalid- Returns:
- the resolved depth, always
>= -1
-
resolveHierarchical
protected boolean resolveHierarchical()Resolves thehierarchicalquery parameter from the current request.Default:
false.- Returns:
- the resolved value
-
resolveSyncExistingHierarchy
protected boolean resolveSyncExistingHierarchy()Resolves thesyncExistingHierarchyquery parameter from the current request.Default:
false. Mutually exclusive withhierarchical=true; the calling endpoint is responsible for enforcing that constraint.- Returns:
- the resolved value
-
resolvePropagationMode
protected org.gcube.informationsystem.resourceregistry.api.rest.PropagationMode resolvePropagationMode()Resolves thepropagationModequery parameter from the current request.Accepted values: the
PropagationModeenum constants (shallow,deep,surgical, case-insensitive). Any other string falls back toPropagationMode.DEFAULTwith aMODIFIEDwarning.Note: authorization checks (e.g. restricting
surgicalto global administrators) are NOT performed here; they must be enforced by the calling endpoint in the PEP subclass.- Returns:
- the resolved
PropagationMode, nevernull
-
resolveDryRun
protected boolean resolveDryRun()Resolves thedryRunquery parameter from the current request.Default:
false.- Returns:
- the resolved value
-
resolveIncludeMeta
protected boolean resolveIncludeMeta()Resolves theincludeMetaquery parameter from the current request.Default:
false.- Returns:
- the resolved value
-
resolveAllMeta
protected boolean resolveAllMeta()Resolves theallMetaquery parameter from the current request.Default:
false. RequiresincludeMeta=trueto have any effect; enforcement is the caller's responsibility.- Returns:
- the resolved value
-
resolveMetadataPolicy
protected org.gcube.informationsystem.resourceregistry.api.rest.MetadataPolicy resolveMetadataPolicy()Resolves metadata inclusion policy for the current request.Canonical parameter is
metadataPolicywith accepted valuesnone,root,all. Legacy parameters (includeMeta,allMeta) are accepted only for server-side operational compatibility and mapped to the canonical policy whenmetadataPolicyis not provided.- Canonical absent + includeMeta=false/absent + allMeta=false/absent ->
none - Canonical absent + includeMeta=true + allMeta=false/absent ->
root - Canonical absent + includeMeta=true + allMeta=true ->
all - Canonical absent + includeMeta=false/absent + allMeta=true ->
none(with warning)
When canonical
metadataPolicyis present, it has precedence; legacy parameters are ignored (with warning).- Returns:
- resolved
MetadataPolicy, nevernull
- Canonical absent + includeMeta=false/absent + allMeta=false/absent ->
-
resolveIncludeContexts
protected boolean resolveIncludeContexts()Resolves theincludeContextsquery parameter from the current request.Default:
false.- Returns:
- the resolved value
-
warnEnrichmentParametersIgnoredByEmitProjection
protected void warnEnrichmentParametersIgnoredByEmitProjection()Reports thatmetadataPolicy/includeContextswere requested but had no effect because the query's_emitprojection replaced the full instance representation with a flat, projection-only response (Canonical_emitPrecedence Rules,appendix/07-json-query-syntax-reference.md). MirrorsrawResult=true's equivalent warning for the admin raw-query endpoint.Shared by every query engine that executes an
_emit-capable JSON query (direct instance queries and Query Template execution), since the precedence rule is documented as applying uniformly across all of them. -
resolveRawResult
protected boolean resolveRawResult()Resolves therawResultquery parameter from the current request (raw-query endpoint only).Default:
false.- Returns:
- the resolved value
-
resolveBypassHierarchyCheck
protected boolean resolveBypassHierarchyCheck()Resolves thebypassHierarchyCheckquery parameter from the current request (admin add-to-context endpoint only).Default:
false. Authorization enforcement (IS-M / Infra-M only) is the caller's responsibility.- Returns:
- the resolved value
-