summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-05-05 12:59:16 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-05-05 12:59:16 +0000
commitb6011ab10734bec8c6b47131ef75a45e689681a4 (patch)
tree7b56b89188fd2d486d7edaaa00ef2f967873f02f /python
parent84a15f9fdde1548e7eef0a33fd32887376ba54be (diff)
downloadlasso-b6011ab10734bec8c6b47131ef75a45e689681a4.tar.gz
lasso-b6011ab10734bec8c6b47131ef75a45e689681a4.tar.xz
lasso-b6011ab10734bec8c6b47131ef75a45e689681a4.zip
add enveloping in soap node
Diffstat (limited to 'python')
-rw-r--r--python/lasso.py47
-rw-r--r--python/lassomod.c1
-rw-r--r--python/xml/py_xml.c16
-rw-r--r--python/xml/py_xml.h1
4 files changed, 48 insertions, 17 deletions
diff --git a/python/lasso.py b/python/lasso.py
index c15d9e4f..139ed9df 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -75,6 +75,9 @@ class Node:
def url_encode(self, sign_method, private_key_file):
return lassomod.node_url_encode(self, sign_method, private_key_file)
+ def soap_envelop(self):
+ return lassomod.node_soap_envelop(self)
+
def verify_signature(self, certificate_file):
return lassomod.node_verify_signature(self, certificate_file)
@@ -282,8 +285,8 @@ class AuthnResponse(Node):
class FederationTerminationNotification(LibFederationTerminationNotification):
- def __init__(self, providerID, nameIdentifier,
- nameQualifier=None, format=None, _obj=None):
+ def __init__(self, providerID,
+ nameIdentifier, nameQualifier = None, format = None, _obj=None):
"""
"""
if _obj != None:
@@ -299,29 +302,39 @@ class FederationTerminationNotification(LibFederationTerminationNotification):
class LogoutRequest(LibLogoutRequest):
- def __init__(self, providerID, nameIdentifier, nameQualifier, format,
- _obj=None):
- """
- """
- if _obj != None:
- self._o = _obj
- return
- _obj = lassomod.logout_request_new(providerID,
- nameIdentifier,
- nameQualifier,
- format)
- if _obj is None: raise Error('lasso_logout_request_new() failed')
- LibLogoutRequest.__init__(self, _obj=_obj)
+ def __init__(self, obj):
+ """
+ """
+## if _obj != None:
+## self._o = _obj
+## return
+## _obj = lassomod.logout_request_new(soap,
+## query,
+## providerID,
+## nameIdentifier,
+## nameQualifier,
+## format)
+## if _obj is None: raise Error('lasso_logout_request_new() failed')
+## LibLogoutRequest.__init__(self, _obj=_obj)
+
+ self._o = obj
+ LibLogoutRequest.__init__(self, _obj = self._o)
+
+ def new(cls, providerID, nameIdentifier, nameQualifier, format):
+ obj = lassomod.logout_request_new(providerID, nameIdentifier, nameQualifier, format)
+ return LogoutRequest(obj)
+ new = classmethod(new)
class LogoutResponse(Node):
- def __init__(self, providerID, statusCodeValue, request, _obj=None):
+ def __init__(self, soap, query, providerID, statusCodeValue, request, _obj=None):
"""
"""
if _obj != None:
self._o = _obj
return
- _obj = lassomod.logout_response_new(providerID, statusCodeValue,
+ _obj = lassomod.logout_response_new(soap, query,
+ providerID, statusCodeValue,
request)
if _obj is None: raise Error('lasso_logout_response_new() failed')
Node.__init__(self, _obj=_obj)
diff --git a/python/lassomod.c b/python/lassomod.c
index 34ca0eb7..a855bfa8 100644
--- a/python/lassomod.c
+++ b/python/lassomod.c
@@ -64,6 +64,7 @@ static PyMethodDef lasso_methods[] = {
{"node_get_child", node_get_child, METH_VARARGS},
{"node_unref", node_unref, METH_VARARGS},
{"node_url_encode", node_url_encode, METH_VARARGS},
+ {"node_soap_envelop", node_soap_envelop, METH_VARARGS},
{"node_verify_signature", node_verify_signature, METH_VARARGS},
/* py_lib_authn_request.h */
diff --git a/python/xml/py_xml.c b/python/xml/py_xml.c
index 405fee16..76384319 100644
--- a/python/xml/py_xml.c
+++ b/python/xml/py_xml.c
@@ -130,6 +130,22 @@ PyObject *node_url_encode(PyObject *self, PyObject *args) {
return (charPtr_wrap(ret));
}
+PyObject *node_soap_envelop(PyObject *self, PyObject *args) {
+ PyObject *node_obj;
+ gchar *ret;
+
+ if (CheckArgs(args, "O:node_unref")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:node_url_encode",
+ &node_obj))
+ return NULL;
+ }
+ else return NULL;
+
+ ret = lasso_node_soap_envelop(LassoNode_get(node_obj));
+
+ return (charPtr_wrap(ret));
+}
+
PyObject *node_verify_signature(PyObject *self, PyObject *args) {
PyObject *node_obj;
const gchar *certificate_file;
diff --git a/python/xml/py_xml.h b/python/xml/py_xml.h
index 41d7d5b6..52723113 100644
--- a/python/xml/py_xml.h
+++ b/python/xml/py_xml.h
@@ -41,6 +41,7 @@ PyObject *node_get_attr_value(PyObject *self, PyObject *args);
PyObject *node_get_child(PyObject *self, PyObject *args);
PyObject *node_unref(PyObject *self, PyObject *args);
PyObject *node_url_encode(PyObject *self, PyObject *args);
+PyObject *node_soap_envelop(PyObject *self, PyObject *args);
PyObject *node_verify_signature(PyObject *self, PyObject *args);
#endif /* __PYLASSO_PY_XML_H__ */