CoSecCommandAuthorizer

class CoSecCommandAuthorizer(checker: AuthorizationChecker, defaultTenant: String = Caller.DEFAULT_TENANT) : CommandAuthorizer

Authorizes a command with CoSec's documents, as its caller: the command is the action <context>:<command> on the resource <aggregate>/<id> (CoSecActions), the name CoSec's route map gives its HTTP route, so one policy guards both. CoSec's checker evaluates it for the principal and scope of the request the caller comes from (CoSecRequest); a command it does not permit is denied.

A request-less caller, such as a saga's, a timer's, a compensation's or a scheduled job's command, which carries the scope and operator of the root command admission authorized, gets no objection: CoSec has no request of its to evaluate, and the node's other authorizers still apply. A caller of a request that is not the principal CoSec authenticated for it, which CoSec cannot evaluate, is denied, the operational commands included: one an application's CallerResolver mapped to another subject or tenant, or the anonymous one. On the public port CoSec's pipeline has already decided the command's route by the same action, so the host leaves this authorizer off unless wow.cosec.authorizer.enabled asks for it. It decides Wow's operational commands (decidesOperational): a policy grants their actions to the operators.

Constructors

Link copied to clipboard
constructor(checker: AuthorizationChecker, defaultTenant: String = Caller.DEFAULT_TENANT)

Properties

Link copied to clipboard
open override val decidesOperational: Boolean

CoSec's policies decide Wow's operational commands as they decide any action.

Functions

Link copied to clipboard
open suspend override fun authorize(caller: Caller, action: CommandAction): Authorization