summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2018-11-28 10:34:59 +0200
committerGitHub <noreply@github.com>2018-11-28 10:34:59 +0200
commit6b24eb2a5d726cea210339f262ccd0058b223dea (patch)
tree9755ac900bdf7ce4a5bc5a52b563ddd3613930a4
parent0c1e26a6dd8759962857a30ebd67f63fe9e881ee (diff)
parent925fd0d3b1243d83eaf3719d757d2f0e9cefb13d (diff)
downloadpysaml2-6b24eb2a5d726cea210339f262ccd0058b223dea.tar.gz
Merge pull request #573 from skanct/ck_add_entity_category_support_attribute
Add metadata attribute for entity_category_support
-rw-r--r--src/saml2/config.py2
-rw-r--r--src/saml2/metadata.py9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/saml2/config.py b/src/saml2/config.py
index 4278935f..9b7debcb 100644
--- a/src/saml2/config.py
+++ b/src/saml2/config.py
@@ -54,6 +54,7 @@ COMMON_ARGS = [
"session_storage",
"assurance_certification",
"entity_category",
+ "entity_category_support",
"xmlsec_path",
"extension_schemas",
"cert_handler_extra_class",
@@ -224,6 +225,7 @@ class Config(object):
self.name_qualifier = ""
self.assurance_certification = []
self.entity_category = []
+ self.entity_category_support = []
self.crypto_backend = 'xmlsec1'
self.id_attr_name = None
self.scope = ""
diff --git a/src/saml2/metadata.py b/src/saml2/metadata.py
index c1828cea..f02d234f 100644
--- a/src/saml2/metadata.py
+++ b/src/saml2/metadata.py
@@ -724,6 +724,15 @@ def entity_descriptor(confd):
)
_add_attr_to_entity_attributes(entd.extensions, attr)
+ if confd.entity_category_support:
+ if not entd.extensions:
+ entd.extensions = md.Extensions()
+ ava = [AttributeValue(text=c) for c in confd.entity_category_support]
+ attr = Attribute(
+ attribute_value=ava, name="http://macedir.org/entity-category-support"
+ )
+ _add_attr_to_entity_attributes(entd.extensions, attr)
+
for item in algorithm_support_in_metadata(confd.xmlsec_binary):
if not entd.extensions:
entd.extensions = md.Extensions()