The smokesignal.events web application
1use thiserror::Error;
2
3/// Represents errors that can occur during token refresh operations.
4///
5/// These errors are related to the process of refreshing OAuth access tokens
6/// using refresh tokens, including cryptographic operations and queue management.
7#[derive(Debug, Error)]
8pub enum RefreshError {
9 /// Error when the secret signing key cannot be found.
10 ///
11 /// This error occurs when attempting to refresh a token but the necessary
12 /// secret key for signing the request is not available in the configuration.
13 #[error("error-smokesignal-refresh-1 Secret signing key not found")]
14 SecretSigningKeyNotFound,
15
16 /// Error when creating a DPoP proof for token refresh fails.
17 ///
18 /// This error occurs when there is an issue with the cryptographic operations
19 /// required to generate a DPoP (Demonstrating Proof-of-Possession) proof.
20 #[error("error-smokesignal-refresh-2 Failed to create DPoP proof: {0:?}")]
21 DpopProofCreationFailed(elliptic_curve::Error),
22
23 /// Error when a session cannot be placed in the refresh queue.
24 ///
25 /// This error occurs when there is an issue with the Redis-backed queue
26 /// used to manage session refresh operations.
27 #[error("error-smokesignal-refresh-3 Failed to place session group into refresh queue: {0:?}")]
28 PlaceInRefreshQueueFailed(deadpool_redis::redis::RedisError),
29
30 /// Error when the identity document cannot be found.
31 ///
32 /// This error occurs when attempting to refresh a token but the necessary
33 /// identity document for the user is not available in storage.
34 #[error("error-smokesignal-refresh-4 Identity document not found")]
35 IdentityDocumentNotFound,
36}