pub struct CredentialMetadata {
pub kind: CredentialKind,
pub attach_as: AttachmentSite,
pub scheme: Option<CredentialScheme>,
pub scopes: Vec<Scope>,
pub expires_at: Option<DateTime<Utc>>,
pub refresh_via: Option<MethodPath>,
pub revoke_via: Option<MethodPath>,
pub issuer: CredentialIssuer,
pub sensitive: bool,
}Expand description
What this credential is and how to attach it on subsequent calls.
Every metadata field is a typed newtype, never a bare string. The
CredentialMetadata::sensitive field is always true; it exists on the
struct so the metadata is the single source of truth for the redaction
pipeline (AUTHZ-PRIVACY-1).
Metadata is fixed at mint time: a Credential<T> exposes its metadata
via Credential::metadata, but there is no mutable accessor.
Fields§
§kind: CredentialKindWhat kind of credential this is. Tags storage decisions and drives selection.
attach_as: AttachmentSiteWhere the credential is attached on the wire when sent on subsequent calls.
scheme: Option<CredentialScheme>Optional prefix prepended to the value at attach time (e.g.,
"Bearer " for Authorization: Bearer <token>). Stored in the
metadata so the client doesn’t have to guess.
scopes: Vec<Scope>Which scopes this credential authorizes. Empty set means “scope decision is server-side; client doesn’t filter.”
expires_at: Option<DateTime<Utc>>Hard expiry of the credential value, if known at issue time. Used for proactive refresh and for dropping stale stored credentials.
refresh_via: Option<MethodPath>Optional refresh hint: if this credential expires, call this method to obtain a fresh one. The named-session framework handles the swap; activation code is uninvolved.
revoke_via: Option<MethodPath>Optional revocation hint: calling this method invalidates the credential server-side.
issuer: CredentialIssuerIdentity of the issuing party.
sensitive: boolSensitivity marker for the redaction pipeline (AUTHZ-PRIVACY-1).
Always true; present for type-system uniformity so any code that
reads the metadata has a single source of truth.
Implementations§
Source§impl CredentialMetadata
impl CredentialMetadata
Sourcepub fn new(
kind: CredentialKind,
attach_as: AttachmentSite,
scheme: Option<CredentialScheme>,
scopes: Vec<Scope>,
expires_at: Option<DateTime<Utc>>,
refresh_via: Option<MethodPath>,
revoke_via: Option<MethodPath>,
issuer: CredentialIssuer,
) -> Self
pub fn new( kind: CredentialKind, attach_as: AttachmentSite, scheme: Option<CredentialScheme>, scopes: Vec<Scope>, expires_at: Option<DateTime<Utc>>, refresh_via: Option<MethodPath>, revoke_via: Option<MethodPath>, issuer: CredentialIssuer, ) -> Self
Construct a fresh CredentialMetadata. The sensitive flag is always
initialized to true; the field exists so callers reading metadata
can treat it as the single source of truth without consulting outside
state.
Public — the metadata is not a secret. The seal is on the credential VALUE, not on the metadata that describes it.
Trait Implementations§
Source§impl Clone for CredentialMetadata
impl Clone for CredentialMetadata
Source§fn clone(&self) -> CredentialMetadata
fn clone(&self) -> CredentialMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CredentialMetadata
impl Debug for CredentialMetadata
Source§impl<'de> Deserialize<'de> for CredentialMetadata
impl<'de> Deserialize<'de> for CredentialMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for CredentialMetadata
impl JsonSchema for CredentialMetadata
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for CredentialMetadata
impl PartialEq for CredentialMetadata
Source§fn eq(&self, other: &CredentialMetadata) -> bool
fn eq(&self, other: &CredentialMetadata) -> bool
self and other values to be equal, and is used by ==.