Skip to content

PrincipalAuthContext

Describes an execution performed by a signed-in individual whose own Roles are checked against every Grant.

Role checks such as ReadAppRoleInstance.checkRole and the Grants on Queries and Mutations are evaluated against PrincipalAuthContext.rolePrns. Events published during the execution name PrincipalAuthContext.principalId as their originating principal.

Workspaces and access

readonly identityId: string

The identity provider login (such as a Google or Microsoft account) the principal signed in with; kept for traceability rather than for access decisions.


readonly principalId: string

The user Item the principal is acting as; Role assignments and Template Role callbacks resolve against this id.


readonly rolePrns: readonly string[]

PRNs of the App Roles the principal holds in this Workspace; a Role check passes when the Role’s PRN appears here.


readonly sessionId: string

Links this context to the sign-in session it was created from.


readonly type: "principal"

Discriminates this context from the other members of AlpyneAuthContext.


readonly workspaceId: string

The Workspace every operation in this execution is scoped to.