pub struct CredentialMinter { /* private fields */ }Expand description
The framework-issued service that mints sealed Credential<T> values.
CredentialMinter’s constructor is pub(crate) — only plexus-auth-core
can produce one. The framework’s dispatch layer (per AUTHZ-CRED-CORE-2)
injects a &CredentialMinter into credential-issuing methods; activation
code receives the reference but cannot construct its own minter, nor
extend the seal by aliasing the type.
The minter ties construction to the originating method invocation so
audit can attribute the issuance. v1 carries the issuer hint as a stored
field on the minter so CredentialMinter::mint_with_issuer does not
require it as a separate argument; richer audit context (call id,
invocation chain position) is added in AUTHZ-CRED-CORE-2 when the
dispatch-layer wiring lands.
Implementations§
Source§impl CredentialMinter
impl CredentialMinter
Sourcepub fn issuer(&self) -> &CredentialIssuer
pub fn issuer(&self) -> &CredentialIssuer
The default issuer the minter stamps onto credentials minted via
CredentialMinter::mint_with_issuer. Useful for audit hooks.
Sourcepub fn mint<T>(&self, payload: T, metadata: CredentialMetadata) -> Credential<T>
pub fn mint<T>(&self, payload: T, metadata: CredentialMetadata) -> Credential<T>
Mint a sealed Credential<T> from a raw payload and pre-built
metadata.
This is the only public path from a raw T to a sealed
Credential<T>. Activation code calls it via the framework-injected
&CredentialMinter reference.
Sourcepub fn mint_with_issuer<T>(
&self,
payload: T,
kind: CredentialKind,
attach_as: AttachmentSite,
scheme: Option<CredentialScheme>,
scopes: Vec<Scope>,
expires_at: Option<DateTime<Utc>>,
refresh_via: Option<MethodPath>,
revoke_via: Option<MethodPath>,
) -> Credential<T>
pub fn mint_with_issuer<T>( &self, payload: T, kind: CredentialKind, attach_as: AttachmentSite, scheme: Option<CredentialScheme>, scopes: Vec<Scope>, expires_at: Option<DateTime<Utc>>, refresh_via: Option<MethodPath>, revoke_via: Option<MethodPath>, ) -> Credential<T>
Mint a sealed Credential<T> from a raw payload, populating the
metadata’s issuer field from the minter’s Self::issuer. The
caller supplies everything else.
Trait Implementations§
Source§impl Clone for CredentialMinter
impl Clone for CredentialMinter
Source§fn clone(&self) -> CredentialMinter
fn clone(&self) -> CredentialMinter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more