diff options
author | Christos Kanellopoulos <christos.kanellopoulos@geant.org> | 2018-11-28 08:44:10 +0100 |
---|---|---|
committer | Christos Kanellopoulos <christos.kanellopoulos@geant.org> | 2018-11-28 08:44:10 +0100 |
commit | 925fd0d3b1243d83eaf3719d757d2f0e9cefb13d (patch) | |
tree | 9755ac900bdf7ce4a5bc5a52b563ddd3613930a4 | |
parent | 0c1e26a6dd8759962857a30ebd67f63fe9e881ee (diff) | |
download | pysaml2-925fd0d3b1243d83eaf3719d757d2f0e9cefb13d.tar.gz |
Adds metadata attribute for entity_category_support
-rw-r--r-- | src/saml2/config.py | 2 | ||||
-rw-r--r-- | src/saml2/metadata.py | 9 |
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() |