diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-04-29 01:56:34 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-04-29 01:56:34 +0000 |
| commit | 9f5d656f99c9cba9c4a9ccef2bae822b8110bfb4 (patch) | |
| tree | 9eb9f62cab10d634b55354ee5b53ffa64266c3fc /python | |
| parent | e10d97282f31c10f292b5c4d10c89cebf616df58 (diff) | |
| download | lasso-9f5d656f99c9cba9c4a9ccef2bae822b8110bfb4.tar.gz lasso-9f5d656f99c9cba9c4a9ccef2bae822b8110bfb4.tar.xz lasso-9f5d656f99c9cba9c4a9ccef2bae822b8110bfb4.zip | |
AuthnRequest added
Diffstat (limited to 'python')
| -rw-r--r-- | python/lasso.py | 53 | ||||
| -rw-r--r-- | python/lassomod.c | 21 | ||||
| -rwxr-xr-x | python/setup.py | 9 |
3 files changed, 36 insertions, 47 deletions
diff --git a/python/lasso.py b/python/lasso.py index 77d26f94..02b933b1 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -77,7 +77,7 @@ class Node: ## #self._o = lassomod.(size) ## if self._o is None: raise Error('lasso_node_new() failed') - def dump(self, encoding = "utf8", format = 1): + def dump(self, encoding="utf8", format=1): return lassomod.node_dump(self, encoding, format) def destroy(self): @@ -96,46 +96,26 @@ class Node: return lassomod.node_verify_signature(self, certificate_file) -class AuthnRequest: - def __init__(self, providerID, nameIDPolicy, forceAuthn, isPassive, - protocolProfile, assertionConsumerServiceID, - authnContextClassRefs, authnContextStatementRefs, - authnContextComparison, relayState, proxyCount, idpList, - consent, _obj=None): +class AuthnRequest(Node): + def __init__(self, providerID, _obj=None): """ """ if _obj != None: self._o = _obj return - self._o = lassomod.authn_request_create(providerID, - nameIDPolicy, - forceAuthn, - isPassive, - protocolProfile, - assertionConsumerServiceID, - authnContextClassRefs, - authnContextStatementRefs, - authnContextComparison, - relayState, - proxyCount, - idpList, - consent) - if self._o is None: raise Error('lasso_authn_request_create() failed') + self._o = lassomod.authn_request_new(providerID) + if self._o is None: raise Error('lasso_authn_request_new() failed') + + def set_requestAuthnContext(self, authnContextClassRefs=None, + authnContextStatementRefs=None, + authnContextComparison=None): + lassomod.authn_request_set_requestAuthnContext(self, + authnContextClassRefs, + authnContextStatementRefs, + authnContextComparison) - def __isprivate(self, name): - return name == '_o' - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.authn_request_getattr(self, name) - if ret is None: - raise AttributeError, name - if name == "node": - ret = Node(_obj=ret) - return ret + def set_scoping(self, proxyCount): + lassomod.authn_request_set_scoping(self, proxyCount) class AuthnResponse: @@ -356,6 +336,7 @@ class RegisterNameIdentifierRequest(Node): def changeAttributeNamesIdentifiers(self): lassomod.register_name_identifier_request_change_attribute_names_identifiers(self); + class RegisterNameIdentifierResponse(Node): def __init__(self, providerID, @@ -387,6 +368,7 @@ class RegisterNameIdentifierResponse(Node): ret = Node(_obj=ret) return ret + class FederationTerminationNotification(Node): def __init__(self, providerID, @@ -454,6 +436,7 @@ class NameIdentifierMappingRequest(Node): ret = Node(_obj=ret) return ret + class NameIdentifierMappingResponse(Node): def __init__(self, providerID, diff --git a/python/lassomod.c b/python/lassomod.c index 86d02b28..ae3c2712 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -26,6 +26,7 @@ #include "py_lasso.h" #include "xml/py_xml.h" +#include "protocols/py_authn_request.h" #include "protocols/py_logout_request.h" #include "protocols/py_logout_response.h" #include "protocols/py_register_name_identifier_request.h" @@ -64,19 +65,23 @@ static PyMethodDef lasso_methods[] = { {"logout_response_getattr", logout_response_getattr, METH_VARARGS}, {"logout_response", logout_response, METH_VARARGS}, - /* py_register_name_identifier.h */ - {"register_name_identifier_request_getattr", register_name_identifier_request_getattr, METH_VARARGS}, - {"register_name_identifier_request", register_name_identifier_request, METH_VARARGS}, + /* py_register_name_identifier_request.h */ + {"register_name_identifier_request_getattr", register_name_identifier_request_getattr, METH_VARARGS}, + {"register_name_identifier_request", register_name_identifier_request, METH_VARARGS}, {"register_name_identifier_request_change_attribute_names_identifiers", - register_name_identifier_request_change_attribute_names_identifiers, METH_VARARGS}, + register_name_identifier_request_change_attribute_names_identifiers, METH_VARARGS}, {"register_name_identifier_request_set_relayState", register_name_identifier_request_set_relayState, METH_VARARGS}, + /* py_register_name_identifier_response.h */ {"register_name_identifier_response_getattr", register_name_identifier_response_getattr, METH_VARARGS}, - {"register_name_identifier_response", register_name_identifier_response, METH_VARARGS}, + {"register_name_identifier_response", register_name_identifier_response, METH_VARARGS}, -/* /\* py_single_sign_on_and_federation.h *\/ */ -/* {"authn_request_getattr", authn_request_getattr, METH_VARARGS}, */ -/* {"authn_request_create", authn_request_create, METH_VARARGS}, */ + /* py_authn_request.h */ + {"authn_request_new", authn_request_new, METH_VARARGS}, + {"authn_request_set_requestAuthnContext", authn_request_set_requestAuthnContext, METH_VARARGS}, + {"authn_request_set_scoping", authn_request_set_scoping, METH_VARARGS}, + + /* py_authn_response.h */ /* {"authn_response_getattr", authn_response_getattr, METH_VARARGS}, */ /* {"authn_response_create", authn_response_create, METH_VARARGS}, */ /* {"authn_response_init", authn_response_init, METH_VARARGS}, */ diff --git a/python/setup.py b/python/setup.py index e8b426e1..255da0b3 100755 --- a/python/setup.py +++ b/python/setup.py @@ -180,14 +180,15 @@ 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", sources = ["py_lasso.c", "xml/py_xml.c", + "protocols/py_authn_request.c", "protocols/py_logout_request.c", "protocols/py_logout_response.c", "protocols/py_register_name_identifier_request.c", |
