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
impl ClaustrumCredentialResolver
Sourcepub async fn fleet_epoch_seal(
&self,
request: FleetEpochSealRequest<'_>,
) -> Result<FleetEpochSeal, CredentialResolverError>
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.
Sourcepub async fn fleet_epoch_open(
&self,
request: FleetEpochOpenRequest<'_>,
) -> FleetEpochOpenResult
pub async fn fleet_epoch_open( &self, request: FleetEpochOpenRequest<'_>, ) -> FleetEpochOpenResult
Opens a record on the caller’s attested route, without retrying.
Sourcepub async fn fleet_epoch_seal_batch(
&self,
items: &[FleetEpochSealRequest<'_>],
) -> Result<Vec<FleetEpochSeal>, CredentialResolverError>
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.
Sourcepub async fn fleet_epoch_open_batch(
&self,
items: &[FleetEpochOpenRequest<'_>],
) -> Result<Vec<FleetEpochOpenResult>, CredentialResolverError>
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
impl ClaustrumCredentialResolver
Sourcepub async fn module_secret_put(
&self,
name: &str,
value: Secret<Vec<u8>>,
expected_version: Option<u64>,
protected: Option<bool>,
) -> Result<ModuleSecretWritten, ModuleSecretError>
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.
Sourcepub async fn module_secret_get(
&self,
name: &str,
) -> Result<ModuleSecret, ModuleSecretError>
pub async fn module_secret_get( &self, name: &str, ) -> Result<ModuleSecret, ModuleSecretError>
Reads the calling module’s value. Requires an own SDK consumer claim.
Sourcepub async fn module_secret_delete(
&self,
name: &str,
expected_version: Option<u64>,
) -> Result<(), ModuleSecretError>
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.
Sourcepub async fn module_secret_list(
&self,
) -> Result<Vec<ModuleSecretSummary>, ModuleSecretError>
pub async fn module_secret_list( &self, ) -> Result<Vec<ModuleSecretSummary>, ModuleSecretError>
Lists metadata only, without returning any value bytes.
Source§impl ClaustrumCredentialResolver
impl ClaustrumCredentialResolver
Sourcepub async fn policy_active(
&self,
) -> Result<Option<ActivePolicy>, CredentialResolverError>
pub async fn policy_active( &self, ) -> Result<Option<ActivePolicy>, CredentialResolverError>
Reads the active policy on the caller’s attested route.
Sourcepub async fn policy_token(
&self,
request: PolicyTokenRequest<'_>,
) -> Result<PolicyToken, CredentialResolverError>
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.
Sourcepub async fn policy_watch(&self) -> Result<PolicyWatch, CredentialResolverError>
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
impl ClaustrumCredentialResolver
Sourcepub fn new(
connection_file_path: PathBuf,
consumer_module_id: impl Into<String>,
) -> Self
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).
Sourcepub fn with_consumer(consumer: Arc<SubcConsumer>) -> Self
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.
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.
impl CredentialResolver for ClaustrumCredentialResolver
transport only.Source§fn watch_scoped<'a>(
&'a self,
enrollment_token: Option<&'a str>,
) -> CredentialResolverFuture<'a, Result<ScopedWatch, CredentialResolverError>>
fn watch_scoped<'a>( &'a self, enrollment_token: Option<&'a str>, ) -> CredentialResolverFuture<'a, Result<ScopedWatch, CredentialResolverError>>
Source§fn resolve<'a>(
&'a self,
raw_handle: &'a str,
min_ttl_ms: Option<u64>,
force_refresh: bool,
) -> CredentialResolverFuture<'a, Result<ResolvedCredential, CredentialResolverError>>
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>>
fn get_scoped<'a>( &'a self, credential_id: &'a str, ) -> CredentialResolverFuture<'a, Result<ResolvedCredential, CredentialResolverError>>
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>>
fn get_scoped_with_min_ttl<'a>( &'a self, credential_id: &'a str, min_ttl_ms: u64, ) -> CredentialResolverFuture<'a, Result<ResolvedCredential, CredentialResolverError>>
Source§fn report_auth_failure<'a>(
&'a self,
credential_id: &'a str,
record_version: u64,
provider_status: u16,
) -> CredentialResolverFuture<'a, Result<bool, CredentialResolverError>>
fn report_auth_failure<'a>( &'a self, credential_id: &'a str, record_version: u64, provider_status: u16, ) -> CredentialResolverFuture<'a, Result<bool, CredentialResolverError>>
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>>
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>>
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>>
fn clear_condition<'a>( &'a self, credential_id: &'a str, record_version: u64, enrollment_token: Option<&'a str>, ) -> CredentialResolverFuture<'a, Result<bool, CredentialResolverError>>
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>>
fn status_scoped<'a>( &'a self, credential_id: &'a str, ) -> CredentialResolverFuture<'a, Result<CredentialStatus, CredentialResolverError>>
fn sign<'a>( &'a self, credential_id: &'a str, payload: &'a [u8], ) -> CredentialResolverFuture<'a, Result<CredentialSignature, CredentialResolverError>>
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>>
fn seal<'a>( &'a self, request: SealRequest<'a>, ) -> CredentialResolverFuture<'a, Result<CredentialSeal, CredentialResolverError>>
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.