diff --git a/rustfs/src/admin/handlers/audit.rs b/rustfs/src/admin/handlers/audit.rs
index d00c7ed49..900bbddbf 100644
--- a/rustfs/src/admin/handlers/audit.rs
+++ b/rustfs/src/admin/handlers/audit.rs
@@ -13,7 +13,7 @@
// limitations under the License.
use crate::admin::{
- auth::validate_admin_request,
+ auth::authorize_admin_request,
handlers::audit_runtime_config::{load_server_config_from_store, update_audit_config_and_reload},
handlers::target_descriptor::{
AdminTargetSpec, EndpointKey, RuntimeHealthStatus, TargetEndpointSource, admin_target_spec_from_builtin,
@@ -23,9 +23,8 @@ use crate::admin::{
},
router::{AdminOperation, Operation, S3Router},
};
-use crate::auth::{check_key_valid, get_session_token};
use crate::server::{
- ADMIN_PREFIX, RemoteAddr, is_audit_module_enabled, refresh_audit_module_enabled, refresh_persisted_module_switches_from_store,
+ ADMIN_PREFIX, is_audit_module_enabled, refresh_audit_module_enabled, refresh_persisted_module_switches_from_store,
};
use http::StatusCode;
use hyper::Method;
@@ -213,14 +212,14 @@ fn audit_target_specs() -> &'static [AdminTargetSpec] {
&AUDIT_TARGET_SPECS
}
+/// The pre-check keeps these endpoints' historical missing-credentials message;
+/// the shared gate reports "get cred failed".
async fn authorize_audit_admin_request(req: &S3Request
, action: AdminAction) -> S3Result<()> {
- let Some(input_cred) = &req.credentials else {
+ if req.credentials.is_none() {
return Err(s3_error!(InvalidRequest, "credentials not found"));
- };
- let (cred, owner) =
- check_key_valid(get_session_token(&req.uri, &req.headers).unwrap_or_default(), &input_cred.access_key).await?;
- let remote_addr = req.extensions.get::