#[non_exhaustive]pub enum ServicePrincipalError {
AlreadyExists(PrincipalId),
UnknownPrincipal(PrincipalId),
Principal(PrincipalError),
WrongPrincipalKind(PrincipalKind),
NoActiveKey(PrincipalId),
Codec(CodecError),
Store(StoreError),
}Expand description
Typed failure modes for ServicePrincipalAuthority operations.
HTTP layer (peer ticket) maps these to status codes: AlreadyExists →
409, UnknownPrincipal → 404, WrongPrincipalKind → 500 (programmer
error reaching the authority with a non-service id), NoActiveKey →
500 (data integrity — every provisioned principal MUST have at least
one active key), Codec → 500, Principal/Store → bubble.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlreadyExists(PrincipalId)
A principal with the requested desired_id already exists.
UnknownPrincipal(PrincipalId)
rotate (or a JWKS lookup) named a principal cheers doesn’t know.
Principal(PrincipalError)
The id handed to provision/rotate wasn’t a service kind. Bubbles up
the underlying PrincipalError.
WrongPrincipalKind(PrincipalKind)
kind on the principal id was something other than Service.
NoActiveKey(PrincipalId)
rotate ran against a principal with no Active key. Indicates a
data-integrity break (every provision must seed one) — not a normal
user-input failure.
Codec(CodecError)
Keypair generation failed inside the codec layer.
Store(StoreError)
Underlying store failure.
Trait Implementations§
Source§impl Debug for ServicePrincipalError
impl Debug for ServicePrincipalError
Source§impl Display for ServicePrincipalError
impl Display for ServicePrincipalError
Source§impl Error for ServicePrincipalError
impl Error for ServicePrincipalError
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()