Generated from the public declaration entry point packages/core/dist/index.d.ts. Internal modules are intentionally excluded.
Kind: interface
Immutable authorization facts resolved for one principal and policy.
export interface AccessContext {
readonly principalId: PrincipalId;
readonly policyVersion: string;
readonly roles: readonly RoleName[];
readonly entitlements: readonly EntitlementName[];
readonly permissions: readonly PermissionName[];
}Kind: interface
Auditable result of checking one permission against an access context.
export interface AccessDecision {
readonly allowed: boolean;
readonly permission: PermissionName;
readonly reason: AccessDecisionReason;
}Kind: interface
Application-owned mapping from roles and entitlements to permissions.
Unknown names are intentionally harmless: they appear in the resulting context for observability but grant no permissions.
export interface AccessPolicy {
readonly version: string;
readonly defaults?: readonly PermissionName[];
readonly roles?: Readonly<Record<RoleName, readonly PermissionName[]>>;
readonly entitlements?: Readonly<
Record<EntitlementName, readonly PermissionName[]>
>;
}Kind: interface
Immutable access context together with opt-in resolution diagnostics.
export interface AccessResolution {
readonly context: AccessContext;
readonly diagnostics: AccessResolutionDiagnostics;
}Kind: interface
Unknown subject facts observed while resolving one access context.
export interface AccessResolutionDiagnostics {
readonly unknownRoles: readonly RoleName[];
readonly unknownEntitlements: readonly EntitlementName[];
}Kind: interface
Trusted, already-resolved facts about the principal requesting access.
Identity, billing, and persistence adapters are responsible for producing these facts from verified server-side sources.
export interface AccessSubject {
readonly principalId: PrincipalId;
readonly roles?: readonly RoleName[];
readonly entitlements?: readonly EntitlementName[];
}Kind: function
Produce an explicit, log-friendly decision for one permission check.
export declare function decideAccess(
context: AccessContext,
permission: PermissionName,
): AccessDecision;Kind: type
A named commercial or otherwise externally sourced grant.
export type EntitlementName = string;Kind: function
Return true when an access context explicitly includes a permission.
export declare function hasPermission(
context: AccessContext,
permission: PermissionName,
): boolean;Kind: type
An application action that can be allowed or denied.
export type PermissionName = string;Kind: type
Stable identifier assigned by the host application.
Provider identifiers and email addresses should be linked to a principal, not used in place of one.
export type PrincipalId = string;Kind: function
Resolve trusted principal facts through an application-owned policy.
Unknown roles and entitlements are retained for observability but do not grant permissions. The resolver does not support wildcard permissions.
export declare function resolveAccess(
subject: AccessSubject,
policy: AccessPolicy,
): AccessContext;Kind: function
Resolve access and report unknown subject facts without changing grants.
Diagnostics are informational and have no effect on the returned context.
export declare function resolveAccessWithDiagnostics(
subject: AccessSubject,
policy: AccessPolicy,
): AccessResolution;Kind: type
A named responsibility assigned by the host application.
export type RoleName = string;Kind: function
Serialize one access context to a stable, compact JSON snapshot.
The snapshot is unauthenticated and must not be trusted as client input or used in place of a signed access grant.
export declare function serializeAccessContext(context: AccessContext): string;