Skip to main content

remember_verified_claims_with_credential

Function remember_verified_claims_with_credential 

Source
pub fn remember_verified_claims_with_credential(
    subject: &Subject,
    claims: &Claims,
    key_material: VerifiedKeyMaterial,
    verified_tenant: Option<&str>,
    credential_id: CredentialId,
)
Expand description

Cache a verified-Claims binding with an explicit [CredentialId], for credential encodings whose identifier is not derivable from Claims::jti (notably CWT cti byte strings).

This is the only insertion path for CWT credentials. It repeats every invariant check that remember_verified_claims enforces: sub must match subject.name(), exp must be in the future, security_context must be derivable from Claims × VerifiedKeyMaterial, and the credential ID’s issuer must match claims.iss. The cache entry is keyed by the caller-supplied credential_id, so eviction targets the exact (iss, jti/cti) pair.

credential_id.issuer MUST equal claims.iss. This prevents a caller from attaching a credential ID from a different issuer to a cache entry, which would break issuer-scoped eviction.