1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum DpopError {
5 #[error("Multiple DPoP headers")]
6 MultipleDpopHeaders,
7 #[error("Invalid DPoP header")]
8 InvalidDpopHeader,
9 #[error("Missing DPoP header")]
10 MissingDpopHeader,
11 #[error("missing DPoP header")]
12 MissingHeader,
13 #[error("malformed DPoP JWT")]
14 MalformedJws,
15 #[error("Invalid algorithm")]
16 InvalidAlg(String),
17 #[error("unsupported DPoP alg")]
18 UnsupportedAlg(String),
19 #[error("invalid DPoP signature")]
20 InvalidSignature,
21 #[error("bad JWK: {0}")]
22 BadJwk(&'static str),
23 #[error("missing claim: {0}")]
24 MissingClaim(&'static str),
25 #[error("Invaluid method")]
26 InvalidMethod,
27 #[error("htm mismatch")]
28 HtmMismatch,
29 #[error("malformed htu")]
30 MalformedHtu,
31 #[error("htu mismatch")]
32 HtuMismatch,
33 #[error("Malformed ath")]
34 AthMalformed,
35 #[error("missing ath")]
36 MissingAth,
37 #[error("ath mismatch")]
38 AthMismatch,
39 #[error("iat too far in future")]
40 FutureSkew,
41 #[error("DPoP proof too old")]
42 Stale,
43 #[error("DPoP replay detected")]
44 Replay,
45 #[error("storage error: {0}")]
46 Store(Box<dyn std::error::Error + Send + Sync>),
47 #[error("Jti too long")]
48 JtiTooLong,
49 #[error("Use Dpop nonce")]
50 UseDpopNonce { nonce: String },
51 #[error("Missing Nonce")]
52 MissingNonce,
53 #[error("Nonce mismatch")]
54 NonceMismatch,
55 #[error("Nonce is stale")]
56 NonceStale,
57}