@@ -29,8 +29,8 @@ use crate::{
2929 commons:: { BindingDestinationType , UserLimitTarget , VirtualHostLimitTarget } ,
3030 path,
3131 requests:: {
32- self , EnforcedLimitParams , ExchangeParams , Permissions , PolicyParams , QueueParams ,
33- RuntimeParameterDefinition , UserParams , VirtualHostParams , XArguments ,
32+ self , BulkUserDelete , EnforcedLimitParams , ExchangeParams , Permissions , PolicyParams ,
33+ QueueParams , RuntimeParameterDefinition , UserParams , VirtualHostParams , XArguments ,
3434 } ,
3535 responses:: { self , BindingInfo , DefinitionSet } ,
3636} ;
@@ -241,6 +241,16 @@ where
241241 Ok ( response)
242242 }
243243
244+ /// Lists users in the internal database that do not have access
245+ /// to any virtual hosts.
246+ pub async fn list_users_without_permissions ( & self ) -> Result < Vec < responses:: User > > {
247+ let response = self
248+ . http_get ( "users/without-permissions" , None , None )
249+ . await ?;
250+ let response = response. json ( ) . await ?;
251+ Ok ( response)
252+ }
253+
244254 /// Lists all client connections across the cluster.
245255 pub async fn list_connections ( & self ) -> Result < Vec < responses:: Connection > > {
246256 let response = self . http_get ( "connections" , None , None ) . await ?;
@@ -614,6 +624,14 @@ where
614624 Ok ( ( ) )
615625 }
616626
627+ pub async fn delete_users ( & self , usernames : Vec < & str > ) -> Result < ( ) > {
628+ let delete = BulkUserDelete { usernames } ;
629+ let _response = self
630+ . http_post ( path ! ( "users" , "bulk-delete" ) , & delete, None , None )
631+ . await ?;
632+ Ok ( ( ) )
633+ }
634+
617635 pub async fn clear_permissions (
618636 & self ,
619637 vhost : & str ,
0 commit comments