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(¬ice), WatchAction::Reread { inventory: true, keys: true });Structs§
- Claustrum
Credential Resolver - 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.
- Credential
Public Key - Credential
Resolver Error - Credential
Seal - A
credential.sealresult. The recipient opensciphertextwithenc, the sameinfoandaad, and the public half of the keykey_idnames. - Credential
Signature - Credential
Status - Plaintext readiness metadata for a scoped credential. This never contains or mints credential material, so callers can poll repair progress safely.
- Listed
Credential - One vault row as
credential.list_scopeddescribes it. The vault fills inaccount_id,refresh_adapterand the plan tier only for rows the caller may list or read. - Listed
Grant - One grant the caller holds: which selector it names and which operation it allows.
- Resolved
Credential - Scoped
Credential Listing - The metadata
credential.list_scopedreturns for the caller’s own grants. It carries identity and protocol only, never secret material. - Scoped
Watch - A single held request. No reconnect or resubscribe is performed automatically.
Drop or stop cancels it; drain notices with
nextbefore awaitingclosed. - Scoped
Watch Notice - Seal
Request - One
credential.sealrequest: sealplaintexttorecipient_public_keyin RFC 9180 Auth mode, with the vault-held KEM keycredential_idas the sender. The caller’s route principal must hold an exactsealgrant for that key. - Unavailable
Credential Resolver - Fail-closed resolver used when no live claustrum route is available.
- Watch
Tracker - Tracks notifications separately from acknowledged inventory/key reads.
Call
openedfor each new subscription; duplicate closes never trigger retries.
Enums§
- Credential
Error Class - Public
KeyAlgorithm - The kind of key a
credential.public_keyreply carries. - Scoped
Watch Kind - Scoped
Watch Outcome - Watch
Action
Traits§
Functions§
- decode_
credential_ reply - Decodes a
credential.getorcredential.get_scopedresponse into secret bytes. - decode_
credential_ status_ reply - Decodes a
credential.statusresponse 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_keyresponse, validating its public key and ID. - decode_
report_ auth_ failure_ reply - Decodes whether
credential.report_auth_failureaccepted the report. - decode_
seal_ reply - Decodes a
credential.sealresponse: a 32-byte encapsulated key, a ciphertext at least as long as the AEAD tag, and a key id incredential.public_keyformat. - decode_
signature_ reply - Decodes a
credential.signresponse, validating the Ed25519 signature shape. - decode_
wire_ error - Decodes a subc error-frame body without opening a connection.
Type Aliases§
- Credential
Resolver Future - Watch
Notice - Transport-independent producer notice, also used by the raw watch handle.