Skip to main content

SubjectContextClaims

Trait SubjectContextClaims 

Source
pub trait SubjectContextClaims {
    // Required method
    fn credential_clearance(&self) -> Option<CredentialClearance>;

    // Provided method
    fn security_context(
        &self,
        key_material: VerifiedKeyMaterial,
    ) -> Option<SecurityContext> { ... }
}
Expand description

Seam for carrying a subject clearance on the verified claims/envelope.

S1 defines the shape of the clearance the claims must carry; the concrete wire field on crate::auth::Claims / common.capnp is added under S8 (#574, hybrid envelope) so the new authz field ships on the hybrid-signed envelope rather than the classical one. Until then this trait is the typed contract S2/S4 program against, and a node assembles a SecurityContext by:

  1. reading the (future) clearance field off verified Claims, and
  2. deriving assurance from the envelope’s verified key material.

Implementing this on Claims is a one-liner once the field lands; defining it now lets S2/S4 compile and test against a stable interface.

Required Methods§

Source

fn credential_clearance(&self) -> Option<CredentialClearance>

The authority-asserted clearance carried in the verified claims, if any, as its two-axis wire projection (level + compartments only; assurance is structurally absent from the credential wire — v16 §11). None ⇒ unlabeled subject ⇒ the monitor MUST deny (no default clearance).

Provided Methods§

Source

fn security_context( &self, key_material: VerifiedKeyMaterial, ) -> Option<SecurityContext>

Assemble the full subject context, deriving the assurance axis PURELY from the verified key material (never from the wire — the wire cannot carry assurance). Returns None (→ deny) if the subject carries no clearance. Implementors normally only need to provide credential_clearance.

Implementors§