Skip to content

Commit c30a4e0

Browse files
committed
Add mdstore method to extract assurance certifications
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent e23f11a commit c30a4e0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/saml2/mdstore.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666

6767
ENTITY_CATEGORY = "http://macedir.org/entity-category"
6868
ENTITY_CATEGORY_SUPPORT = "http://macedir.org/entity-category-support"
69+
ASSURANCE_CERTIFICATION = "urn:oasis:names:tc:SAML:attribute:assurance-certification"
6970

7071
REQ2SRV = {
7172
# IDP
@@ -1243,6 +1244,15 @@ def supported_entity_categories(self, entity_id):
12431244
attributes = self.entity_attributes(entity_id)
12441245
return attributes.get(ENTITY_CATEGORY_SUPPORT, [])
12451246

1247+
def assurance_certifications(self, entity_id):
1248+
assurance_certifications = (
1249+
certification
1250+
for name, values in self.entity_attributes(entity_id).items()
1251+
if name == ASSURANCE_CERTIFICATION
1252+
for certification in values
1253+
)
1254+
return assurance_certifications
1255+
12461256
def entity_attributes(self, entity_id):
12471257
"""
12481258
Get all entity attributes for an entry in the metadata.

0 commit comments

Comments
 (0)