@@ -533,6 +533,17 @@ def do_idpsso_descriptor(conf, cert=None, enc_cert=None):
533533 idpsso = md .IDPSSODescriptor ()
534534 idpsso .protocol_support_enumeration = samlp .NAMESPACE
535535
536+ exts = conf .getattr ("extensions" , "idp" )
537+ if exts :
538+ if idpsso .extensions is None :
539+ idpsso .extensions = md .Extensions ()
540+
541+ for key , val in exts .items ():
542+ _ext = do_extensions (key , val )
543+ if _ext :
544+ for _e in _ext :
545+ idpsso .extensions .add_extension_element (_e )
546+
536547 endps = conf .getattr ("endpoints" , "idp" )
537548 if endps :
538549 for (endpoint , instlist ) in do_endpoints (endps , ENDPOINTS ["idp" ]).items ():
@@ -578,6 +589,17 @@ def do_aa_descriptor(conf, cert=None, enc_cert=None):
578589 aad = md .AttributeAuthorityDescriptor ()
579590 aad .protocol_support_enumeration = samlp .NAMESPACE
580591
592+ exts = conf .getattr ("extensions" , "aa" )
593+ if exts :
594+ if aad .extensions is None :
595+ aad .extensions = md .Extensions ()
596+
597+ for key , val in exts .items ():
598+ _ext = do_extensions (key , val )
599+ if _ext :
600+ for _e in _ext :
601+ aad .extensions .add_extension_element (_e )
602+
581603 endps = conf .getattr ("endpoints" , "aa" )
582604
583605 if endps :
@@ -606,6 +628,17 @@ def do_aq_descriptor(conf, cert=None, enc_cert=None):
606628 aqs = md .AuthnAuthorityDescriptor ()
607629 aqs .protocol_support_enumeration = samlp .NAMESPACE
608630
631+ exts = conf .getattr ("extensions" , "aa" )
632+ if exts :
633+ if aqs .extensions is None :
634+ aqs .extensions = md .Extensions ()
635+
636+ for key , val in exts .items ():
637+ _ext = do_extensions (key , val )
638+ if _ext :
639+ for _e in _ext :
640+ aqs .extensions .add_extension_element (_e )
641+
609642 endps = conf .getattr ("endpoints" , "aq" )
610643
611644 if endps :
@@ -626,6 +659,17 @@ def do_pdp_descriptor(conf, cert=None, enc_cert=None):
626659
627660 pdp .protocol_support_enumeration = samlp .NAMESPACE
628661
662+ exts = conf .getattr ("extensions" , "pdp" )
663+ if exts :
664+ if pdp .extensions is None :
665+ pdp .extensions = md .Extensions ()
666+
667+ for key , val in exts .items ():
668+ _ext = do_extensions (key , val )
669+ if _ext :
670+ for _e in _ext :
671+ pdp .extensions .add_extension_element (_e )
672+
629673 endps = conf .getattr ("endpoints" , "pdp" )
630674
631675 if endps :
@@ -675,6 +719,17 @@ def entity_descriptor(confd):
675719 if confd .contact_person is not None :
676720 entd .contact_person = do_contact_persons_info (confd .contact_person )
677721
722+ exts = confd .extensions
723+ if exts :
724+ if not entd .extensions :
725+ entd .extensions = md .Extensions ()
726+
727+ for key , val in exts .items ():
728+ _ext = do_extensions (key , val )
729+ if _ext :
730+ for _e in _ext :
731+ entd .extensions .add_extension_element (_e )
732+
678733 if confd .entity_attributes :
679734 if not entd .extensions :
680735 entd .extensions = md .Extensions ()
0 commit comments