Skip to content

Commit d024eef

Browse files
committed
Handle complex configs in the same place
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 4757940 commit d024eef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/saml2/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,15 @@ def load_complex(self, cnf):
266266
raise ConfigurationError("No attribute converters, something is wrong!!")
267267
self.setattr("", "attribute_converters", acs)
268268

269+
try:
270+
self.setattr("", "metadata", self.load_metadata(cnf["metadata"]))
271+
except KeyError:
272+
pass
273+
274+
for srv, spec in cnf.get("service", {}).items():
275+
policy_conf = spec.get("policy")
276+
self.setattr(srv, "policy", Policy(policy_conf, self.metadata))
277+
269278
def load(self, cnf, metadata_construction=False):
270279
""" The base load method, loads the configuration
271280

0 commit comments

Comments
 (0)