pub enum SecretStoreError {
Resolve {
scope: SecretScope,
reason: String,
},
Store {
scope: SecretScope,
location: String,
source: Error,
},
Load {
scope: SecretScope,
location: String,
source: Error,
},
Delete {
scope: SecretScope,
location: String,
source: Error,
},
Corrupt {
scope: SecretScope,
location: String,
detail: String,
},
Inspect {
scope: SecretScope,
guard: PathBuf,
source: HandoffError,
},
}Expand description
Something went wrong reaching the secret store.
No variant carries the stored value, and none ever may. Every one of
them is formatted into an operator-facing message and into a tracing
event, and 07-security.md’s release gate is that the user access token is
“absent from logs, databases, snapshots, crash reports, and CLI output”.
A variant that carried the value would put it in all four at once.
Note what is not here: an “absent” variant. A load that finds nothing is
[Ok(None)], because absence is the ordinary state of this store before
auth login and after auth logout, and a caller that has to distinguish
“not logged in” from “the keychain is unreachable” cannot be asked to do it
by matching on an error kind.
Variants§
Resolve
The store’s location could not be worked out at all.
Fields
scope: SecretScopeWhich store was being resolved.
Store
The value could not be written.
Fields
scope: SecretScopeWhich store.
location: StringWhere it lives, as SecretStore::location reports it.
Load
The value could not be read back.
Fields
scope: SecretScopeWhich store.
Delete
The value could not be removed.
Worth an error rather than a shrug, for the reason
05-infrastructure.md gives the credential-disclosure response: step 2
is “Run auth logout on every host to purge the machine-scoped secret
store”, and an operator following that procedure has to be told when a
host did not comply.
Fields
scope: SecretScopeWhich store.
Corrupt
Something is stored, and it is not a value this store wrote.
Deliberately not folded into SecretStoreError::Load and deliberately
not reported as absence. A caller that saw absence would silently start
a device-flow login and overwrite whatever is there; a caller that saw a
transient read failure would retry forever. This is neither: it is an
operator-actionable condition whose remedy is auth logout followed by
auth login.
Fields
scope: SecretScopeWhich store.
Inspect
The access control protecting the value could not be read back.
Trait Implementations§
Source§impl Debug for SecretStoreError
impl Debug for SecretStoreError
Source§impl Display for SecretStoreError
impl Display for SecretStoreError
Source§impl Error for SecretStoreError
impl Error for SecretStoreError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()