diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-10-25 20:35:45 +0200 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-10-30 12:55:26 +0200 |
commit | 2ae277e42dc0c9ae002f743e0cc396b0aa7e55d5 (patch) | |
tree | 63ee6b8c27b5e8bf789f786e14e87c3cf8df06c1 | |
parent | c2233f8c8fae87bc0f075bbb1f6f16183cfbeab8 (diff) | |
download | pysaml2-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.py | 28 |
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 |