Skip to main content

ClaustrumCredentialResolver

Struct ClaustrumCredentialResolver 

Source
pub struct ClaustrumCredentialResolver { /* private fields */ }
Expand description

Live claustrum-backed resolver. It lazily opens one soft outbound route and retries transient or transport errors for credential operations; scoped reads return the first error because each consumer owns its one-shot redial bound. Auth and permanent failures always return immediately.

Implementations§

Source§

impl ClaustrumCredentialResolver

Source

pub fn new( connection_file_path: PathBuf, project_root: PathBuf, consumer_module_id: impl Into<String>, ) -> Self

Trait Implementations§

Source§

impl CredentialResolver for ClaustrumCredentialResolver

Available on crate feature transport only.
Source§

fn watch_scoped<'a>( &'a self, enrollment_token: Option<&'a str>, ) -> CredentialResolverFuture<'a, Result<ScopedWatch, CredentialResolverError>>

Opens a dedicated scoped watch. The caller owns reconnection and re-reading.
Source§

fn resolve<'a>( &'a self, raw_handle: &'a str, min_ttl_ms: Option<u64>, force_refresh: bool, ) -> CredentialResolverFuture<'a, Result<ResolvedCredential, CredentialResolverError>>

raw_handle is the capability stored only in module configuration. Callers must use the config’s public credential name in reports and diagnostics.
Source§

fn get_scoped<'a>( &'a self, credential_id: &'a str, ) -> CredentialResolverFuture<'a, Result<ResolvedCredential, CredentialResolverError>>

Reads a credential by its vault ID under the route’s reserved principal. Unlike resolve, this never accepts a raw capability handle.
Source§

fn get_scoped_with_min_ttl<'a>( &'a self, credential_id: &'a str, min_ttl_ms: u64, ) -> CredentialResolverFuture<'a, Result<ResolvedCredential, CredentialResolverError>>

Reads a scoped credential only when the served token has at least this much remaining lifetime. Implementations that cannot enforce the bound fail closed.
Source§

fn report_auth_failure<'a>( &'a self, credential_id: &'a str, record_version: u64, provider_status: u16, ) -> CredentialResolverFuture<'a, Result<bool, CredentialResolverError>>

Reports a provider auth failure for the credential ID and served version. The vault accepts only provider status 401 or 403; any other status is rejected locally before a request is sent. accepted means the vault accepted the report, not that it changed state: a stale record_version is accepted and ignored. Read again after reporting; if the version has not moved, stop rather than retrying in a loop. For a static API key, a 401 means the key is dead.
Source§

fn status_scoped<'a>( &'a self, credential_id: &'a str, ) -> CredentialResolverFuture<'a, Result<CredentialStatus, CredentialResolverError>>

Returns status for a vault ID under the reserved principal without minting.
Source§

fn sign<'a>( &'a self, credential_id: &'a str, payload: &'a [u8], ) -> CredentialResolverFuture<'a, Result<CredentialSignature, CredentialResolverError>>

Source§

fn public_key<'a>( &'a self, credential_id: &'a str, ) -> CredentialResolverFuture<'a, Result<CredentialPublicKey, CredentialResolverError>>

Source§

fn seal<'a>( &'a self, request: SealRequest<'a>, ) -> CredentialResolverFuture<'a, Result<CredentialSeal, CredentialResolverError>>

Seals one message under a vault-held KEM key (credential.seal). Makes exactly one attempt, even on a retryable error: every seal is a fresh ciphertext with its own audit row, so retrying is the caller’s decision (its own backoff, its own record of what was sent), never something the client does silently.
Source§

fn list_scoped( &self, ) -> CredentialResolverFuture<'_, Result<ScopedCredentialListing, CredentialResolverError>>

Lists the vault rows covered by this principal’s own grants, metadata only.
Source§

impl Debug for ClaustrumCredentialResolver

Available on crate feature transport only.
Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.