mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 15:16:56 +00:00
fix(auth): isolate embedded IAM contexts (#5704)
This commit is contained in:
@@ -168,6 +168,15 @@ pub async fn build_iam_sys(ecstore: Arc<IamStore>) -> Result<Arc<IamSys<ObjectSt
|
||||
Ok(Arc::new(IamSys::new(cache_manager)))
|
||||
}
|
||||
|
||||
/// Build an IAM system for an application context and publish the first one
|
||||
/// as the ambient compatibility default.
|
||||
#[instrument(skip(ecstore))]
|
||||
pub async fn init_iam_sys_for_context(ecstore: Arc<IamStore>) -> Result<Arc<IamSys<ObjectStore>>> {
|
||||
let iam_instance = build_iam_sys(ecstore).await?;
|
||||
let _ = IAM_SYS.set(iam_instance.clone());
|
||||
Ok(iam_instance)
|
||||
}
|
||||
|
||||
#[instrument(skip(ecstore))]
|
||||
pub async fn init_iam_sys(ecstore: Arc<IamStore>) -> Result<Arc<IamSys<ObjectStore>>> {
|
||||
if let Some(existing) = IAM_SYS.get() {
|
||||
|
||||
Reference in New Issue
Block a user