use url::Url;
#[derive(Debug, thiserror::Error, Clone)]
pub enum VerifyError {
#[error(transparent)]
ValidationFailed(#[from] ValidationError),
#[error(transparent)]
NotConnected(#[from] ConnectionError),
}
#[derive(Debug, thiserror::Error, Clone)]
pub enum ValidationError {
#[error("the token is broken")]
Broken,
#[error("the pubkey not found")]
PubkeyNotFound,
#[error("the token is invalid")]
Invalid,
}
#[derive(Debug, thiserror::Error, Clone)]
pub enum ConnectionError {
#[error(transparent)]
FetchError(#[from] FetchError),
#[error("the issuer does not support the required features")]
UnmatchConfiguration,
#[error("the openid-configuration is broken.")]
BrokenConfiguration,
}
#[derive(Debug, thiserror::Error, Clone)]
pub enum FetchError {
#[error("could not fetch the URL: {0}")]
NetworkError(Url),
#[error("could not parse the data")]
ParseError,
}