Skip to content

Commit

Permalink
fix: metadata: process extensions also for aa, aq and pdp descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-mencl-eresearch committed Jan 23, 2023
1 parent 2fe02c1 commit 30243a8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/saml2/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,17 @@ def do_aa_descriptor(conf, cert=None, enc_cert=None):
aad = md.AttributeAuthorityDescriptor()
aad.protocol_support_enumeration = samlp.NAMESPACE

exts = conf.getattr("extensions", "aa")
if exts:
if aad.extensions is None:
aad.extensions = md.Extensions()

for key, val in exts.items():
_ext = do_extensions(key, val)
if _ext:
for _e in _ext:
aad.extensions.add_extension_element(_e)

endps = conf.getattr("endpoints", "aa")

if endps:
Expand Down Expand Up @@ -617,6 +628,17 @@ def do_aq_descriptor(conf, cert=None, enc_cert=None):
aqs = md.AuthnAuthorityDescriptor()
aqs.protocol_support_enumeration = samlp.NAMESPACE

exts = conf.getattr("extensions", "aa")
if exts:
if aqs.extensions is None:
aqs.extensions = md.Extensions()

for key, val in exts.items():
_ext = do_extensions(key, val)
if _ext:
for _e in _ext:
aqs.extensions.add_extension_element(_e)

endps = conf.getattr("endpoints", "aq")

if endps:
Expand All @@ -637,6 +659,17 @@ def do_pdp_descriptor(conf, cert=None, enc_cert=None):

pdp.protocol_support_enumeration = samlp.NAMESPACE

exts = conf.getattr("extensions", "pdp")
if exts:
if pdp.extensions is None:
pdp.extensions = md.Extensions()

for key, val in exts.items():
_ext = do_extensions(key, val)
if _ext:
for _e in _ext:
pdp.extensions.add_extension_element(_e)

endps = conf.getattr("endpoints", "pdp")

if endps:
Expand Down

0 comments on commit 30243a8

Please sign in to comment.