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. SDK route-credit failures are retryable by the caller, not replayed here. Login condition reports and clears are never retried. Module-secret methods are single-shot and use an additional route on the caller’s SDK consumer without changing the ordinary credential route.

Implementations§

Source§

impl ClaustrumCredentialResolver

Source

pub async fn fleet_epoch_seal( &self, request: FleetEpochSealRequest<'_>, ) -> Result<FleetEpochSeal, CredentialResolverError>

Seals one record under the current fleet epoch on the caller’s attested route. Sends once; a second seal would produce a new ciphertext.

Source

pub async fn fleet_epoch_open( &self, request: FleetEpochOpenRequest<'_>, ) -> FleetEpochOpenResult

Opens a record on the caller’s attested route, without retrying.

Source

pub async fn fleet_epoch_seal_batch( &self, items: &[FleetEpochSealRequest<'_>], ) -> Result<Vec<FleetEpochSeal>, CredentialResolverError>

Seals 1 through 256 records in one attempt. Successful replies preserve input order.

Source

pub async fn fleet_epoch_open_batch( &self, items: &[FleetEpochOpenRequest<'_>], ) -> Result<Vec<FleetEpochOpenResult>, CredentialResolverError>

Opens 1 through 256 records in one attempt. An item refusal does not fail its neighbors; a whole-call refusal or malformed reply returns no items.

Source§

impl ClaustrumCredentialResolver

Source

pub async fn module_secret_put( &self, name: &str, value: Secret<Vec<u8>>, expected_version: Option<u64>, protected: Option<bool>, ) -> Result<ModuleSecretWritten, ModuleSecretError>

Creates or replaces a value in the attested module’s private space. No attempt is retried, including after a transient refusal or lost reply.

Source

pub async fn module_secret_get( &self, name: &str, ) -> Result<ModuleSecret, ModuleSecretError>

Reads the calling module’s value. Requires an own SDK consumer claim.

Source

pub async fn module_secret_delete( &self, name: &str, expected_version: Option<u64>, ) -> Result<(), ModuleSecretError>

Deletes once; a stale expected version never deletes a newer value.

Source

pub async fn module_secret_list( &self, ) -> Result<Vec<ModuleSecretSummary>, ModuleSecretError>

Lists metadata only, without returning any value bytes.

Source§

impl ClaustrumCredentialResolver

Source

pub async fn policy_active( &self, ) -> Result<Option<ActivePolicy>, CredentialResolverError>

Reads the active policy on the caller’s attested route.

Source

pub async fn policy_token( &self, request: PolicyTokenRequest<'_>, ) -> Result<PolicyToken, CredentialResolverError>

Requests one policy-narrowed token. Does not retry or fall back to a broad token.

Source

pub async fn policy_watch(&self) -> Result<PolicyWatch, CredentialResolverError>

Opens a dedicated active-policy watch. Reopening and reads belong to the caller.

Source§

impl ClaustrumCredentialResolver

Source

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

Creates a lazy resolver for a supervised consumer. Bind identity carries harness/session labels only; a route’s project comes from its session scope. Claim-bound modules must use with_consumer instead (feature consumer).

Source

pub fn with_consumer(consumer: Arc<SubcConsumer>) -> Self

Uses the caller’s SDK connection, including its module claim binding. Legacy module-ID/launch-nonce identity overrides would conflict with a claim-bound connection, so this resolver leaves identity binding to the SDK. The consumer is shared because SubcConsumer is not Clone; dropping the resolver never closes the caller’s connection or unrelated routes.

Source

pub fn with_target( target: Arc<dyn CredentialGetTarget>, transient_retries: usize, ) -> 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 report_condition<'a>( &'a self, credential_id: &'a str, record_version: u64, reason: &'a str, provider_status: u16, action_url: Option<&'a str>, enrollment_token: Option<&'a str>, ) -> CredentialResolverFuture<'a, Result<bool, CredentialResolverError>>

Reports a lasting provider condition on the credential and served version. The vault decides whether to admit the reason, status and link. true means it accepted the report, not necessarily that it changed the condition. The client does not retry: a lost reply does not tell us whether the vault committed.
Source§

fn clear_condition<'a>( &'a self, credential_id: &'a str, record_version: u64, enrollment_token: Option<&'a str>, ) -> CredentialResolverFuture<'a, Result<bool, CredentialResolverError>>

Reports that the served version worked. true means the vault removed a condition; false means there was none to clear or the version did not match. The client does not retry: a replay could erase a condition reported after the clear.
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§

§

impl !RefUnwindSafe for ClaustrumCredentialResolver

§

impl !UnwindSafe for ClaustrumCredentialResolver

§

impl Forget for ClaustrumCredentialResolver

§

impl Freeze for ClaustrumCredentialResolver
where *const ArcInner<dyn CredentialGetTarget> is !null: Freeze, PhantomData<ArcInner<dyn CredentialGetTarget>>: Freeze, *const ArcInner<LiveCredentialGetTarget> is !null: Freeze, PhantomData<ArcInner<LiveCredentialGetTarget>>: Freeze,

§

impl Move for ClaustrumCredentialResolver

§

impl Send for ClaustrumCredentialResolver
where Arc<dyn CredentialGetTarget>: Send, Arc<LiveCredentialGetTarget>: Send,

§

impl Sync for ClaustrumCredentialResolver
where Arc<dyn CredentialGetTarget>: Sync, Arc<LiveCredentialGetTarget>: Sync,

§

impl Unpin for ClaustrumCredentialResolver
where Arc<dyn CredentialGetTarget>: Unpin, Arc<LiveCredentialGetTarget>: Unpin,

§

impl UnsafeUnpin for ClaustrumCredentialResolver
where *const ArcInner<dyn CredentialGetTarget> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn CredentialGetTarget>>: UnsafeUnpin, *const ArcInner<LiveCredentialGetTarget> is !null: UnsafeUnpin, PhantomData<ArcInner<LiveCredentialGetTarget>>: UnsafeUnpin,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more