summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2020-10-25 20:35:45 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2020-10-30 12:55:26 +0200
commit2ae277e42dc0c9ae002f743e0cc396b0aa7e55d5 (patch)
tree63ee6b8c27b5e8bf789f786e14e87c3cf8df06c1
parentc2233f8c8fae87bc0f075bbb1f6f16183cfbeab8 (diff)
downloadpysaml2-2ae277e42dc0c9ae002f743e0cc396b0aa7e55d5.tar.gz
Handle complex configs in the same place
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rw-r--r--src/saml2/config.py28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/saml2/config.py b/src/saml2/config.py
index 5f1ccd66..fabe124c 100644
--- a/src/saml2/config.py
+++ b/src/saml2/config.py
@@ -258,21 +258,13 @@ class Config(object):
self.setattr(typ, arg, _val)
self.context = typ
- self.load_complex(cnf, typ)
self.context = self.def_context
- def load_complex(self, cnf, typ=""):
- try:
- self.setattr(typ, "policy", Policy(cnf["policy"], config=self))
- except KeyError:
- pass
-
- # for srv, spec in cnf["service"].items():
- # try:
- # self.setattr(srv, "policy",
- # Policy(cnf["service"][srv]["policy"]))
- # except KeyError:
- # pass
+ def load_complex(self, cnf):
+ acs = ac_factory(cnf.get("attribute_map_dir"))
+ if not acs:
+ raise ConfigurationError("No attribute converters, something is wrong!!")
+ self.setattr("", "attribute_converters", acs)
def unicode_convert(self, item):
try:
@@ -339,16 +331,6 @@ class Config(object):
if "extensions" in cnf:
self.do_extensions(cnf["extensions"])
- acs = ac_factory(cnf.get("attribute_map_dir"))
- if not acs:
- raise ConfigurationError("No attribute converters, something is wrong!!")
- self.setattr("", "attribute_converters", acs)
-
- try:
- self.setattr("", "metadata", self.load_metadata(cnf["metadata"]))
- except KeyError:
- pass
-
self.load_complex(cnf)
self.context = self.def_context