diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-18 22:37:39 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-18 22:37:39 +0000 |
| commit | 721642847cd1acf399f191d1bb205d7d6466f4fb (patch) | |
| tree | 1af626c31b7a658c27b1431185b72915723f9d63 /python | |
| parent | a19c201029c4708c1e21519ae76758565190dc7f (diff) | |
| download | lasso-721642847cd1acf399f191d1bb205d7d6466f4fb.tar.gz lasso-721642847cd1acf399f191d1bb205d7d6466f4fb.tar.xz lasso-721642847cd1acf399f191d1bb205d7d6466f4fb.zip | |
*** empty log message ***
Diffstat (limited to 'python')
| -rw-r--r-- | python/environs/py_logout.c | 16 | ||||
| -rw-r--r-- | python/environs/py_logout.h | 1 | ||||
| -rw-r--r-- | python/examples/logout-from-idp.py | 22 | ||||
| -rw-r--r-- | python/lasso.py | 3 | ||||
| -rw-r--r-- | python/lassomod.c | 1 |
5 files changed, 42 insertions, 1 deletions
diff --git a/python/environs/py_logout.c b/python/environs/py_logout.c index 9252c917..60560477 100644 --- a/python/environs/py_logout.c +++ b/python/environs/py_logout.c @@ -92,6 +92,22 @@ PyObject *logout_build_response_msg(PyObject *self, PyObject *args) { return(int_wrap(codeError)); } +PyObject *logout_destroy(PyObject *self, PyObject *args){ + PyObject *logout_obj; + + if (CheckArgs(args, "O:logout_destroy")) { + if(!PyArg_ParseTuple(args, (char *) "O:logout_destroy", + &logout_obj)) + return NULL; + } + else return NULL; + + lasso_logout_destroy(LassoLogout_get(logout_obj)); + + Py_INCREF(Py_None); + return(Py_None); +} + PyObject *logout_init_request(PyObject *self, PyObject *args) { PyObject *logout_obj; gchar *remote_providerID; diff --git a/python/environs/py_logout.h b/python/environs/py_logout.h index 32c01f6f..8b86e92c 100644 --- a/python/environs/py_logout.h +++ b/python/environs/py_logout.h @@ -42,6 +42,7 @@ PyObject *LassoLogout_wrap(LassoLogout *logout); PyObject *logout_new(PyObject *self, PyObject *args); PyObject *logout_build_request_msg(PyObject *self, PyObject *args); PyObject *logout_build_response_msg(PyObject *self, PyObject *args); +PyObject *logout_destroy(PyObject *self, PyObject *args); PyObject *logout_init_request(PyObject *self, PyObject *args); PyObject *logout_process_request_msg(PyObject *self, PyObject *args); PyObject *logout_process_response_msg(PyObject *self, PyObject *args); diff --git a/python/examples/logout-from-idp.py b/python/examples/logout-from-idp.py index 304f397b..3732cc0e 100644 --- a/python/examples/logout-from-idp.py +++ b/python/examples/logout-from-idp.py @@ -32,4 +32,24 @@ print user.dump() # requests : logout = lasso.Logout.new(server, user, lasso.providerTypeIdp); -next_providerID = user.get_next_providerID(); +next_provider_id = user.get_next_providerID(); +while(next_provider_id): + assertion = user.get_assertion(next_provider_id) + + logout.init_request(next_provider_id) + logout.build_request_msg(); + + # send the request with logout.msg_url and logout.msg_body + print 'url : ', logout.msg_url + print 'body : ', logout.msg_body + + user.remove_assertion(next_provider_id) + next_provider_id = user.get_next_providerID() + +print "End of logout ..." +print "Dump of user environ :" +print user.dump() + +user.destroy() + +logout.destroy() diff --git a/python/lasso.py b/python/lasso.py index 359f1a49..664a345d 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -1003,6 +1003,9 @@ class Logout: def build_response_msg(self): return lassomod.logout_build_response_msg(self) + def destroy(self): + pass + def init_request(self, remote_providerID): return lassomod.logout_init_request(self, remote_providerID); diff --git a/python/lassomod.c b/python/lassomod.c index 21e62e4f..bdeef7bc 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -223,6 +223,7 @@ static PyMethodDef lasso_methods[] = { {"logout_new", logout_new, METH_VARARGS}, {"logout_build_request_msg", logout_build_request_msg, METH_VARARGS}, {"logout_build_response_msg", logout_build_response_msg, METH_VARARGS}, + {"logout_destroy", logout_destroy, METH_VARARGS}, {"logout_init_request", logout_init_request, METH_VARARGS}, {"logout_process_request_msg", logout_process_request_msg, METH_VARARGS}, {"logout_process_response_msg", logout_process_response_msg, METH_VARARGS}, |
