Package-level declarations

Types

Link copied to clipboard
data class FactBinding(val source: RouteIdentitySource, val value: String? = null, val headers: List<String> = emptyList(), val derived: Boolean = false)

How a route takes one identity fact.

Link copied to clipboard
class IdentityHeaderAliases(val spaceId: List<String> = emptyList(), val requestId: List<String> = emptyList())

Further request headers the HTTP adapter reads for the space and the request ID, after Wow's own Wow-Space-Id and Command-Request-Id, in order. An integration (CoSec, say) contributes its headers here once instead of overriding the command builder extractor and the query request scope. Since 9.3.0.

Link copied to clipboard

The identity of one request to one aggregate's route: each fact (tenant, owner, aggregate ID, space, request ID) read where the route states it, by the same rules as the built-in command and query handlers (see RouteIdentityBinding), header aliases included. A custom handler reads identity through it, with ServerRequest.identity.

Link copied to clipboard
class RouteIdentity(val pathVariables: Set<String>, val aliases: IdentityHeaderAliases = IdentityHeaderAliases.NONE, aggregateRouteMetadata: AggregateRouteMetadata<*>? = null)

The identity side of one materialized route: its declared identity path variables, the header aliases, and, for a route of one aggregate, that aggregate's RouteIdentityBinding, computed once. Carried to the handlers as a request attribute; a handler of another aggregate (the command facade) gets a binding computed from the same path variables.

Link copied to clipboard
data class RouteIdentityBinding(val pathVariables: Set<String>, val tenantId: FactBinding, val ownerId: FactBinding, val aggregateId: FactBinding, val spaceId: FactBinding, val requestId: FactBinding, val spaceHeaders: List<String>)

Where one route takes each identity fact from, decided once from the route contract when the router is materialized: the path variables the contract declares, the aggregate's static tenant, ownership policy and space, and the header aliases. Each value is then decided by IdentityResolver, so the route, not each handler, states which source is authoritative:

Link copied to clipboard

Where a route takes one identity fact from.

Functions

Link copied to clipboard
fun ServerRequest.identity(aggregateMetadata: AggregateMetadata<*, *>): RequestIdentity

The identity this request states for the aggregate of aggregateMetadata.

fun ServerRequest.identity(aggregateRouteMetadata: AggregateRouteMetadata<*>): RequestIdentity

The identity this request states for the aggregate of aggregateRouteMetadata.