diff options
author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-07-31 08:02:48 +0000 |
---|---|---|
committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-07-31 08:02:48 +0000 |
commit | d48eb0706db350e03aa9e67ab36a157faa611bb0 (patch) | |
tree | 00d1779f37c9c8228b8ca2c7e75c6c4012a87b7c | |
parent | 0b25994172d6bc574ea3da5a473ff2bba8a23d94 (diff) | |
download | lasso-d48eb0706db350e03aa9e67ab36a157faa611bb0.tar.gz lasso-d48eb0706db350e03aa9e67ab36a157faa611bb0.tar.xz lasso-d48eb0706db350e03aa9e67ab36a157faa611bb0.zip |
Python login_tests now works again, although there remains a lasso-CRITICAL
caused by idpLoginContext.get_identity() (file login_tests.py, line 120):
(process:5228): lasso-CRITICAL **: file xml.c: line 64 (lasso_node_copy):
assertion LASSO_IS_NODE(node)' failed
ERROR
-rw-r--r-- | python/environs/py_logout.c | 22 | ||||
-rw-r--r-- | python/environs/py_session.h | 4 | ||||
-rw-r--r-- | python/lasso.py | 16 | ||||
-rw-r--r-- | python/tests/login_tests.py | 6 |
4 files changed, 30 insertions, 18 deletions
diff --git a/python/environs/py_logout.c b/python/environs/py_logout.c index eee4546f..3625f287 100644 --- a/python/environs/py_logout.c +++ b/python/environs/py_logout.c @@ -57,22 +57,24 @@ PyObject *logout_getattr(PyObject *self, PyObject *args) { logout = LassoLogout_get(logout_obj); if (!strcmp(attr, "__members__")) - return Py_BuildValue("[ssss]", "user", "msg_url", "msg_body", - "nameIdentifier", "msg_relayState"); + return Py_BuildValue("[ssssssss]", "identity", "session", "request", "response", + "msg_url", "msg_body", "nameIdentifier", "msg_relayState"); + if (!strcmp(attr, "identity")) + return (LassoIdentity_wrap(LASSO_PROFILE(logout)->identity)); + if (!strcmp(attr, "session")) + return (LassoSession_wrap(LASSO_PROFILE(logout)->session)); + if (!strcmp(attr, "request")) + return (LassoNode_wrap(LASSO_PROFILE(logout)->request)); + if (!strcmp(attr, "response")) + return (LassoNode_wrap(LASSO_PROFILE(logout)->response)); if (!strcmp(attr, "msg_url")) return (charPtrConst_wrap(LASSO_PROFILE(logout)->msg_url)); if (!strcmp(attr, "msg_body")) return (charPtrConst_wrap(LASSO_PROFILE(logout)->msg_body)); - if (!strcmp(attr, "msg_relayState")) - return (charPtrConst_wrap(LASSO_PROFILE(logout)->msg_relayState)); if (!strcmp(attr, "nameIdentifier")) return (charPtrConst_wrap(LASSO_PROFILE(logout)->nameIdentifier)); - if (!strcmp(attr, "request")) - return (LassoNode_wrap(LASSO_PROFILE(logout)->request)); - if (!strcmp(attr, "response")) - return (LassoNode_wrap(LASSO_PROFILE(logout)->response)); - if (!strcmp(attr, "identity")) - return (LassoIdentity_wrap(LASSO_PROFILE(logout)->identity)); + if (!strcmp(attr, "msg_relayState")) + return (charPtrConst_wrap(LASSO_PROFILE(logout)->msg_relayState)); Py_INCREF(Py_None); return (Py_None); diff --git a/python/environs/py_session.h b/python/environs/py_session.h index 9e823fd6..182dc869 100644 --- a/python/environs/py_session.h +++ b/python/environs/py_session.h @@ -23,8 +23,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __PYLASSO_PY_USER_H__ -#define __PYLASSO_PY_USER_H__ +#ifndef __PYLASSO_PY_SESSION_H__ +#define __PYLASSO_PY_SESSION_H__ #include <lasso/environs/session.h> diff --git a/python/lasso.py b/python/lasso.py index f4cff357..3002f969 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -1039,11 +1039,13 @@ class Logout(Profile): ret = lassomod.logout_getattr(self, name) if ret is None: return None - if name == "user": - ret = User(_obj=ret) - if name == "request": + elif name == "identity": + ret= Identity(_obj=ret) + elif name == "session": + ret= Session(_obj=ret) + elif name == "request": ret = LogoutRequest(_obj=ret) - if name == "response": + elif name == "response": ret = LogoutResponse(_obj=ret) return ret @@ -1098,8 +1100,10 @@ class FederationTermination(Profile): raise AttributeError, name ret = lassomod.federation_termination_getattr(self, name) if ret: - if name=="user": - ret = User(_obj=ret) + if name == "identity": + ret= Identity(_obj=ret) + elif name == "session": + ret= Session(_obj=ret) return ret def new(cls, server, provider_type): diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py index 43cf846b..07e0bb04 100644 --- a/python/tests/login_tests.py +++ b/python/tests/login_tests.py @@ -119,6 +119,8 @@ class LoginTestCase(unittest.TestCase): lasso.httpMethodRedirect), 0) idpIdentityContextDump = idpLoginContext.get_identity().dump() self.failUnless(idpIdentityContextDump) + idpSessionContextDump = idpLoginContext.get_session().dump() + self.failUnless(idpSessionContextDump) responseUrl = idpLoginContext.msg_url responseQuery = responseUrl.split("?", 1)[1] soapResponseMsg = idpLoginContext.response_dump @@ -164,6 +166,8 @@ class LoginTestCase(unittest.TestCase): spLogoutContext = lasso.Logout.new(spContext, lasso.providerTypeSp) self.failUnless(spIdentityContextDump) spLogoutContext.set_identity_from_dump(spIdentityContextDump) + self.failUnless(spSessionContextDump) + spLogoutContext.set_session_from_dump(spSessionContextDump) self.failUnlessEqual(spLogoutContext.init_request(), 0) self.failUnlessEqual(spLogoutContext.build_request_msg(), 0) soapEndpoint = spLogoutContext.msg_url @@ -182,6 +186,8 @@ class LoginTestCase(unittest.TestCase): self.failUnlessEqual(idpLogoutContext.nameIdentifier, nameIdentifier) self.failUnless(idpIdentityContextDump) self.failUnlessEqual(idpLogoutContext.set_identity_from_dump(idpIdentityContextDump), 0) + self.failUnless(idpSessionContextDump) + self.failUnlessEqual(idpLogoutContext.set_session_from_dump(idpSessionContextDump), 0) self.failUnlessEqual(idpLogoutContext.process_request(), 0) idpIdentityContext = idpLogoutContext.identity self.failUnless(idpIdentityContext) |