pub enum VerifyError {
Unsigned,
UnknownKid {
kid: String,
},
UnsupportedAlg {
alg: String,
},
Malformed(String),
BadSignature {
kid: String,
},
Stale {
kid: String,
age_ms: i64,
max_age_ms: u128,
},
}Expand description
Why a message was not accepted as backend-authored.
Deliberately distinguishes “carries no signature” from every other case.
During stages 1–2 of the rollout Unsigned is expected and benign, while
the rest mean something is wrong — conflating them would hide a real
failure inside a normal one for the whole migration window.
Variants§
Unsigned
No signature headers at all. Normal until enforcement is switched on.
UnknownKid
Signed, but the kid is not on this agent’s ring.
The operationally dangerous case: an agent that never received a new key looks, from the operator’s side, exactly like a backend that is not sending commands — and a mid-rotation fleet is full of agents in that state. Callers must surface this, not just log it locally.
UnsupportedAlg
Signed with an algorithm this build does not implement.
Malformed(String)
Signature header present but not decodable as a signature.
BadSignature
Cryptographically invalid for the bytes received.
Stale
Valid, by a key whose policy bounds how old a signature may be, and
this one is older. Distinct from VerifyError::BadSignature because
the signature is genuine — what failed is the policy, and the two want
different responses.
Trait Implementations§
Source§impl Clone for VerifyError
impl Clone for VerifyError
Source§fn clone(&self) -> VerifyError
fn clone(&self) -> VerifyError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerifyError
impl Debug for VerifyError
Source§impl Display for VerifyError
impl Display for VerifyError
impl Eq for VerifyError
Source§impl Error for VerifyError
impl Error for VerifyError
1.30.0 · 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()
Source§impl PartialEq for VerifyError
impl PartialEq for VerifyError
impl StructuralPartialEq for VerifyError
Auto Trait Implementations§
impl Freeze for VerifyError
impl RefUnwindSafe for VerifyError
impl Send for VerifyError
impl Sync for VerifyError
impl Unpin for VerifyError
impl UnsafeUnpin for VerifyError
impl UnwindSafe for VerifyError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.