summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-07-26 23:45:58 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-07-26 23:45:58 +0000
commit73fd0e85c53a11df3267ca7946e25530f8f6be8d (patch)
tree33e4661f6d27366b62d9a25ee2f4d70d56062b13 /python
parentdb051a1a73684708d47ede1acefdaeff0cf99120 (diff)
downloadlasso-73fd0e85c53a11df3267ca7946e25530f8f6be8d.tar.gz
lasso-73fd0e85c53a11df3267ca7946e25530f8f6be8d.tar.xz
lasso-73fd0e85c53a11df3267ca7946e25530f8f6be8d.zip
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 )
Diffstat (limited to 'python')
-rw-r--r--python/environs/py_user.c6
-rw-r--r--python/examples/user.py8
2 files changed, 12 insertions, 2 deletions
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()