summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2022-06-21 01:56:44 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2022-06-21 01:57:02 +0300
commit82c25f2994fcc6ee88cef468e28b4f630c8cca4e (patch)
treee7085ca67482b88b3e96c8454a282358d64802c5
parent8089049ce5d482f6488d1ccf7314cea9a3d27c92 (diff)
downloadpysaml2-82c25f2994fcc6ee88cef468e28b4f630c8cca4e.tar.gz
Fix saml2.mdstore.MetadataStore::sbibmd_scopes as shibmd_scopes
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rw-r--r--src/saml2/mdstore.py9
-rw-r--r--tests/test_30_mdstore.py8
2 files changed, 13 insertions, 4 deletions
diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py
index 7aa458f8..ce4c8789 100644
--- a/src/saml2/mdstore.py
+++ b/src/saml2/mdstore.py
@@ -1543,6 +1543,15 @@ class MetadataStore(MetaData):
return elements
def sbibmd_scopes(self, entity_id, typ=None):
+ warn_msg = (
+ "`saml2.mdstore.MetadataStore::sbibmd_scopes` method is deprecated; "
+ "instead, use `saml2.mdstore.MetadataStore::shibmd_scopes`."
+ )
+ logger.warning(warn_msg)
+ _warn(warn_msg, DeprecationWarning)
+ return self.shibmd_scopes(entity_id, typ=typ)
+
+ def shibmd_scopes(self, entity_id, typ=None):
try:
md = self[entity_id]
except KeyError:
diff --git a/tests/test_30_mdstore.py b/tests/test_30_mdstore.py
index b35a206f..1531f058 100644
--- a/tests/test_30_mdstore.py
+++ b/tests/test_30_mdstore.py
@@ -666,7 +666,7 @@ def test_shibmd_scope_no_regex_no_descriptor_type():
mds = MetadataStore(ATTRCONV, sec_config, disable_ssl_certificate_validation=True)
mds.imp(METADATACONF["15"])
- scopes = mds.sbibmd_scopes(entity_id='http://example.com/saml2/idp.xml')
+ scopes = mds.shibmd_scopes(entity_id='http://example.com/saml2/idp.xml')
all_scopes = list(scopes)
expected = [
@@ -676,7 +676,7 @@ def test_shibmd_scope_no_regex_no_descriptor_type():
},
{
"regexp": True,
- "text": regex_compile("descriptor-example[^0-9]*\.org"),
+ "text": regex_compile(r"descriptor-example[^0-9]*\.org"),
},
]
assert len(all_scopes) == 2
@@ -687,7 +687,7 @@ def test_shibmd_scope_no_regex_all_descriptors():
mds = MetadataStore(ATTRCONV, sec_config, disable_ssl_certificate_validation=True)
mds.imp(METADATACONF["15"])
- scopes = mds.sbibmd_scopes(entity_id='http://example.com/saml2/idp.xml', typ="idpsso_descriptor")
+ scopes = mds.shibmd_scopes(entity_id='http://example.com/saml2/idp.xml', typ="idpsso_descriptor")
all_scopes = list(scopes)
expected = [
{
@@ -696,7 +696,7 @@ def test_shibmd_scope_no_regex_all_descriptors():
},
{
"regexp": True,
- "text": regex_compile("descriptor-example[^0-9]*\.org"),
+ "text": regex_compile(r"descriptor-example[^0-9]*\.org"),
},
{
"regexp": False,