Skip to main content

Crate cortexkit_claustrum_client

Crate cortexkit_claustrum_client 

Source
Expand description

Claustrum credential consumer for subc-supervised modules.

Disable default features to reuse the decoders and watch tracker without the socket transport or SDK dependency.

use cortexkit_claustrum_client::{decode_credential_reply, WatchAction, WatchNotice, WatchTracker};

let credential = decode_credential_reply(serde_json::json!({
    "result": {"payload": [101, 120, 97, 109, 112, 108, 101], "record_version": 1}
})).unwrap();
assert_eq!(credential.expose(), b"example");
let notice = WatchNotice::decode(
    br#"{"kind":"changed","epoch":"launch","seq":1,"view":"v1","keys":"k1"}"#,
).unwrap();
let mut tracker = WatchTracker::default();
assert_eq!(tracker.notice(&notice), WatchAction::Reread { inventory: true, keys: true });

Structs§

ActivePolicy
The policy the vault reports as active, with its signed JSON text unchanged.
AuthDescriptor
How a provider accepts a key in a request header.
ClaustrumCredentialResolver
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.
CredentialPublicKey
CredentialResolverError
CredentialSeal
A credential.seal result. The recipient opens ciphertext with enc, the same info and aad, and the public half of the key key_id names.
CredentialSignature
CredentialStatus
Plaintext readiness metadata for a scoped credential. This never contains or mints credential material, so callers can poll repair progress safely.
FleetEpochOpenRequest
A sealed record and the exact associated data used to seal it.
FleetEpochSeal
Fleet epoch record to persist alongside its associated data.
FleetEpochSealRequest
Bytes to seal under the current fleet epoch. The plaintext remains caller-owned.
InvalidKeyEvidence
An observation of a rejected key, not a rule evaluated by the vault.
ListedCredential
One vault row as credential.list_scoped describes it. The vault fills in account_id, refresh_adapter, the plan tier and the condition only for rows the caller may list or read. Learned org_id has the same visibility.
ListedCredentialCondition
A login condition visible in a scoped listing, without the action link or reporter.
ListedGitHubApp
GitHub App identity recorded by the vault for a listed credential.
ListedGrant
One grant the caller holds: which selector it names and which operation it allows.
ModuleSecret
ModuleSecretSummary
ModuleSecretWritten
PolicyToken
PolicyTokenRequest
PolicyWatchNotice
A policy watch snapshot. Both policy fields are None when no policy is active.
ResolvedCredential
ScopedCredentialListing
The metadata credential.list_scoped returns for the caller’s own grants. It carries identity and protocol only, never secret material.
ScopedWatch
A single held request. No reconnect or resubscribe is performed automatically. Drop or stop cancels it; drain notices with next before awaiting closed.
ScopedWatchNotice
SealRequest
One credential.seal request: seal plaintext to recipient_public_key in RFC 9180 Auth mode, with the vault-held KEM key credential_id as the sender. The caller’s route principal must hold an exact seal grant for that key.
Secret
An owned buffer that is scrubbed on drop and never rendered by Debug.
UnavailableCredentialResolver
Fail-closed resolver used when no live claustrum route is available.
WatchTracker
Tracks notifications separately from acknowledged inventory/key reads. Call opened for each new subscription; duplicate closes never trigger retries.

Enums§

AuthScheme
CredentialErrorClass
ModuleSecretError
ModuleSecretState
PublicKeyAlgorithm
The kind of key a credential.public_key reply carries.
ScopedWatchKind
ScopedWatchOutcome
WatchAction

Traits§

CredentialResolver

Functions§

decode_clear_condition_reply
Decodes whether credential.clear_condition removed a condition.
decode_credential_reply
Decodes a credential.get or credential.get_scoped response into secret bytes.
decode_credential_status_reply
Decodes a credential.status response without fetching credential material.
decode_established_route_wire_error
Decodes a subc Error frame received on an established route or watch.
decode_fleet_epoch_open_batch_reply
Decodes a fleet batch open Response frame body. An outer error is a whole-call refusal or invalid reply; item refusals preserve their slots in a successful batch. The input may hold encoded plaintext; keep it in zeroizing storage too.
decode_fleet_epoch_open_reply
Decodes the JSON body of a fleet open Response frame (including a vault refusal). The input may hold encoded plaintext; keep it in zeroizing storage too.
decode_fleet_epoch_seal_batch_reply
Decodes a fleet batch seal Response frame body, in wire order, or fails the whole reply.
decode_fleet_epoch_seal_reply
Decodes the JSON body of a fleet seal Response frame (including a vault refusal). Decode Error frames on the route separately with crate::decode_established_route_wire_error.
decode_list_scoped_reply
Decode metadata row by row: a malformed credential or grant must not discard healthy entries listed alongside it. Envelope failures still reject the listing.
decode_policy_active_reply
Decodes the active policy, or None when the vault serves four explicit nulls.
decode_policy_token_reply
Decodes a narrowed token reply. The input bytes hold the token; keep them private.
decode_public_key_reply
Decodes a credential.public_key response, validating its public key and ID.
decode_report_auth_failure_reply
Decodes whether credential.report_auth_failure accepted the report.
decode_report_condition_reply
Decodes whether credential.report_condition accepted the report.
decode_seal_reply
Decodes a credential.seal response: a 32-byte encapsulated key, a ciphertext at least as long as the AEAD tag, and a key id in credential.public_key format.
decode_signature_reply
Decodes a credential.sign response, validating the Ed25519 signature shape.
decode_wire_error
Decodes a subc Error frame answering route.open.

Type Aliases§

CredentialResolverFuture
FleetEpochOpenResult
One ordered slot of a successful open batch. The refusal’s code and class are those returned by the vault for that item.
PolicyWatch
WatchNotice
Transport-independent producer notice, also used by the raw watch handle.