#[non_exhaustive]pub enum AuthError {
Show 27 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: ID,
source: Box<Error>,
},
InvalidDelegationTips {
tree_id: ID,
claimed_tips: Vec<ID>,
},
DelegationNotFound {
tree_id: ID,
},
DelegationPathTooLong {
len: usize,
max: usize,
},
DelegationTipsTooMany {
tree_id: ID,
len: usize,
max: usize,
},
DelegatedTreeUnsynced {
tree_id: ID,
missing: Vec<ID>,
},
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
KeyNotFound
A requested authentication key was not found in the configuration.
InvalidKeyFormat
Invalid key format or parsing error.
KeyParsingFailed
Key parsing failed due to cryptographic library error.
NoAuthConfiguration
No authentication configuration was found.
InvalidAuthConfiguration
The authentication 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.
InvalidDelegationStep
A delegation step is invalid.
DelegatedTreeLoadFailed
Failed to load a delegated tree.
InvalidDelegationTips
Delegation tips don’t match the actual tree state.
Fields
DelegationNotFound
A delegated tree reference was not found in the configuration.
DelegationPathTooLong
Delegation path exceeds the maximum allowed number of steps.
The delegation path is wire-supplied on the entry’s signature key, and each step drives backend work before the authorization gate decides. Bounding the path length caps that amplification (a flat path of N steps is the chain-depth analog of N levels of recursion).
DelegationTipsTooMany
A delegation step claims more tips than allowed.
Claimed tips are wire-supplied and each drives DAG traversal; the per-step count is bounded to cap that amplification.
Fields
DelegatedTreeUnsynced
A delegated tree referenced by a delegation is not synced locally enough to decide the monotonicity floor.
This is a transient condition, not a validation failure: the entries in
missing have not arrived yet. The caller should keep the entry
unverified and re-check after syncing missing from the delegated tree’s
peers, rather than rejecting it as a forgery. Deliberately excluded from
AuthError::is_delegation_error — it signals sync state, not a
delegation defect.
Fields
CannotRevokeNonKey
Attempted to revoke an entry that is not a key.
MalformedEntry
Entry has malformed signature info (e.g., hint without signature).
InvalidSignature
Signature verification failed.
SignatureVerificationFailed
Signature verification failed with specific error.
DatabaseRequired
Database is required for the operation but not available.
InvalidPermissionString
Invalid permission string format.
PermissionRequiresPriority
Permission type requires a priority value.
InvalidPriorityValue
Invalid priority value.
InvalidKeyStatus
Invalid key status string.
PermissionDenied
Permission denied for an operation.
KeyAlreadyExists
Attempted to add a key that already exists.
KeyNameConflict
Key name conflicts with existing key that has different public key.
Fields
SigningKeyMismatch
Signing key does not match the claimed identity in a DatabaseKey.
Implementations§
Source§impl AuthError
impl AuthError
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this error indicates a key or delegation was not found.
Sourcepub fn is_invalid_signature(&self) -> bool
pub fn is_invalid_signature(&self) -> bool
Check if this error indicates invalid signature.
Sourcepub fn is_permission_denied(&self) -> bool
pub fn is_permission_denied(&self) -> bool
Check if this error indicates permission was denied.
Sourcepub fn is_key_already_exists(&self) -> bool
pub fn is_key_already_exists(&self) -> bool
Check if this error indicates a key already exists.
Sourcepub fn is_key_name_conflict(&self) -> bool
pub fn is_key_name_conflict(&self) -> bool
Check if this error indicates a key name conflict.
Sourcepub fn is_configuration_error(&self) -> bool
pub fn is_configuration_error(&self) -> bool
Check if this error indicates a configuration problem.
Sourcepub fn is_delegation_error(&self) -> bool
pub fn is_delegation_error(&self) -> bool
Check if this error is related to delegation.
Sourcepub fn is_delegated_tree_unsynced(&self) -> bool
pub fn is_delegated_tree_unsynced(&self) -> bool
Check if this error indicates a delegated tree is not yet synced enough
to validate — a transient, retriable condition, not a delegation defect
(see AuthError::DelegatedTreeUnsynced).
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
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()
Auto Trait Implementations§
impl Freeze for AuthError
impl !RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnsafeUnpin for AuthError
impl !UnwindSafe for AuthError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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