diff --git a/rustfs/src/admin/handlers/mod.rs b/rustfs/src/admin/handlers/mod.rs index a187aea9f..e53a76d30 100644 --- a/rustfs/src/admin/handlers/mod.rs +++ b/rustfs/src/admin/handlers/mod.rs @@ -38,6 +38,7 @@ pub mod trace; pub mod user; pub mod user_iam; pub mod user_lifecycle; +pub mod user_policy_binding; #[cfg(test)] mod tests { diff --git a/rustfs/src/admin/handlers/user.rs b/rustfs/src/admin/handlers/user.rs index c2d0c6f5b..1bab138c0 100644 --- a/rustfs/src/admin/handlers/user.rs +++ b/rustfs/src/admin/handlers/user.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{account_info, event, group, policies, service_account, user_iam, user_lifecycle}; +use super::{account_info, group, service_account, user_iam, user_lifecycle, user_policy_binding}; use crate::{ admin::{ auth::validate_admin_request, @@ -61,8 +61,7 @@ pub fn register_user_route(r: &mut S3Router) -> std::io::Result< group::register_group_management_route(r)?; service_account::register_service_account_route(r)?; user_iam::register_user_iam_route(r)?; - policies::register_iam_policy_route(r)?; - event::register_notification_target_route(r)?; + user_policy_binding::register_user_policy_binding_route(r)?; Ok(()) } diff --git a/rustfs/src/admin/handlers/user_policy_binding.rs b/rustfs/src/admin/handlers/user_policy_binding.rs new file mode 100644 index 000000000..5b38eef28 --- /dev/null +++ b/rustfs/src/admin/handlers/user_policy_binding.rs @@ -0,0 +1,22 @@ +// Copyright 2024 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::{event, policies}; +use crate::admin::router::{AdminOperation, S3Router}; + +pub fn register_user_policy_binding_route(r: &mut S3Router) -> std::io::Result<()> { + policies::register_iam_policy_route(r)?; + event::register_notification_target_route(r)?; + Ok(()) +}