mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 18:46:17 +00:00
feat: add IAM export/import
- Add complete IAM configuration export/import functionality with ZIP format - Add new API endpoints for IAM backup and restore operations
This commit is contained in:
@@ -5,6 +5,7 @@ use crate::error::{Error, Result};
|
||||
use crate::manager::IamCache;
|
||||
use crate::manager::extract_jwt_claims;
|
||||
use crate::manager::get_default_policyes;
|
||||
use crate::store::GroupInfo;
|
||||
use crate::store::MappedPolicy;
|
||||
use crate::store::Store;
|
||||
use crate::store::UserType;
|
||||
@@ -59,6 +60,10 @@ impl<T: Store> IamSys<T> {
|
||||
self.store.group_notification_handler(name).await
|
||||
}
|
||||
|
||||
pub async fn load_groups(&self, m: &mut HashMap<String, GroupInfo>) -> Result<()> {
|
||||
self.store.api.load_groups(m).await
|
||||
}
|
||||
|
||||
pub async fn load_policy(&self, name: &str) -> Result<()> {
|
||||
self.store.policy_notification_handler(name).await
|
||||
}
|
||||
@@ -73,6 +78,11 @@ impl<T: Store> IamSys<T> {
|
||||
self.store.user_notification_handler(name, user_type).await
|
||||
}
|
||||
|
||||
pub async fn load_users(&self, user_type: UserType, m: &mut HashMap<String, UserIdentity>) -> Result<()> {
|
||||
self.store.api.load_users(user_type, m).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn load_service_account(&self, name: &str) -> Result<()> {
|
||||
self.store.user_notification_handler(name, UserType::Svc).await
|
||||
}
|
||||
@@ -106,6 +116,15 @@ impl<T: Store> IamSys<T> {
|
||||
})
|
||||
}
|
||||
|
||||
pub async fn load_mapped_policys(
|
||||
&self,
|
||||
user_type: UserType,
|
||||
is_group: bool,
|
||||
m: &mut HashMap<String, MappedPolicy>,
|
||||
) -> Result<()> {
|
||||
self.store.api.load_mapped_policys(user_type, is_group, m).await
|
||||
}
|
||||
|
||||
pub async fn list_polices(&self, bucket_name: &str) -> Result<HashMap<String, Policy>> {
|
||||
self.store.list_polices(bucket_name).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user