github_oidc/
errors.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4#[non_exhaustive]
5pub enum GitHubOIDCError {
6    #[error("Invalid token format. Expected a JWT.")]
7    InvalidTokenFormat,
8
9    #[error("Failed to decode header: {0}")]
10    HeaderDecodingError(String),
11
12    #[error("Matching key not found in JWKS")]
13    KeyNotFound,
14
15    #[error("Failed to create decoding key: {0}")]
16    DecodingKeyCreationError(String),
17
18    #[error("Failed to decode token: {0}")]
19    TokenDecodingError(String),
20
21    #[error("Token is not from the expected organization")]
22    OrganizationMismatch,
23
24    #[error("Token is not from the expected repository")]
25    RepositoryMismatch,
26
27    #[error("Failed to fetch JWKS: {0}")]
28    JWKSFetchError(String),
29
30    #[error("Failed to parse JWKS: {0}")]
31    JWKSParseError(String),
32}