chore: minor auth crate change (#2176)

* chore: pub auth_mysql

* chore: pub all error

* chore: remove back to error

* chore: wrap failed permission check result to err

* chore: minor change
This commit is contained in:
shuiyisong
2023-08-15 10:49:22 +00:00
committed by GitHub
parent 24dc827ff9
commit c8cde704cf
12 changed files with 117 additions and 102 deletions
+6 -2
View File
@@ -84,6 +84,8 @@ pub enum StatusCode {
InvalidAuthHeader = 7004,
/// Illegal request to connect catalog-schema
AccessDenied = 7005,
/// User is not authorized to perform the operation
PermissionDenied = 7006,
// ====== End of auth related status code =====
}
@@ -120,7 +122,8 @@ impl StatusCode {
| StatusCode::UserPasswordMismatch
| StatusCode::AuthHeaderNotFound
| StatusCode::InvalidAuthHeader
| StatusCode::AccessDenied => false,
| StatusCode::AccessDenied
| StatusCode::PermissionDenied => false,
}
}
@@ -151,7 +154,8 @@ impl StatusCode {
| StatusCode::UserPasswordMismatch
| StatusCode::AuthHeaderNotFound
| StatusCode::InvalidAuthHeader
| StatusCode::AccessDenied => false,
| StatusCode::AccessDenied
| StatusCode::PermissionDenied => false,
}
}