From 73fd0e85c53a11df3267ca7946e25530f8f6be8d Mon Sep 17 00:00:00 2001 From: Nicolas Clapies Date: Mon, 26 Jul 2004 23:45:58 +0000 Subject: fix a bug in python binding user_add_assertion : give obj of python assertion, add a copy of assertion in lasso_add_assertion ( not sure, but assertion should be copied ) --- python/environs/py_user.c | 6 ++++-- python/examples/user.py | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/environs/py_user.c b/python/environs/py_user.c index 9fdd71db..10a50513 100644 --- a/python/environs/py_user.c +++ b/python/environs/py_user.c @@ -29,6 +29,8 @@ #include "py_user.h" +#include "../protocols/elements/py_assertion.h" + PyObject *LassoUser_wrap(LassoUser *user) { PyObject *ret; @@ -73,7 +75,7 @@ PyObject *user_add_assertion(PyObject *self, PyObject *args){ } else return NULL; - lasso_user_add_assertion(LassoUser_get(user_obj), remote_providerID, assertion_node); + lasso_user_add_assertion(LassoUser_get(user_obj), remote_providerID, LassoAssertion_get(assertion_node)); Py_INCREF(Py_None); return (Py_None); @@ -88,7 +90,7 @@ PyObject *user_destroy(PyObject *self, PyObject *args) { return NULL; } else return NULL; - + lasso_user_destroy(LassoUser_get(user_obj)); Py_INCREF(Py_None); diff --git a/python/examples/user.py b/python/examples/user.py index 6fd5de1a..f03761b5 100644 --- a/python/examples/user.py +++ b/python/examples/user.py @@ -34,8 +34,16 @@ print "Dump of user environ :" print user.dump() user2 = lasso.User.new_from_dump(user.dump()); +print 'user2 dump 1' +print user2.dump() assertion = lasso.Assertion("http://nowhere.com", "CD8CS7C6CS6CD6C6SC6SSDC6CS6D") + +print 'user dump 1' +print user.dump() + user.add_assertion("https://service-provider1:2003/liberty-alliance/metadata", assertion) +print user.dump() + user.destroy() -- cgit