Skip to main content

SecretStoreError

Enum SecretStoreError 

Source
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: SecretScope

Which store was being resolved.

§reason: String

What was missing, in terms an operator can act on.

§

Store

The value could not be written.

Fields

§scope: SecretScope

Which store.

§location: String

Where it lives, as SecretStore::location reports it.

§source: Error

The underlying platform error.

§

Load

The value could not be read back.

Fields

§scope: SecretScope

Which store.

§location: String

Where it lives.

§source: Error

The underlying platform error.

§

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: SecretScope

Which store.

§location: String

Where it lives.

§source: Error

The underlying platform error.

§

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: SecretScope

Which store.

§location: String

Where it lives.

§detail: String

What is wrong with what is there, in terms that name no part of it. A byte count is not a disclosure; the bytes would be, so they are never carried.

§

Inspect

The access control protecting the value could not be read back.

Fields

§scope: SecretScope

Which store.

§guard: PathBuf

The filesystem object whose access control was being read.

§source: HandoffError

The underlying error.

Trait Implementations§

Source§

impl Debug for SecretStoreError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SecretStoreError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SecretStoreError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more