Skip to content

Commit

Permalink
fix: add back AuthBackend which is required by custom auth backend (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 authored Jul 23, 2024
1 parent 2ae2a66 commit 49f22f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/auth/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use common_error::ext::ErrorExt;
use common_error::ext::{BoxedError, ErrorExt};
use common_error::status_code::StatusCode;
use common_macro::stack_trace_debug;
use snafu::{Location, Snafu};
Expand All @@ -38,6 +38,14 @@ pub enum Error {
location: Location,
},

#[snafu(display("Authentication source failure"))]
AuthBackend {
#[snafu(implicit)]
location: Location,
#[snafu(source)]
source: BoxedError,
},

#[snafu(display("User not found, username: {}", username))]
UserNotFound { username: String },

Expand Down Expand Up @@ -81,6 +89,7 @@ impl ErrorExt for Error {
Error::FileWatch { .. } => StatusCode::InvalidArguments,
Error::InternalState { .. } => StatusCode::Unexpected,
Error::Io { .. } => StatusCode::StorageUnavailable,
Error::AuthBackend { .. } => StatusCode::Internal,

Error::UserNotFound { .. } => StatusCode::UserNotFound,
Error::UnsupportedPasswordType { .. } => StatusCode::UnsupportedPasswordType,
Expand Down

0 comments on commit 49f22f0

Please sign in to comment.