Companion

object Companion

Properties

Link copied to clipboard

An unauthenticated caller: the default tenant, no scope, no subject.

Link copied to clipboard
const val APP: String

The standard attribute naming the caller's app.

Link copied to clipboard

The tenant of a principal that has none.

Link copied to clipboard

The platform's own tenant, reserved for the platform's callers, as CoSec reserves it: a platform role (PlatformRoles) counts only for a caller of this tenant, and a type fixed to it takes commands only from callers of this tenant and from the service's own code (#7346). It is not DEFAULT_TENANT.

Link copied to clipboard

The subject prefixes the framework reserves for its own (#7364): SERVICE_SUBJECT_PREFIX, a service identity, and Operator.SYSTEM_PREFIX, a framework component that issues a command on its own. A caller of a request that is not a service identity may not take one, in any letter case (reservedSubjectRefusal).

Link copied to clipboard
const val ROLES: String

The standard attribute listing the caller's roles.

Link copied to clipboard

The subject of a service identity: SERVICE_SUBJECT_PREFIX and the service's name.

Functions

Link copied to clipboard
fun of(tenantId: String = DEFAULT_TENANT, scope: Scope = Scope.NONE, subject: String? = null, crossScope: Boolean = false, attributes: Map<String, List<String>> = emptyMap(), service: Boolean = false, roles: Collection<String> = emptyList()): Caller

A Caller of the given fields; parameters added later come last, with a default. roles are its ROLES attribute (Caller.of(subject = "e1", roles = listOf("editor"))): given with attributes that name ROLES too, it fails, since the two would say different things.

Link copied to clipboard
fun ofService(name: String, tenantId: String = DEFAULT_TENANT): Caller

The service identity of the service named name in tenantId: what a service calls and reads another service as for a commit of its own (a saga's call, a subscription handler's read of a peer), and what that peer resolves from the service's name on its internal port.

Link copied to clipboard
fun owner(id: String, tenantId: String = DEFAULT_TENANT): Caller

The caller id of tenantId that owns what it acts on: its subject and the owner of its scope, as a principal signed in as an owner is resolved (Caller.owner("alice")). It has no attributes: one an authorizer reads is given with of.

Link copied to clipboard

The prefix of RESERVED_SUBJECT_PREFIXES subject starts with, ASCII letters compared without regard to case, or null when it starts with none: the one predicate of a reserved subject, which reservedSubjectRefusal and a command's recorded caller (me.ahoo.wow.api.decide.Command.recordedCaller) both ask.

Link copied to clipboard

Why caller may not make a request, or null when it may: a caller that is not a service identity whose subject starts with one of RESERVED_SUBJECT_PREFIXES, compared without regard to ASCII letter case (System:x and SERVICE:x are refused too). The one decision of it, which the edge (Authenticator) and admission (CallerAdmission.admit) both ask.