Module context
Expand description
Request-scoped context: authenticated identity, structured
principal, transport extensions, plus the AuthProvider trait
that auth middlewares implement.
Structs§
- Cached
Auth Provider - An
AuthProviderthat always returns a single, already-establishedCratestackContext, ignoring whateverRequestContextit is asked to authenticate. - Cratestack
Auth Identity - Cratestack
Context - Cratestack
Context Builder - Builds an authenticated
CratestackContext; start one withCratestackContext::builder. A later call for the same claim replaces the earlier value, exceptSelf::tenantand thecnfsetters, which merge into the existing map. - Principal
Context - Principal
Facet - Request
Context - Everything an
AuthProvidergets to see about an inbound request. - Reserved
Claim - One reserved claim: its path (a dotted path for a facet member such as
tenant.id) and the type it must have. - System
Context - A context representing trusted in-process/server code (a procedure, a worker, a reconciliation job) rather than an end user.
- Verified
Signer - The key that signed a request body, as verified by
CratestackEnvelope::open.
Enums§
- Claim
Type - The type a reserved claim must have.
- KeyRole
- Which device key proved this request (the
key_roleclaim): one that never prompts, or one that prompts for user presence on every signature.
Constants§
- RESERVED_
CLAIMS - The reserved claim names, in the ADR’s order.
idis deliberately not one of them: many schemas declareauth User { id Int }.
Traits§
- Auth
Provider - Resolves the caller of a request into a
CratestackContext.