File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1919use std:: collections:: HashSet ;
2020
2121use actix_web:: { Responder , web} ;
22- use tokio:: sync:: Mutex ;
2322
2423use crate :: {
25- handlers:: http:: { modal:: utils:: rbac_utils:: get_metadata, rbac:: RBACError } ,
24+ handlers:: http:: {
25+ modal:: utils:: rbac_utils:: get_metadata,
26+ rbac:: { RBACError , UPDATE_LOCK } ,
27+ } ,
2628 rbac:: {
2729 Users ,
2830 map:: roles,
@@ -31,9 +33,6 @@ use crate::{
3133 storage,
3234} ;
3335
34- // async aware lock for updating storage metadata and user map atomicically
35- static UPDATE_LOCK : Mutex < ( ) > = Mutex :: const_new ( ( ) ) ;
36-
3736// Handler for POST /api/v1/user/{username}
3837// Creates a new user by username if it does not exists
3938pub async fn post_user (
Original file line number Diff line number Diff line change 1919use std:: collections:: HashSet ;
2020
2121use actix_web:: { Responder , web} ;
22- use tokio:: sync:: Mutex ;
2322
2423use crate :: {
2524 handlers:: http:: {
@@ -28,7 +27,7 @@ use crate::{
2827 sync_user_deletion_with_ingestors, sync_users_with_roles_with_ingestors,
2928 } ,
3029 modal:: utils:: rbac_utils:: { get_metadata, put_metadata} ,
31- rbac:: RBACError ,
30+ rbac:: { RBACError , UPDATE_LOCK } ,
3231 } ,
3332 rbac:: {
3433 Users ,
@@ -38,9 +37,6 @@ use crate::{
3837 validator,
3938} ;
4039
41- // async aware lock for updating storage metadata and user map atomically
42- static UPDATE_LOCK : Mutex < ( ) > = Mutex :: const_new ( ( ) ) ;
43-
4440// Handler for POST /api/v1/user/{username}
4541// Creates a new user by username if it does not exists
4642pub async fn post_user (
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ use tokio::sync::Mutex;
4343use super :: modal:: utils:: rbac_utils:: { get_metadata, put_metadata} ;
4444
4545// async aware lock for updating storage metadata and user map atomically
46- static UPDATE_LOCK : Mutex < ( ) > = Mutex :: const_new ( ( ) ) ;
46+ pub ( crate ) static UPDATE_LOCK : Mutex < ( ) > = Mutex :: const_new ( ( ) ) ;
4747
4848#[ derive( serde:: Serialize ) ]
4949struct User {
You can’t perform that action at this time.
0 commit comments