Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

AuthError

Enum AuthError 

Source
#[non_exhaustive]
pub enum AuthError {
Show 24 variants KeyNotFound { key_name: String, }, InvalidKeyFormat { reason: String, }, KeyParsingFailed { reason: String, }, NoAuthConfiguration, InvalidAuthConfiguration { reason: String, }, EmptyDelegationPath, DelegationDepthExceeded { depth: usize, }, InvalidDelegationStep { reason: String, }, DelegatedTreeLoadFailed { tree_id: String, source: Box<Error>, }, InvalidDelegationTips { tree_id: String, claimed_tips: Vec<ID>, }, DelegationNotFound { tree_id: String, }, CannotRevokeNonKey { key_name: String, }, MalformedEntry { reason: &'static str, }, InvalidSignature, SignatureVerificationFailed { reason: String, }, DatabaseRequired { operation: String, }, InvalidPermissionString { value: String, }, PermissionRequiresPriority { permission_type: String, }, InvalidPriorityValue { value: String, }, InvalidKeyStatus { value: String, }, PermissionDenied { reason: String, }, KeyAlreadyExists { key_name: String, }, KeyNameConflict { key_name: String, existing_pubkey: String, new_pubkey: String, }, SigningKeyMismatch { reason: String, },
}
Expand description

Errors that can occur during authentication operations.

§Stability

  • New variants may be added in minor versions (enum is #[non_exhaustive])
  • Existing variants will not be removed in minor versions
  • Field additions/changes require a major version bump
  • Helper methods like is_*() provide stable APIs

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

KeyNotFound

A requested authentication key was not found in the configuration.

Fields

§key_name: String

The name of the key that was not found

§

InvalidKeyFormat

Invalid key format or parsing error.

Fields

§reason: String

Description of why the key format is invalid

§

KeyParsingFailed

Key parsing failed due to cryptographic library error.

Fields

§reason: String

Description of the parsing failure

§

NoAuthConfiguration

No authentication configuration was found.

§

InvalidAuthConfiguration

The authentication configuration is invalid.

Fields

§reason: String

Description of why the configuration is invalid

§

EmptyDelegationPath

Delegation path is empty when it should contain at least one step.

§

DelegationDepthExceeded

Maximum delegation depth was exceeded to prevent infinite loops.

Fields

§depth: usize

The maximum depth that was exceeded

§

InvalidDelegationStep

A delegation step is invalid.

Fields

§reason: String

Description of why the delegation step is invalid

§

DelegatedTreeLoadFailed

Failed to load a delegated tree.

Fields

§tree_id: String

The ID of the tree that failed to load

§source: Box<Error>

The underlying error

§

InvalidDelegationTips

Delegation tips don’t match the actual tree state.

Fields

§tree_id: String

The ID of the tree with invalid tips

§claimed_tips: Vec<ID>

The tips that were claimed but are invalid

§

DelegationNotFound

A delegated tree reference was not found in the configuration.

Fields

§tree_id: String

The root tree ID of the delegation that was not found

§

CannotRevokeNonKey

Attempted to revoke an entry that is not a key.

Fields

§key_name: String

The name of the entry that is not a key

§

MalformedEntry

Entry has malformed signature info (e.g., hint without signature).

Fields

§reason: &'static str

Description of why the entry is malformed

§

InvalidSignature

Signature verification failed.

§

SignatureVerificationFailed

Signature verification failed with specific error.

Fields

§reason: String

Description of the verification failure

§

DatabaseRequired

Database is required for the operation but not available.

Fields

§operation: String

The operation that requires a database

§

InvalidPermissionString

Invalid permission string format.

Fields

§value: String

The invalid permission string

§

PermissionRequiresPriority

Permission type requires a priority value.

Fields

§permission_type: String

The permission type that requires priority

§

InvalidPriorityValue

Invalid priority value.

Fields

§value: String

The invalid priority value

§

InvalidKeyStatus

Invalid key status string.

Fields

§value: String

The invalid status value

§

PermissionDenied

Permission denied for an operation.

Fields

§reason: String

Description of why permission was denied

§

KeyAlreadyExists

Attempted to add a key that already exists.

Fields

§key_name: String

The name of the key that already exists

§

KeyNameConflict

Key name conflicts with existing key that has different public key.

Fields

§key_name: String

The name of the conflicting key

§existing_pubkey: String

The public key of the existing key

§new_pubkey: String

The public key of the new key

§

SigningKeyMismatch

Signing key does not match the claimed identity in a DatabaseKey.

Fields

§reason: String

Description of the mismatch

Implementations§

Source§

impl AuthError

Source

pub fn is_not_found(&self) -> bool

Check if this error indicates a key or delegation was not found.

Source

pub fn is_invalid_signature(&self) -> bool

Check if this error indicates invalid signature.

Source

pub fn is_permission_denied(&self) -> bool

Check if this error indicates permission was denied.

Source

pub fn is_key_already_exists(&self) -> bool

Check if this error indicates a key already exists.

Source

pub fn is_key_name_conflict(&self) -> bool

Check if this error indicates a key name conflict.

Source

pub fn is_configuration_error(&self) -> bool

Check if this error indicates a configuration problem.

Source

pub fn is_delegation_error(&self) -> bool

Check if this error is related to delegation.

Source

pub fn key_name(&self) -> Option<&str>

Get the key name if this error is about a missing key.

Trait Implementations§

Source§

impl Debug for AuthError

Source§

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

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

impl Display for AuthError

Source§

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

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

impl Error for AuthError

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
Source§

impl From<AuthError> for Error

Source§

fn from(err: AuthError) -> Self

Converts to this type from the input type.

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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
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
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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