refactor(admin): extract user policy binding route registration (#1796)

This commit is contained in:
安正超
2026-02-13 17:11:48 +08:00
committed by GitHub
parent c4a68d3efe
commit 6bf4fd1273
3 changed files with 25 additions and 3 deletions
+1
View File
@@ -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 {
+2 -3
View File
@@ -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<AdminOperation>) -> 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(())
}
@@ -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<AdminOperation>) -> std::io::Result<()> {
policies::register_iam_policy_route(r)?;
event::register_notification_target_route(r)?;
Ok(())
}