@@ -18,27 +18,17 @@ use std::collections::HashSet;
1818use super :: super :: types:: * ;
1919use crate :: assignment:: backend:: RoleCreate ;
2020use crate :: assignment:: { AssignmentProviderError , backend:: AssignmentBackend } ;
21- use crate :: config:: Config ;
2221use crate :: keystone:: ServiceState ;
2322
2423pub ( crate ) mod assignment;
2524pub ( crate ) mod implied_role;
2625pub ( crate ) mod role;
2726
28- #[ derive( Clone , Debug , Default ) ]
29- pub struct SqlBackend {
30- pub config : Config ,
31- }
32-
33- impl SqlBackend { }
27+ #[ derive( Default ) ]
28+ pub struct SqlBackend { }
3429
3530#[ async_trait]
3631impl AssignmentBackend for SqlBackend {
37- /// Set config.
38- fn set_config ( & mut self , config : Config ) {
39- self . config = config;
40- }
41-
4232 /// Check assignment grant.
4333 #[ tracing:: instrument( level = "info" , skip( self , state) ) ]
4434 async fn check_grant (
@@ -76,7 +66,7 @@ impl AssignmentBackend for SqlBackend {
7666 state : & ServiceState ,
7767 id : & ' a str ,
7868 ) -> Result < Option < Role > , AssignmentProviderError > {
79- Ok ( role:: get ( & self . config , & state. db , id) . await ?)
69+ Ok ( role:: get ( & state. db , id) . await ?)
8070 }
8171
8272 /// Expand implied roles.
@@ -118,7 +108,7 @@ impl AssignmentBackend for SqlBackend {
118108 state : & ServiceState ,
119109 params : & RoleListParameters ,
120110 ) -> Result < Vec < Role > , AssignmentProviderError > {
121- Ok ( role:: list ( & self . config , & state. db , params) . await ?)
111+ Ok ( role:: list ( & state. db , params) . await ?)
122112 }
123113
124114 /// List role assignments.
@@ -128,7 +118,7 @@ impl AssignmentBackend for SqlBackend {
128118 state : & ServiceState ,
129119 params : & RoleAssignmentListParameters ,
130120 ) -> Result < Vec < Assignment > , AssignmentProviderError > {
131- Ok ( assignment:: list ( & self . config , & state. db , params) . await ?)
121+ Ok ( assignment:: list ( & state. db , params) . await ?)
132122 }
133123
134124 /// List role assignments for multiple actors/targets.
@@ -138,9 +128,6 @@ impl AssignmentBackend for SqlBackend {
138128 state : & ServiceState ,
139129 params : & RoleAssignmentListForMultipleActorTargetParameters ,
140130 ) -> Result < Vec < Assignment > , AssignmentProviderError > {
141- Ok (
142- assignment:: list_for_multiple_actors_and_targets ( & self . config , & state. db , params)
143- . await ?,
144- )
131+ Ok ( assignment:: list_for_multiple_actors_and_targets ( & state. db , params) . await ?)
145132 }
146133}
0 commit comments