Skip to main content

subject_context

Function subject_context 

Source
pub fn subject_context(
    claims: &dyn SubjectContextClaims,
    key_material: VerifiedKeyMaterial,
) -> Option<SecurityContext>
Expand description

Resolve the S1 SecurityContext for a UCAN grant’s audience from a SubjectContextClaims implementation.

This is the seam between “the UCAN names an audience DID” and “the S1 clearance floor needs a verified subject context”. The caller resolves the audience DID to whatever claims object it has (envelope claims, registered subject, …) implementing SubjectContextClaims, plus the assurance derived from the verified key material. Returns None for an unlabeled subject — which evaluate_grant maps to GrantError::UnlabeledSubject.

S6 does not invent clearance: it only forwards what the claims layer already provides (S1 contract). The concrete clearance field on Claims lands with S8 (#574); until then implementors test against a stub claims object, exactly as S1/S2 do.