Skip to main content

Crate cortexkit_claustrum_client

Crate cortexkit_claustrum_client 

Source
Expand description

Claustrum credential consumer for subc-supervised modules.

Disable the default transport feature to reuse the decoders and watch tracker with a connection owned by the caller.

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

let credential = decode_credential_reply(serde_json::json!({
    "result": {"payload": "example", "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§

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.
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.
ListedCredential
One vault row as credential.list_scoped describes it. The vault fills in account_id, refresh_adapter and the plan tier only for rows the caller may list or read.
ListedGrant
One grant the caller holds: which selector it names and which operation it allows.
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.
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§

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

Traits§

CredentialResolver

Functions§

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_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_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_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 body without opening a connection.

Type Aliases§

CredentialResolverFuture
WatchNotice
Transport-independent producer notice, also used by the raw watch handle.