pub struct AuthBlock {
pub identity_input: Option<AuthIdentity>,
pub access: Access,
pub permission: TablePermission,
}Expand description
Authentication and authorization state aggregated into one nested block.
Holds the three host-side auth-related fields that flow through the request pipeline. Each sub-field carries distinct semantic content:
identity_input— INPUT from a credential provider (Basic/JWT/OAuth/mTLS). Set by the auth pipeline’sAuthProvider::authenticate(). Represents WHO the wire claims to be, before role resolution. Renamed from the flatauth_identityfield to disambiguate fromContext::identity(the WIT-mirrored output shape exposed to wasm apps).access— OUTPUT after the auth middleware resolvesidentity_inputinto aUser+Role. Closed enum (Access). All RBAC helpers (can_read_table,can_update_table, attribute filtering) dispatch through this.permission— Per-request cachedTablePermissioncomputed once by the auth layer for the currently-routed table and consumed on the dispatch hot path.FullAccess(super-user / dev mode / wildcard) orAttributeRestricted(narrow read/write lists).Publicshort-circuits all RBAC for@export(public:[...])tables.
Relationship to Context.identity: That top-level field is the
pure-WIT resolved view (principal + roles + permissions bitmask
shape) crossing the WIT boundary to wasm apps. AuthBlock is the
host-side intermediate state used during dispatch. They overlap in
content but differ in lifetime and WIT surface.
Fields§
§identity_input: Option<AuthIdentity>Wire-level authentication claim, set by the auth pipeline before
role resolution. None for unauthenticated requests.
access: AccessResolved user + role after the auth middleware. Access::None
when unauthenticated.
permission: TablePermissionPre-computed table permission for the routed table, cached on the request hot path.