#[non_exhaustive]pub enum WebhookError {
InvalidSecret(String),
MissingHeader(&'static str),
MalformedHeader {
header: &'static str,
reason: String,
},
SignatureMismatch,
TimestampExpired {
age_seconds: u64,
max_age_seconds: u64,
},
TimestampInFuture {
skew_seconds: u64,
max_skew_seconds: u64,
},
Replayed(String),
}Expand description
Why a webhook secret, signature, or delivery was rejected.
The reason is for logs. An HTTP endpoint answers every variant with a bare 401, so
a caller cannot probe which part of a credential was wrong.
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.
InvalidSecret(String)
The secret is empty or not valid base64.
MissingHeader(&'static str)
A required header is absent or not valid UTF-8.
MalformedHeader
A header is present but malformed.
SignatureMismatch
No v1 signature matches any configured secret.
TimestampExpired
The delivery was signed longer ago than the tolerance.
Fields
TimestampInFuture
The delivery timestamp is further in the future than the tolerance.
Fields
Replayed(String)
A delivery with this webhook-id was already accepted.
Implementations§
Trait Implementations§
Source§impl Clone for WebhookError
impl Clone for WebhookError
Source§impl Debug for WebhookError
impl Debug for WebhookError
Source§impl Display for WebhookError
impl Display for WebhookError
impl Eq for WebhookError
Source§impl Error for WebhookError
impl Error for WebhookError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<WebhookError> for AdkError
impl From<WebhookError> for AdkError
Source§fn from(error: WebhookError) -> Self
fn from(error: WebhookError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for WebhookError
impl PartialEq for WebhookError
impl StructuralPartialEq for WebhookError
Auto Trait Implementations§
impl Forget for WebhookError
impl Freeze for WebhookError
impl Move for WebhookError
impl RefUnwindSafe for WebhookError
impl Send for WebhookError
impl Sync for WebhookErrorwhere
RawVecInner: Sync,
impl Unpin for WebhookError
impl UnsafeUnpin for WebhookError
impl UnwindSafe for WebhookError
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
Mutably borrows from an owned value. Read more