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(¬ice), WatchAction::Reread { inventory: true, keys: true });Structs§
- Active
Policy - The policy the vault reports as active, with its signed JSON text unchanged.
- Auth
Descriptor - How a provider accepts a key in a request header.
- 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. 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.
- 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.
- Fleet
Epoch Open Request - A sealed record and the exact associated data used to seal it.
- Fleet
Epoch Seal - Fleet epoch record to persist alongside its associated data.
- Fleet
Epoch Seal Request - Bytes to seal under the current fleet epoch. The plaintext remains caller-owned.
- Invalid
KeyEvidence - An observation of a rejected key, not a rule evaluated by the vault.
- Listed
Credential - One vault row as
credential.list_scopeddescribes it. The vault fills inaccount_id,refresh_adapter, the plan tier and the condition only for rows the caller may list or read. Learnedorg_idhas the same visibility. - Listed
Credential Condition - A login condition visible in a scoped listing, without the action link or reporter.
- Listed
GitHub App - GitHub App identity recorded by the vault for a listed credential.
- Listed
Grant - One grant the caller holds: which selector it names and which operation it allows.
- Module
Secret - Module
Secret Summary - Module
Secret Written - Policy
Token - Policy
Token Request - Policy
Watch Notice - A policy watch snapshot. Both policy fields are
Nonewhen no policy is active. - 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. - Secret
- An owned buffer that is scrubbed on drop and never rendered by
Debug. - 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§
- Auth
Scheme - Credential
Error Class - Module
Secret Error - Module
Secret State - Public
KeyAlgorithm - The kind of key a
credential.public_keyreply carries. - Scoped
Watch Kind - Scoped
Watch Outcome - Watch
Action
Traits§
Functions§
- decode_
clear_ condition_ reply - Decodes whether
credential.clear_conditionremoved a condition. - 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_
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
Nonewhen 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_keyresponse, validating its public key and ID. - decode_
report_ auth_ failure_ reply - Decodes whether
credential.report_auth_failureaccepted the report. - decode_
report_ condition_ reply - Decodes whether
credential.report_conditionaccepted 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 answering
route.open.
Type Aliases§
- Credential
Resolver Future - Fleet
Epoch Open Result - One ordered slot of a successful open batch. The refusal’s code and class are those returned by the vault for that item.
- Policy
Watch - Watch
Notice - Transport-independent producer notice, also used by the raw watch handle.