This maybe a step in the right direction.

This commit is contained in:
2026-10-10 17:52:24 +02:00
parent 94b2f23a59
commit d6bb67721e
3 changed files with 117 additions and 134 deletions
@@ -52,12 +52,3 @@ pub enum BearerError {
#[error(transparent)]
Repository(#[from] RepositoryError),
}
impl crate::error::ClientError for BearerError {
fn client_error_message(&self) -> &'static str {
match self {
BearerError::InvalidCredentials => "Invalid credentials",
BearerError::Repository(_) => "Repository error",
}
}
}
@@ -75,18 +75,6 @@ pub enum AuthHeaderError {
EmptyToken,
}
impl crate::error::ClientError for AuthHeaderError {
fn client_error_message(&self) -> &'static str {
match self {
AuthHeaderError::Missing => "Missing authorization header",
AuthHeaderError::NotAscii(_) => "Invalid authorization header encoding",
AuthHeaderError::MalformedValue => "Malformed authorization header",
AuthHeaderError::EmptyScheme => "Empty authorization scheme",
AuthHeaderError::EmptyToken => "Empty authorization token",
}
}
}
impl IntoResponse for AuthHeaderError {
fn into_response(self) -> axum::response::Response {
Into::<super::AuthError>::into(self).into_response()