@@ -122,7 +122,7 @@ def _keyjar(self, keyjar=None, conf=None, entity_id=""):
122122
123123 return keyjar , _uri_path
124124
125- def get_base_url (self , configuration : dict ):
125+ def get_base_url (self , configuration : dict , entity_id : Optional [ str ] = "" ):
126126 raise NotImplementedError ()
127127
128128 def get_id (self , configuration : dict ):
@@ -134,7 +134,10 @@ def add_extra_keys(self, keyjar, id):
134134 def get_jwks (self , keyjar ):
135135 return keyjar .export_jwks ()
136136
137- def handle_keys (self , configuration : dict , keyjar : Optional [KeyJar ] = None ):
137+ def handle_keys (self ,
138+ configuration : dict ,
139+ keyjar : Optional [KeyJar ] = None ,
140+ entity_id : Optional [str ] = "" ):
138141 _jwks = _jwks_uri = None
139142 _id = self .get_id (configuration )
140143 keyjar , uri_path = self ._keyjar (keyjar , configuration , entity_id = _id )
@@ -147,15 +150,19 @@ def handle_keys(self, configuration: dict, keyjar: Optional[KeyJar] = None):
147150 if "jwks_uri" in configuration : # simple
148151 _jwks_uri = configuration .get ("jwks_uri" )
149152 elif uri_path :
150- _base_url = self .get_base_url (configuration )
153+ _base_url = self .get_base_url (configuration , entity_id = entity_id )
151154 _jwks_uri = add_path (_base_url , uri_path )
152155 else : # jwks or nothing
153156 _jwks = self .get_jwks (keyjar )
154157
155158 return {"keyjar" : keyjar , "jwks" : _jwks , "jwks_uri" : _jwks_uri }
156159
157160 def load_conf (
158- self , configuration : dict , supports : dict , keyjar : Optional [KeyJar ] = None
161+ self ,
162+ configuration : dict ,
163+ supports : dict ,
164+ keyjar : Optional [KeyJar ] = None ,
165+ entity_id : Optional [str ] = ""
159166 ) -> KeyJar :
160167 for attr , val in configuration .items ():
161168 if attr in ["preference" , "capabilities" ]:
@@ -167,7 +174,7 @@ def load_conf(
167174
168175 self .locals (configuration )
169176
170- for key , val in self .handle_keys (configuration , keyjar = keyjar ).items ():
177+ for key , val in self .handle_keys (configuration , keyjar = keyjar , entity_id = entity_id ).items ():
171178 if key == "keyjar" :
172179 keyjar = val
173180 elif val :
0 commit comments