RouteIdentityBinding

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:

FactSource
tenantstatic tenant (the header is ignored) → {tenantId} → Command-Tenant-Id
owner{ownerId} → {id} when the owner is the aggregate ID → Command-Owner-Id
aggregate IDowner is the aggregate ID: {ownerId} → {id} → owner header → Command-Aggregate-Id; otherwise {id} → Command-Aggregate-Id
spacespaced aggregate only: Wow-Space-Id → space aliases
request IDCommand-Request-Id → request ID aliases

A declared path variable is authoritative: blank is rejected (400), and a header (or a command body, see RequestIdentity) contradicting a tenant or owner the path fixes is rejected (400, V3). A command body contradicting the static tenant is rejected too; a tenant header there is ignored, as before 9.3.0.

Constructors

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

Types

Link copied to clipboard

Properties

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

The space headers, read by the query scope, which applies its own space policy.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun aggregateId(request: ServerRequest): String?
Link copied to clipboard
fun ownerId(request: ServerRequest, body: String? = null): String?

The owner. A blank body states no owner when the owner is derived from {id} (as in 9.2, the command's owner is then its aggregate ID); against an owner the route states itself it is a conflict.

Link copied to clipboard
fun readOwnerId(request: ServerRequest): String?

The owner a read filters by: ownerId, except that an owner derived from {id} is not used (the aggregate ID already pins the row, and an aggregate created in-process may store a blank owner); a Command-Owner-Id that agrees with it still applies, as in 9.2.

Link copied to clipboard
fun requestId(request: ServerRequest): String?
Link copied to clipboard
fun requirePathVariables(request: ServerRequest)

Rejects a blank value of any identity path variable the route declares.

Link copied to clipboard
fun spaceId(request: ServerRequest): String?
Link copied to clipboard
fun spaceIdHeader(request: ServerRequest): String?
Link copied to clipboard
fun tenantId(request: ServerRequest, body: String? = null): String?