pub struct AuthStore { /* private fields */ }Expand description
Keys held for this machine, keyed by normalised endpoint.
Serialize/Deserialize drive the on-disk TOML directly; there is no
separate wire type because the file is drep’s own and has one shape.
Implementations§
Source§impl AuthStore
impl AuthStore
Sourcepub fn load(path: &Path) -> Result<Self, AuthError>
pub fn load(path: &Path) -> Result<Self, AuthError>
Read the store at path.
A missing file is an empty store, which is the normal first-run state. Every other read or parse failure remains fatal so corruption never masquerades as a machine with no stored credentials.
A parse failure carries the toml error’s message alone. Its Display
renders the offending source line, and in this file that line is an
endpoint and its key, so the full rendering would print a credential.
Source§impl AuthStore
impl AuthStore
Sourcepub fn set(&mut self, endpoint: &str, key: &str) -> Result<(), AuthError>
pub fn set(&mut self, endpoint: &str, key: &str) -> Result<(), AuthError>
Store key for endpoint, replacing any previous one.
The rule about what a credential may be is vet’s, not this method’s;
only the wording is here, because a paste at the prompt and a helper’s
stdout send the reader to different fixes.
Sourcepub fn remove(&mut self, endpoint: &str) -> bool
pub fn remove(&mut self, endpoint: &str) -> bool
Forget the key for endpoint. Returns whether one was held.
Trait Implementations§
Source§impl Debug for AuthStore
Hand-written so a key cannot reach a log.
impl Debug for AuthStore
Hand-written so a key cannot reach a log.
The same reasoning as LlmConfig and LlmClient: a derived Debug prints
every value, so one {:?} anywhere would emit every credential the user has.
The endpoints are printed because they are not secret and they are the useful
half when debugging.