#[non_exhaustive]pub enum CampAuthorityError {
AlreadyExists(PrincipalId),
WrongPrincipalKind(PrincipalKind),
InvalidDelegation(DelegationError),
DelegationMismatch(&'static str),
DelegationExpired,
UntrustedSigningKey(PrincipalId),
BadSignature,
Principal(PrincipalError),
Store(StoreError),
}Expand description
Typed failure modes for CampAuthority operations.
HTTP layer maps these to status codes (camps route in cheers-axum):
AlreadyExists → 409, InvalidDelegation → 400, UntrustedSigningKey →
401, DelegationMismatch / DelegationExpired → 400,
BadSignature → 401, WrongPrincipalKind → 500, Store → 500.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlreadyExists(PrincipalId)
A camp principal with the requested desired_id already exists.
WrongPrincipalKind(PrincipalKind)
bound_to (in NewCampPrincipal) is not a user principal — a
programmer error, since the HTTP layer’s parser would have caught it.
InvalidDelegation(DelegationError)
The presented UserDelegation violates its own invariants
(non-user bound_to, empty camp_id, …). Surfaces only when the
caller pre-built a UserDelegation value through a path that
bypassed UserDelegation::new — over the wire,
UserDelegation deserialization runs the same check.
DelegationMismatch(&'static str)
The delegation’s bound_to doesn’t match the NewCampPrincipal::bound_to,
or its camp_id doesn’t match desired_id. The delegation says “U
authorises camp C”; if the provision request doesn’t, the binding is
not what was signed.
DelegationExpired
delegation.expires_at <= now.
UntrustedSigningKey(PrincipalId)
The delegation’s user_signing_key is not in the trusted set for
bound_to (no UserSigningKey row, or the matching row is
Revoked).
BadSignature
Ed25519 signature failed to verify under the supplied
user_signing_key.
Principal(PrincipalError)
Programmer error reaching the authority with a non-camp principal id
for cascade revoke / similar — bubbles
PrincipalError.
Store(StoreError)
Underlying store failure.
Trait Implementations§
Source§impl Debug for CampAuthorityError
impl Debug for CampAuthorityError
Source§impl Display for CampAuthorityError
impl Display for CampAuthorityError
Source§impl Error for CampAuthorityError
impl Error for CampAuthorityError
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()