This maybe a step in the right direction.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user