Skip to main content

subject_context

Function subject_context 

Source
pub async fn subject_context(
    subject: &Subject,
    verified_tenant: Option<&str>,
) -> Option<SecurityContext>
Expand description

Resolve a VFS/CAS/MoQ subject through the verified-Claims cache and current activation mode. Tenant mismatch is a hard miss.

Revocation revalidation: a cache hit whose entry carries a credential ID is revalidated against the process-global credential-revocation store on EVERY read — in non-policy processes that is one authority RPC per hit, which is deliberate strict observation, mirroring the per-request check in verify_claims. A revoked credential, an absent store, or an unreachable authority (the store’s own fail-closed true) all evict the entry and deny. Entries without a credential ID keep the cache-only behavior.

Session revalidation: a hit whose entry carries a session ID is likewise revalidated against the process-global session registry on every read — a revoked, expired, or unknown session, an absent registry, or an unreachable authority all evict the entry and deny (v16 §3.3: session revocation rejects every carrying credential).