IdentityResolver
The one place that decides the tenant, owner, space, aggregate ID and operator of a command or request, from hints tagged with their source. The HTTP adapter, the command factory (in-process CommandGateway callers) and saga-sent commands all resolve through it.
The rule, per fact:
The value is the first hint by source precedence: BODY, ROUTE, AUTH, HEADER, UPSTREAM. A caller passes only the hints its entry has, normalized as that entry always has (an HTTP header that is blank is no hint).
Since 9.3.0 (V3): for the tenant, owner and space, when the route or the authenticated principal fixes the value, a body or header hint with a different value is rejected with an IllegalArgumentException (
IllegalArgument,
instead of silently winning or being ignored. The same value is fine.
Functions
resolve for up to three hints, each given as its source and value (a null value is no hint), in that order. The same rule without allocating: the per-request paths (HTTP identity, toCommandMessage) use it.
The aggregate ID of resolveAggregateIdAndOwner, without the pair.
The owner of resolveAggregateIdAndOwner, given the aggregate ID resolveAggregateId returned.