summaryrefslogtreecommitdiff
path: root/src/saml2/metadata.py
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2015-09-07 15:54:52 +0200
committerRoland Hedberg <roland.hedberg@adm.umu.se>2015-09-07 15:54:52 +0200
commit17234e9ab9dfab4cf5600f67f1d24db5064f1025 (patch)
tree4bb92c942336f68c34c4052bc0921371aea4f146 /src/saml2/metadata.py
parent2be0571a5f9ee13f5c8eaa92c789e9e4764caf7a (diff)
parent6f4c07029e1e7e634cad73439fc9f407b382968c (diff)
downloadpysaml2-17234e9ab9dfab4cf5600f67f1d24db5064f1025.tar.gz
Merge pull request #252 from spaceone/create_metadata
enhance create_metadata() API
Diffstat (limited to 'src/saml2/metadata.py')
-rw-r--r--src/saml2/metadata.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/saml2/metadata.py b/src/saml2/metadata.py
index 170f59d3..238e2f4a 100644
--- a/src/saml2/metadata.py
+++ b/src/saml2/metadata.py
@@ -73,8 +73,8 @@ def metadata_tostring_fix(desc, nspair, xmlstring=""):
return xmlstring
-def create_metadata_string(configfile, config, valid, cert, keyfile, mid, name,
- sign):
+def create_metadata_string(configfile, config=None, valid=None, cert=None,
+ keyfile=None, mid=None, name=None, sign=None):
valid_for = 0
nspair = {"xs": "http://www.w3.org/2001/XMLSchema"}
#paths = [".", "/opt/local/bin"]
@@ -83,17 +83,15 @@ def create_metadata_string(configfile, config, valid, cert, keyfile, mid, name,
valid_for = int(valid) # Hours
eds = []
- if config is not None:
- eds.append(entity_descriptor(config))
- else:
+ if config is None:
if configfile.endswith(".py"):
configfile = configfile[:-3]
config = Config().load_file(configfile, metadata_construction=True)
- eds.append(entity_descriptor(config))
+ eds.append(entity_descriptor(config))
conf = Config()
- conf.key_file = keyfile
- conf.cert_file = cert
+ conf.key_file = config.key_file or keyfile
+ conf.cert_file = config.cert_file or cert
conf.debug = 1
conf.xmlsec_binary = config.xmlsec_binary
secc = security_context(conf)