summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2020-10-30 13:01:03 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2020-10-30 17:24:04 +0200
commit264101909354707f613c3ecc2d8d0ad0ddb7fa77 (patch)
tree3ccc40a56e5ace562257d70002b7f88dab26b902 /src
parent915add35f4ae41c513534bdc5e159872cf2f1ff6 (diff)
downloadpysaml2-264101909354707f613c3ecc2d8d0ad0ddb7fa77.tar.gz
Remove the metadata_construction param
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/saml2/config.py26
-rw-r--r--src/saml2/metadata.py2
2 files changed, 22 insertions, 6 deletions
diff --git a/src/saml2/config.py b/src/saml2/config.py
index fb35ebaa..f28d7748 100644
--- a/src/saml2/config.py
+++ b/src/saml2/config.py
@@ -272,15 +272,22 @@ class Config(object):
policy_conf = spec.get("policy")
self.setattr(srv, "policy", Policy(policy_conf, self.metadata))
- def load(self, cnf, metadata_construction=False):
+ def load(self, cnf, metadata_construction=None):
""" The base load method, loads the configuration
:param cnf: The configuration as a dictionary
- :param metadata_construction: Is this only to be able to construct
- metadata. If so some things can be left out.
:return: The Configuration instance
"""
+ if metadata_construction is not None:
+ warn_msg = (
+ "The metadata_construction parameter for saml2.config.Config.load "
+ "is deprecated and ignored; "
+ "instead, initialize the Policy object setting the mds param."
+ )
+ logger.warning(warn_msg)
+ _warn(warn_msg, DeprecationWarning)
+
for arg in COMMON_ARGS:
if arg == "virtual_organization":
if "virtual_organization" in cnf:
@@ -338,12 +345,21 @@ class Config(object):
return importlib.import_module(tail)
- def load_file(self, config_filename, metadata_construction=False):
+ def load_file(self, config_filename, metadata_construction=None):
+ if metadata_construction is not None:
+ warn_msg = (
+ "The metadata_construction parameter for saml2.config.Config.load_file "
+ "is deprecated and ignored; "
+ "instead, initialize the Policy object setting the mds param."
+ )
+ logger.warning(warn_msg)
+ _warn(warn_msg, DeprecationWarning)
+
if config_filename.endswith(".py"):
config_filename = config_filename[:-3]
mod = self._load(config_filename)
- return self.load(copy.deepcopy(mod.CONFIG), metadata_construction)
+ return self.load(copy.deepcopy(mod.CONFIG))
def load_metadata(self, metadata_conf):
""" Loads metadata into an internal structure """
diff --git a/src/saml2/metadata.py b/src/saml2/metadata.py
index 50b4ff71..e7ab6011 100644
--- a/src/saml2/metadata.py
+++ b/src/saml2/metadata.py
@@ -89,7 +89,7 @@ def create_metadata_string(configfile, config=None, valid=None, cert=None,
if config is None:
if configfile.endswith(".py"):
configfile = configfile[:-3]
- config = Config().load_file(configfile, metadata_construction=True)
+ config = Config().load_file(configfile)
eds.append(entity_descriptor(config))
conf = Config()