summaryrefslogtreecommitdiff
path: root/src/saml2/entity_category/__init__.py
blob: d78e3b995f85fa02afe051945f7fd43ac102f200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
__author__ = 'rolandh'

ENTITYATTRIBUTES = "urn:oasis:names:tc:SAML:metadata:attribute&EntityAttributes"


def entity_categories(md):
    res = []
    if "extensions" in md:
        for elem in md["extensions"]["extension_elements"]:
            if elem["__class__"] == ENTITYATTRIBUTES:
                for attr in elem["attribute"]:
                    res.append(attr["text"])

    return res