summaryrefslogtreecommitdiff
path: root/src/saml2/config.py
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2014-03-13 15:14:11 +0100
committerRoland Hedberg <roland.hedberg@adm.umu.se>2014-03-13 15:14:11 +0100
commitd7f50d4b05472916cce2d52329da664c2751b7ce (patch)
treee5b475d5d95b074144399a5c1eb522a9c522f20b /src/saml2/config.py
parentcbb0c8ebd6f296a3165da40871f10d14d238d32e (diff)
downloadpysaml2-d7f50d4b05472916cce2d52329da664c2751b7ce.tar.gz
Refactored the support for metadata extensions in the config file.
Diffstat (limited to 'src/saml2/config.py')
-rw-r--r--src/saml2/config.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/saml2/config.py b/src/saml2/config.py
index f79d0a7a..094a27fa 100644
--- a/src/saml2/config.py
+++ b/src/saml2/config.py
@@ -68,7 +68,8 @@ COMMON_ARGS = [
"generate_cert_info",
"tmp_cert_file",
"tmp_key_file",
- "validate_certificate"
+ "validate_certificate",
+ "extensions"
]
SP_ARGS = [
@@ -213,6 +214,7 @@ class Config(object):
self.tmp_cert_file = None
self.tmp_key_file = None
self.validate_certificate = None
+ self.extensions = {}
def setattr(self, context, attr, val):
if context == "":
@@ -331,6 +333,9 @@ class Config(object):
except KeyError:
pass
+ if "extensions" in cnf:
+ self.do_extensions(cnf["extensions"])
+
self.load_complex(cnf, metadata_construction=metadata_construction)
self.context = self.def_context
@@ -474,6 +479,11 @@ class Config(object):
return None, None
+ def do_extensions(self, extensions):
+ for key, val in extensions.items():
+ self.extensions[key] = val
+
+
class SPConfig(Config):
def_context = "sp"