broadcast_auth/error.rs
1//! Error type for the shared auth layer.
2
3/// Result alias for the crate's fallible operations.
4pub type Result<T> = core::result::Result<T, Error>;
5
6/// Errors produced by challenge parsing / response computation.
7#[non_exhaustive]
8#[derive(Debug, thiserror::Error)]
9pub enum Error {
10 /// The `WWW-Authenticate` challenge value could not be parsed (RFC 7235 /
11 /// RFC 2326 §14 for a Basic or Digest challenge).
12 #[error("failed to parse challenge: {0}")]
13 ChallengeParse(String),
14
15 /// The `Authorization` response value could not be computed from the
16 /// parsed challenge and credentials (e.g. an unsupported Digest
17 /// `algorithm`/`qop`).
18 #[error("failed to compute Authorization response: {0}")]
19 ResponseCompute(String),
20}