@@ -533,6 +533,17 @@ def do_idpsso_descriptor(conf, cert=None, enc_cert=None):
533
533
idpsso = md .IDPSSODescriptor ()
534
534
idpsso .protocol_support_enumeration = samlp .NAMESPACE
535
535
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
+
536
547
endps = conf .getattr ("endpoints" , "idp" )
537
548
if endps :
538
549
for (endpoint , instlist ) in do_endpoints (endps , ENDPOINTS ["idp" ]).items ():
@@ -578,6 +589,17 @@ def do_aa_descriptor(conf, cert=None, enc_cert=None):
578
589
aad = md .AttributeAuthorityDescriptor ()
579
590
aad .protocol_support_enumeration = samlp .NAMESPACE
580
591
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
+
581
603
endps = conf .getattr ("endpoints" , "aa" )
582
604
583
605
if endps :
@@ -606,6 +628,17 @@ def do_aq_descriptor(conf, cert=None, enc_cert=None):
606
628
aqs = md .AuthnAuthorityDescriptor ()
607
629
aqs .protocol_support_enumeration = samlp .NAMESPACE
608
630
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
+
609
642
endps = conf .getattr ("endpoints" , "aq" )
610
643
611
644
if endps :
@@ -626,6 +659,17 @@ def do_pdp_descriptor(conf, cert=None, enc_cert=None):
626
659
627
660
pdp .protocol_support_enumeration = samlp .NAMESPACE
628
661
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
+
629
673
endps = conf .getattr ("endpoints" , "pdp" )
630
674
631
675
if endps :
@@ -675,6 +719,17 @@ def entity_descriptor(confd):
675
719
if confd .contact_person is not None :
676
720
entd .contact_person = do_contact_persons_info (confd .contact_person )
677
721
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
+
678
733
if confd .entity_attributes :
679
734
if not entd .extensions :
680
735
entd .extensions = md .Extensions ()
0 commit comments