summaryrefslogtreecommitdiff
path: root/tests/test_30_mdstore.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_30_mdstore.py')
-rw-r--r--tests/test_30_mdstore.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_30_mdstore.py b/tests/test_30_mdstore.py
index 1c67a701..013a6062 100644
--- a/tests/test_30_mdstore.py
+++ b/tests/test_30_mdstore.py
@@ -189,6 +189,12 @@ METADATACONF = {
"metadata": [(full_path("empty_metadata_file.xml"),)],
}
],
+ "17": [
+ {
+ "class": "saml2.mdstore.MetaDataFile",
+ "metadata": [(full_path("entity_esi_and_coco_sp.xml"),)],
+ }
+ ],
}
@@ -654,6 +660,17 @@ def test_registration_info_no_policy():
assert registration_info["registration_policy"] == {}
+def test_subject_id_requirement():
+ mds = MetadataStore(ATTRCONV, sec_config, disable_ssl_certificate_validation=True)
+ mds.imp(METADATACONF["17"])
+ required_subject_id = mds.subject_id_requirement(entity_id="https://esi-coco.example.edu/saml2/metadata/")
+ assert required_subject_id["__class__"] == "urn:oasis:names:tc:SAML:2.0:metadata&RequestedAttribute"
+ assert required_subject_id["name"] == "urn:oasis:names:tc:SAML:attribute:pairwise-id"
+ assert required_subject_id["name_format"] == "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ assert required_subject_id["friendly_name"] == "pairwise-id"
+ assert required_subject_id["is_required"] == "true"
+
+
def test_extension():
mds = MetadataStore(ATTRCONV, None)
# use ordered dict to force expected entity to be last