summaryrefslogtreecommitdiff
path: root/src/saml2/ecp_client.py
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2013-05-06 14:10:40 +0200
committerFredrik Thulin <fredrik@thulin.net>2013-05-06 14:10:40 +0200
commit42b916f382d46b3fda512df81c00875978eaeb1d (patch)
tree28ae82b3d62c1b36a290c76f820c53b23f43f787 /src/saml2/ecp_client.py
parent92cc3beccb1ac6d77e716f68a7d18763b58f40ac (diff)
downloadpysaml2-42b916f382d46b3fda512df81c00875978eaeb1d.tar.gz
Avoid hard xmlsec_binary requirement for ECP client.
By providing an already initialized Config() instance, an ECP client using another CryptoBackend than xmlsec1 can be instantiated.
Diffstat (limited to 'src/saml2/ecp_client.py')
-rw-r--r--src/saml2/ecp_client.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/saml2/ecp_client.py b/src/saml2/ecp_client.py
index 7a6253cc..b092f891 100644
--- a/src/saml2/ecp_client.py
+++ b/src/saml2/ecp_client.py
@@ -48,28 +48,33 @@ class Client(Entity):
def __init__(self, user, passwd, sp="", idp=None, metadata_file=None,
xmlsec_binary=None, verbose=0, ca_certs="",
disable_ssl_certificate_validation=True, key_file=None,
- cert_file=None):
+ cert_file=None, config=None):
"""
:param user: user name
:param passwd: user password
:param sp: The SP URL
:param idp: The IdP PAOS endpoint
:param metadata_file: Where the metadata file is if used
- :param xmlsec_binary: Where the xmlsec1 binary can be found
+ :param xmlsec_binary: Where the xmlsec1 binary can be found (*)
:param verbose: Chatty or not
:param ca_certs: is the path of a file containing root CA certificates
- for SSL server certificate validation.
+ for SSL server certificate validation (*)
:param disable_ssl_certificate_validation: If
disable_ssl_certificate_validation is true, SSL cert validation
- will not be performed.
+ will not be performed (*)
+ :param key_file: Private key filename (*)
+ :param cert_file: Certificate filename (*)
+ :param config: Config() instance, overrides all the parameters marked
+ with an asterisk (*) above
"""
- config = Config()
- config.disable_ssl_certificate_validation = \
- disable_ssl_certificate_validation
- config.key_file = key_file
- config.cert_file = cert_file
- config.ca_certs = ca_certs
- config.xmlsec_binary = xmlsec_binary
+ if not config:
+ config = Config()
+ config.disable_ssl_certificate_validation = \
+ disable_ssl_certificate_validation
+ config.key_file = key_file
+ config.cert_file = cert_file
+ config.ca_certs = ca_certs
+ config.xmlsec_binary = xmlsec_binary
Entity.__init__(self, "sp", config)
self._idp = idp