@@ -86,7 +86,10 @@ def find_merge_strategy(strategy_name):
8686
8787
8888def parse_saml_metadata (
89- source : BytesIO , opts : ResourceOpts , base_url = None , validation_errors : Optional [Dict [str , Any ]] = None ,
89+ source : BytesIO ,
90+ opts : ResourceOpts ,
91+ base_url = None ,
92+ validation_errors : Optional [Dict [str , Any ]] = None ,
9093):
9194 """Parse a piece of XML and return an EntitiesDescriptor element after validation.
9295
@@ -192,7 +195,10 @@ def _extra_md(_t, info, **kwargs):
192195 location = kwargs .get ('location' )
193196 sp_entity = sp_entities .find ("{%s}EntityDescriptor[@entityID='%s']" % (NS ['md' ], entityID ))
194197 if sp_entity is not None :
195- md_source = sp_entity .find ("{%s}SPSSODescriptor/{%s}Extensions/{%s}TrustInfo/{%s}MetadataSource[@src='%s']" % (NS ['md' ], NS ['md' ], NS ['ti' ], NS ['ti' ], location ))
198+ md_source = sp_entity .find (
199+ "{%s}SPSSODescriptor/{%s}Extensions/{%s}TrustInfo/{%s}MetadataSource[@src='%s']"
200+ % (NS ['md' ], NS ['md' ], NS ['ti' ], NS ['ti' ], location )
201+ )
196202 for e in iter_entities (_t ):
197203 md_source .append (e )
198204 return etree .Element ("{%s}EntitiesDescriptor" % NS ['md' ])
@@ -205,11 +211,14 @@ def _extra_md(_t, info, **kwargs):
205211 entityID = e .get ('entityID' )
206212 info .entities .append (entityID )
207213
208- md_source = e .find ("{%s}SPSSODescriptor/{%s}Extensions/{%s}TrustInfo/{%s}MetadataSource" % (NS ['md' ], NS ['md' ], NS ['ti' ], NS ['ti' ]))
214+ md_source = e .find (
215+ "{%s}SPSSODescriptor/{%s}Extensions/{%s}TrustInfo/{%s}MetadataSource"
216+ % (NS ['md' ], NS ['md' ], NS ['ti' ], NS ['ti' ])
217+ )
209218 if md_source is not None :
210219 location = md_source .attrib .get ('src' )
211220 if location is not None :
212- child_opts = resource .opts .copy (update = {'alias' : entityID })
221+ child_opts = resource .opts .model_copy (update = {'alias' : entityID })
213222 r = resource .add_child (location , child_opts )
214223 kwargs = {
215224 'entityID' : entityID ,
@@ -311,7 +320,7 @@ def parse(self, resource: Resource, content: str) -> EidasMDParserInfo:
311320 info .scheme_territory , location , fp , args .get ('country_code' )
312321 )
313322 )
314- child_opts = resource .opts .copy (update = {'alias' : None })
323+ child_opts = resource .opts .model_copy (update = {'alias' : None })
315324 child_opts .verify = fp
316325 r = resource .add_child (location , child_opts )
317326
@@ -725,7 +734,6 @@ def entity_domains(entity):
725734
726735
727736def entity_extended_display_i18n (entity , default_lang = None ):
728-
729737 name_dict = lang_dict (entity .iter ("{%s}OrganizationName" % NS ['md' ]), lambda e : e .text , default_lang = default_lang )
730738 name_dict .update (
731739 lang_dict (entity .iter ("{%s}OrganizationDisplayName" % NS ['md' ]), lambda e : e .text , default_lang = default_lang )
@@ -981,7 +989,9 @@ def discojson_sp(e, global_trust_info=None, global_md_sources=None):
981989
982990 sp ['entityID' ] = e .get ('entityID' , None )
983991
984- md_sources = e .findall ("{%s}SPSSODescriptor/{%s}Extensions/{%s}TrustInfo/{%s}MetadataSource" % (NS ['md' ], NS ['md' ], NS ['ti' ], NS ['ti' ]))
992+ md_sources = e .findall (
993+ "{%s}SPSSODescriptor/{%s}Extensions/{%s}TrustInfo/{%s}MetadataSource" % (NS ['md' ], NS ['md' ], NS ['ti' ], NS ['ti' ])
994+ )
985995
986996 sp ['extra_md' ] = {}
987997 for md_source in md_sources :
@@ -1041,7 +1051,6 @@ def discojson_sp(e, global_trust_info=None, global_md_sources=None):
10411051
10421052
10431053def discojson_sp_attr (e ):
1044-
10451054 attribute = "https://refeds.org/entity-selection-profile"
10461055 b64_trustinfos = entity_attribute (e , attribute )
10471056 if b64_trustinfos is None :
@@ -1395,7 +1404,7 @@ def get_key(e):
13951404 except AttributeError :
13961405 pass
13971406 except IndexError :
1398- log .warning ("Sort pipe: unable to sort entity by '%s'. " " Entity '%s' has no such value" % (sxp , eid ))
1407+ log .warning ("Sort pipe: unable to sort entity by '%s'. Entity '%s' has no such value" % (sxp , eid ))
13991408 except TypeError :
14001409 pass
14011410
0 commit comments