diff options
author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-05-13 16:54:21 +0000 |
---|---|---|
committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-05-13 16:54:21 +0000 |
commit | 2b82bf473c696328b92cd8774e66ce55d3e7dc7c (patch) | |
tree | 6af4f6ee877585c073ba4beed3c8663a847e72fc /python | |
parent | 1ff8baf95715a6913a0c42f730ebbca874971cf4 (diff) | |
download | lasso-2b82bf473c696328b92cd8774e66ce55d3e7dc7c.tar.gz lasso-2b82bf473c696328b92cd8774e66ce55d3e7dc7c.tar.xz lasso-2b82bf473c696328b92cd8774e66ce55d3e7dc7c.zip |
*** empty log message ***
Diffstat (limited to 'python')
-rw-r--r-- | python/lasso.py | 76 | ||||
-rwxr-xr-x | python/setup.py | 9 |
2 files changed, 50 insertions, 35 deletions
diff --git a/python/lasso.py b/python/lasso.py index 255ad77e..7de514c2 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -63,6 +63,12 @@ class Node: def dump(self, encoding="utf8", format=1): return lassomod.node_dump(self, encoding, format) + def export_to_query(self, sign_method, private_key_file): + return lassomod.node_export_to_query(self, sign_method, private_key_file) + + def export_to_soap(self): + return lassomod.node_export_to_soap(self) + def destroy(self): lassomod.node_unref(self) @@ -78,12 +84,6 @@ class Node: def get_content(self): return lassomod.node_get_content(self) - def url_encode(self, sign_method, private_key_file): - return lassomod.node_url_encode(self, sign_method, private_key_file) - - def soap_envelop(self): - return lassomod.node_soap_envelop(self) - def verify_signature(self, certificate_file): return lassomod.node_verify_signature(self, certificate_file) @@ -103,6 +103,10 @@ class SamlAssertion(Node): lassomod.saml_assertion_add_authenticationStatement(self, authenticationStatement) + def set_signature(self, sign_method, private_key_file, certificate_file): + lassomod.saml_assertion_set_signature(self, sign_method, + private_key_file, certificate_file) + class SamlAuthenticationStatement(Node): def __init__(self, _obj=None): @@ -116,6 +120,39 @@ class SamlAuthenticationStatement(Node): Node.__init__(self, _obj=_obj) +class SamlNameIdentifier(Node): + def __init__(self, _obj=None): + """ + """ + if _obj != None: + self._o = _obj + return + _obj = lassomod.saml_name_identifier_new() + if _obj is None: raise Error('lasso_saml_name_identifier_new() failed') + Node.__init__(self, _obj=_obj) + + def set_format(self, format): + lassomod.saml_name_identifier_set_format(self, format) + + def set_nameQualifier(self, nameQualifier): + lassomod.saml_name_identifier_set_nameQualifier(self, nameQualifier) + + +class SamlpResponse(Node): + def __init__(self, _obj=None): + """ + """ + if _obj != None: + self._o = _obj + return + _obj = lassomod.samlp_response_new() + if _obj is None: raise Error('lasso_samlp_response_new() failed') + Node.__init__(self, _obj=_obj) + + def add_assertion(self, assertion): + lassomod.samlp_response_add_assertion(self, assertion) + + class LibAuthenticationStatement(SamlAuthenticationStatement): def __init__(self, _obj=None): """ @@ -264,24 +301,6 @@ class LibRegisterNameIdentifierResponse(Node): raise Error('lasso_lib_register_name_identifier_response_new() failed') Node.__init__(self, _obj=_obj) - -class SamlNameIdentifier(Node): - def __init__(self, _obj=None): - """ - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.saml_name_identifier_new() - if _obj is None: raise Error('lasso_saml_authentication_statement_new() failed') - Node.__init__(self, _obj=_obj) - - def set_format(self, format): - lassomod.saml_name_identifier_set_format(self, format) - - def set_nameQualifier(self, nameQualifier): - lassomod.saml_name_identifier_set_nameQualifier(self, nameQualifier) - ################################################################################ # protocols : high level classes ################################################################################ @@ -311,12 +330,12 @@ class AuthnRequest(LibAuthnRequest): lassomod.authn_request_set_scoping(self, proxyCount) -class AuthnResponse(Node): +class AuthnResponse(SamlpResponse): def __init__(self, _obj): """ """ self._o = _obj - Node.__init__(self, _obj=_obj) + SamlpResponse.__init__(self, _obj=_obj) def new_from_dump(cls, buffer): obj = lassomod.authn_response_new_from_dump(buffer) @@ -343,11 +362,6 @@ class AuthnResponse(Node): ret = AuthnRequest(None, _obj=ret) return ret - def add_assertion(self, assertion, private_key_file, certificate_file): - lassomod.authn_response_add_assertion(self, assertion, - private_key_file, - certificate_file) - def must_authenticate(self, is_authenticated): return lassomod.authn_response_must_authenticate(self, is_authenticated) diff --git a/python/setup.py b/python/setup.py index bd57b91a..9105e239 100755 --- a/python/setup.py +++ b/python/setup.py @@ -180,10 +180,10 @@ extract_cflags(xmlsec1_cflags) extract_libs(xmlsec1_libs) # FIXME : cflags & libs for lasso -#include_dirs.append('..') -#library_dirs.append('../lasso/.libs') -include_dirs.append('/usr/local/include') -library_dirs.append('/usr/local/lib') +include_dirs.append('..') +library_dirs.append('../lasso/.libs') +#include_dirs.append('/usr/local/include') +#library_dirs.append('/usr/local/lib') libraries.append('lasso') em = Extension("lassomod", @@ -200,6 +200,7 @@ em = Extension("lassomod", "xml/py_saml_assertion.c", "xml/py_saml_authentication_statement.c", "xml/py_saml_name_identifier.c", + "xml/py_samlp_response.c", "protocols/py_authn_request.c", "protocols/py_authn_response.c", "protocols/py_federation_termination_notification.c", |