use thiserror::Error;
#[derive(Debug, Error)]
pub enum ConfigError {
#[error("Invalid header name for {name}: {source}")]
InvalidHeader {
name: &'static str,
#[source]
source: http::header::InvalidHeaderName,
},
#[error("Invalid base64 encoding for secret: {0}")]
InvalidBase64Secret(#[from] base64::DecodeError),
#[error("Token TTL must be greater than 0, got {0}")]
InvalidTokenTtl(i64),
#[error("Invalid backend host: {0}")]
InvalidBackendHost(String),
#[error("Port must be greater than 0")]
InvalidPort,
#[error("Failed to read key file '{path}': {source}")]
KeyFileError {
path: String,
#[source]
source: std::io::Error,
},
#[error("Failed to extract public key: {0}")]
PublicKeyExtraction(String),
#[error("Consumer info enabled but no secret or public key provided")]
MissingConsumerInfoKey,
}