QueryCaller

class QueryCaller @InternalWowApi constructor(val caller: Caller? = null, val entry: QueryEntry = QueryEntry.IN_PROCESS, val selection: FilterExpression = MatchAllFilter, val scope: QueryScope = QueryScope.NONE, val crossTenant: CrossTenant? = null, val targetScope: TargetScope? = null, val revealsDisplay: Boolean = false)

Who runs a query, and how: the explicit argument of every gateway operation and of QueryPolicy, in place of 9.x's Reactor ContextView. The identity is the Caller commands are admitted with: the HTTP edge resolves one per request and, for a Wow-Scope request, has QueryTargets decide the tenant and scope it acts in; the query adds only its execution context. In-process code passes IN_PROCESS.

  • caller: who; null for trusted in-process code, which is bound to no tenant, owner or space. Policies read it: ScopeQueryPolicy restricts a query to its tenant (through the host's TenantPolicy) and its scope.

  • entry: where the query came from, which picks its budget.

  • selection: what a route names in its URL (an aggregate id, a version range): an operation constraint, not caller scope. Admission appends it at step 2 with the scope, after every QueryFilter, so a rewrite can neither see nor remove it, and it is neither budgeted as scope nor reported among the audit's scope fields.

  • scope: the caller's scope as filters (tenant, owner, space) a trusted component stated, which admission step 2 appends to the query with what the policies add.

  • crossTenant: the tenants a cross-tenant query reads in place of the caller's own; see CrossTenant.

  • targetScope: the scope the request named (Wow-Scope), which QueryTargets admitted: the caller then already acts in it.

  • revealsDisplay: whether the query returns the raw value of a @Sensitive(DISPLAY) field, which every other query masks. Only code that asks in so many words sets it (TrustedQueries.revealed(), a subscription handler's revealed()), and only for itself: a caller with an end caller is refused at construction, so a query on behalf of a user never reveals, whoever relays it. A CONFIDENTIAL value is masked whatever it says, and so is a query issued from inside one (inProcess drops it).

An edge never decides the tenant, the scope or the cross-tenant reach itself: it builds the caller of a request through QueryTargets.of, the one home of those rules. The constructor that states the cross-tenant reach and the target is internal, and the engine checks both again for an HTTP caller (QueryTargets.recheck), so a caller built otherwise cannot reach further than QueryTargets lets it. Other code builds a plain caller with of, or uses IN_PROCESS.

Constructors

Link copied to clipboard
constructor(caller: Caller? = null, entry: QueryEntry = QueryEntry.IN_PROCESS, selection: FilterExpression = MatchAllFilter, scope: QueryScope = QueryScope.NONE, crossTenant: CrossTenant? = null, targetScope: TargetScope? = null, revealsDisplay: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The caller's attributes, which the application's policies may read; none in process.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The owner and space the caller acts in: ScopeQueryPolicy restricts its queries to each part present.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The caller's subject, for policies and audit; null for an anonymous or in-process caller.

Link copied to clipboard
Link copied to clipboard

The tenant the caller acts in; null for a query bound to no tenant, such as trusted in-process code, and for a crossTenant query, which ScopeQueryPolicy restricts to its tenants instead.

Functions

Link copied to clipboard
fun copy(caller: Caller? = this.caller, entry: QueryEntry = this.entry, selection: FilterExpression = this.selection, scope: QueryScope = this.scope, crossTenant: CrossTenant? = this.crossTenant, targetScope: TargetScope? = this.targetScope, revealsDisplay: Boolean = this.revealsDisplay): QueryCaller

This caller with the parts given replaced.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

The caller of a query issued from inside a query extension, a policy or a cache loader: trusted in-process code, IN_PROCESS. The caller, scope, route selection, cross-tenant reach, entry and revealsDisplay are all dropped, so an HTTP caller's budgets, tenant, scope and claims do not leak into a nested lookup, and a nested lookup masks what the query it serves reveals.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

This caller with scope appended to its scope.

Link copied to clipboard

This caller with a route selection appended; see selection.