Skip to main content

CredStore

Trait CredStore 

Source
pub trait CredStore {
    // Required methods
    fn get(&self, provider: &str) -> Option<Cred>;
    fn put(&self, provider: &str, cred: &Cred) -> Result<()>;
    fn discover(&self, spec: &AmbientSpec) -> Option<Cred>;
}
Expand description

Persist and retrieve one secret bundle per provider (auth §5.2, §5.5). get returns None for a missing cred (the no-creds path), never an error; refresh is OAuth2::apply using get+put (freshness is a query); list/delete are control-plane. discover is the third primitive (auth §5.5): read a foreign credential source named by an AmbientSpec — a file (Claude Code’s ~/.claude/…) or a process env var (a vendor key alias) — into a brazen Cred. The IO — a file read with $HOME expansion, or an env read — lives in the bz impl; the format parse is the pure parse_ambient; a store with no ambient backing returns None.

Required Methods§

Source

fn get(&self, provider: &str) -> Option<Cred>

Source

fn put(&self, provider: &str, cred: &Cred) -> Result<()>

Source

fn discover(&self, spec: &AmbientSpec) -> Option<Cred>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§