RouteCall

A call of a service route (me.ahoo.wow.api.annotation.ServiceRoute) as admission let it through: who calls, in which tenant and scope, under which request id, and the commands the handler may send and the queries it may run as that caller, in that tenant and scope. A handler sees no HTTP request, as a decide function sees none: it is tested by calling it with a call of its own.

A caller that may act across scopes, or any caller for a target the service reserves, names another tenant or scope in Wow-Scope, as on a command route: caller stays the caller in its own tenant and scope, and tenantId and scope are the ones it named.

Wow implements it and an application calls it: implementing it needs an opt-in to InternalWowApi, which an application does not give, so members may be added in a minor release. A test builds one with routeCall(...) of wow-test; a test that writes its own fake opts in with @OptIn(InternalWowApi::class) on its class, and breaks when Wow adds a member.

Properties

Link copied to clipboard
abstract val caller: Caller

Who calls: the authenticated caller, in its own tenant and scope whichever the call acts in. It says who, not where: a command client or a query API of the application's own given this caller (of(call.caller)) acts in the caller's own tenant and scope, not in tenantId and scope. A handler sends through commands and reads through queries, which act where the call acts.

Link copied to clipboard
abstract val commands: CommandClient

The commands the handler sends as caller, such as a relay of the caller's command to the service of it, in tenantId and scope. Admission records caller as their operator, in its own tenant, acting elsewhere when the call does; its right to act there, the platform tenant's backstop and the authorizers are asked of caller itself, for a command this node admits. A request that names a target of its own (me.ahoo.wow.api.client.CommandRequest.targetScope) replaces the tenant and the scope it names; what it leaves out stays the call's.

Link copied to clipboard
abstract val queries: Queries

The queries the handler runs as caller in tenantId and scope, the caller it acts for (me.ahoo.wow.api.read.QueryApi.of): what that caller may see there, of this node's models in process and of a peer's over HTTP, never more.

Link copied to clipboard
abstract val requestId: String

The request's id (Wow-Request-Id), or a new one.

Link copied to clipboard
abstract val scope: Scope

The scope the call acts in: the caller's own, or the one its Wow-Scope targets when it may act elsewhere.

Link copied to clipboard
abstract val tenantId: String

The tenant the call acts in: the caller's own, or the one its Wow-Scope targets when it may act elsewhere.