#[non_exhaustive]pub enum HttpAuthError {
Show 15 variants
WrongKind(Kind),
MissingUrl,
MissingMethod,
InvalidUrl(UrlError),
InvalidPayloadHashLength(usize),
InvalidPayloadHash(HexError),
HeaderWrongScheme,
HeaderInvalidBase64(DecodeError),
HeaderInvalidUtf8(Utf8Error),
HeaderInvalidEvent(EventError),
HeaderInvalidJson(Error),
ValidationTimestampSkew {
delta_secs: u64,
allowed_secs: u64,
},
ValidationUrlMismatch {
expected: String,
got: String,
},
ValidationMethodMismatch {
expected: String,
got: String,
},
ValidationPayloadMismatch,
}Expand description
Errors raised while building, parsing, or validating an HTTP-auth event.
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.
WrongKind(Kind)
The wrapping event was not kind: 27235.
MissingUrl
u tag was absent.
MissingMethod
method tag was absent.
InvalidUrl(UrlError)
u tag value did not parse.
InvalidPayloadHashLength(usize)
payload hex was the wrong length.
InvalidPayloadHash(HexError)
payload hex did not decode.
HeaderWrongScheme
Authorization header did not start with Nostr .
HeaderInvalidBase64(DecodeError)
Authorization header body was not parseable base64.
HeaderInvalidUtf8(Utf8Error)
Authorization body decoded to non-UTF-8.
HeaderInvalidEvent(EventError)
Authorization body did not deserialise as a Nostr event.
HeaderInvalidJson(Error)
Authorization body JSON was malformed.
ValidationTimestampSkew
created_at skew exceeded skew_secs.
Fields
ValidationUrlMismatch
u tag did not match the request URL.
ValidationMethodMismatch
method tag did not match the request method.
ValidationPayloadMismatch
SHA-256 of the request body did not match payload.
Trait Implementations§
Source§impl Debug for HttpAuthError
impl Debug for HttpAuthError
Source§impl Display for HttpAuthError
impl Display for HttpAuthError
Source§impl Error for HttpAuthError
impl Error for HttpAuthError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for HttpAuthError
impl !UnwindSafe for HttpAuthError
impl Freeze for HttpAuthError
impl Send for HttpAuthError
impl Sync for HttpAuthError
impl Unpin for HttpAuthError
impl UnsafeUnpin for HttpAuthError
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