summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-08-04 15:04:38 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-08-04 15:04:38 +0000
commit39823a5f49764426271d82b891f8fb0b31c45885 (patch)
tree4929775e906d275cc0e7ca47488c45d3eb07a9af /python
parentdb0c5292db260e04fed32d5cac2c84c4217dea48 (diff)
downloadlasso-39823a5f49764426271d82b891f8fb0b31c45885.tar.gz
lasso-39823a5f49764426271d82b891f8fb0b31c45885.tar.xz
lasso-39823a5f49764426271d82b891f8fb0b31c45885.zip
update of lecp python binding
Diffstat (limited to 'python')
-rw-r--r--python/environs/py_lecp.c124
-rw-r--r--python/environs/py_lecp.h16
-rw-r--r--python/lasso.py26
-rw-r--r--python/lassomod.c6
4 files changed, 80 insertions, 92 deletions
diff --git a/python/environs/py_lecp.c b/python/environs/py_lecp.c
index 942ff945..b8f17a41 100644
--- a/python/environs/py_lecp.c
+++ b/python/environs/py_lecp.c
@@ -59,9 +59,9 @@ PyObject *lecp_getattr(PyObject *self, PyObject *args) {
lecp = LassoLecp_get(lecp_obj);
if (!strcmp(attr, "__members__"))
- return Py_BuildValue("[ss]", "msg_body");
+ return Py_BuildValue("[s]", "msg_body");
if (!strcmp(attr, "msg_body"))
- return (charPtrConst_wrap(lecp->msg_body));
+ return (charPtrConst_wrap(LASSO_PROFILE(lecp)->msg_body));
Py_INCREF(Py_None);
return (Py_None);
@@ -82,66 +82,66 @@ PyObject *lecp_new(PyObject *self, PyObject *args) {
return (LassoLecp_wrap(lecp));
}
-PyObject *lecp_build_authn_request_msg(PyObject *self, PyObject *args){
+PyObject *lecp_build_authn_request_envelope_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gint codeError = 0;
- if (CheckArgs(args, "O:lecp_build_authn_request_msg")) {
- if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_request_msg",
+ if (CheckArgs(args, "O:lecp_build_authn_request_envelope_msg")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_request_envelope_msg",
&lecp_obj))
return NULL;
}
else return NULL;
- codeError = lasso_lecp_build_authn_request_msg(LassoLecp_get(lecp_obj));
+ codeError = lasso_lecp_build_authn_request_envelope_msg(LassoLecp_get(lecp_obj));
return(int_wrap(codeError));
}
-PyObject *lecp_build_authn_request_envelope_msg(PyObject *self, PyObject *args){
+PyObject *lecp_build_authn_response_envelope_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gint codeError = 0;
- if (CheckArgs(args, "O:lecp_build_authn_request_envelope_msg")) {
- if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_request_envelope_msg",
+ if (CheckArgs(args, "O:lecp_build_authn_response_envelope_msg")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_response_envelope_msg",
&lecp_obj))
return NULL;
}
else return NULL;
- codeError = lasso_lecp_build_authn_request_envelope_msg(LassoLecp_get(lecp_obj));
+ codeError = lasso_lecp_build_authn_response_envelope_msg(LassoLecp_get(lecp_obj));
return(int_wrap(codeError));
}
-PyObject *lecp_build_authn_response_msg(PyObject *self, PyObject *args){
+PyObject *lecp_build_authn_request_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gint codeError = 0;
- if (CheckArgs(args, "O:lecp_build_authn_response_msg")) {
- if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_response_msg",
+ if (CheckArgs(args, "O:lecp_build_authn_request_msg")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_request_msg",
&lecp_obj))
return NULL;
}
else return NULL;
- codeError = lasso_lecp_build_authn_response_msg(LassoLecp_get(lecp_obj));
+ codeError = lasso_lecp_build_authn_request_msg(LassoLecp_get(lecp_obj));
return(int_wrap(codeError));
}
-PyObject *lecp_build_authn_response_envelope_msg(PyObject *self, PyObject *args){
+PyObject *lecp_build_authn_response_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gint codeError = 0;
- if (CheckArgs(args, "O:lecp_build_authn_response_envelope_msg")) {
- if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_response_envelope_msg",
+ if (CheckArgs(args, "O:lecp_build_authn_response_msg")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:lecp_build_authn_response_msg",
&lecp_obj))
return NULL;
}
else return NULL;
- codeError = lasso_lecp_build_authn_response_envelope_msg(LassoLecp_get(lecp_obj));
+ codeError = lasso_lecp_build_authn_response_msg(LassoLecp_get(lecp_obj));
return(int_wrap(codeError));
}
@@ -162,78 +162,76 @@ PyObject *lecp_destroy(PyObject *self, PyObject *args){
return(Py_None);
}
-PyObject *lecp_init_authn_request_envelope(PyObject *self, PyObject *args){
+PyObject *lecp_init_authn_request(PyObject *self, PyObject *args) {
PyObject *lecp_obj;
- PyObject *authnRequest_obj;
-
- gint codeError = 0;
-
- if (CheckArgs(args, "OO:lecp_init_authn_request_envelope")) {
- if(!PyArg_ParseTuple(args, (char *) "OO:lecp_init_authn_request_envelope",
- &lecp_obj, &authnRequest_obj))
+ gchar *remote_providerID;
+ gint ret;
+
+ if (CheckArgs(args, "OS:lecp_init_authn_request")) {
+ if(!PyArg_ParseTuple(args, (char *) "Os:lecp_init_authn_request",
+ &lecp_obj, &remote_providerID))
return NULL;
}
else return NULL;
-
- codeError = lasso_lecp_init_authn_request_envelope(LassoLecp_get(lecp_obj),
- LassoAuthnRequest_get(authnRequest_obj));
-
- return(int_wrap(codeError));
+
+ ret = lasso_lecp_init_authn_request(LassoLecp_get(lecp_obj),
+ remote_providerID);
+
+ return (int_wrap(ret));
}
-PyObject *lecp_init_authn_response_envelope(PyObject *self, PyObject *args){
+PyObject *lecp_init_from_authn_request_msg(PyObject *self, PyObject *args) {
PyObject *lecp_obj;
- PyObject *authnRequest_obj;
- PyObject *authnResponse_obj;
-
- gint codeError = 0;
+ gchar *authn_request_msg;
+ lassoHttpMethod authn_request_method;
+ gint ret;
- if (CheckArgs(args, "OOO:lecp_init_authn_response_envelope")) {
- if(!PyArg_ParseTuple(args, (char *) "OOO:lecp_init_authn_response_envelope",
- &lecp_obj, &authnRequest_obj, &authnResponse_obj))
+ if (CheckArgs(args, "OSI:lecp_init_from_authn_request_msg")) {
+ if(!PyArg_ParseTuple(args, (char *) "Osi:lecp_init_from_authn_request_msg",
+ &lecp_obj, &authn_request_msg, &authn_request_method))
return NULL;
}
else return NULL;
- codeError = lasso_lecp_init_authn_response_envelope(LassoLecp_get(lecp_obj),
- LassoAuthnRequest_get(authnRequest_obj),
- LassoAuthnResponse_get(authnResponse_obj));
+ ret = lasso_lecp_init_from_authn_request_msg(LassoLecp_get(lecp_obj),
+ authn_request_msg,
+ authn_request_method);
- return(int_wrap(codeError));
+ return (int_wrap(ret));
}
-PyObject *lecp_process_authn_request_envelope_msg(PyObject *self, PyObject *args){
+PyObject *lecp_process_authn_request_envelope_msg(PyObject *self, PyObject *args) {
PyObject *lecp_obj;
- gchar *request_msg;
-
- gint codeError = 0;
-
+ gchar *remote_providerID;
+ gint ret;
+
if (CheckArgs(args, "OS:lecp_process_authn_request_envelope_msg")) {
if(!PyArg_ParseTuple(args, (char *) "Os:lecp_process_authn_request_envelope_msg",
- &lecp_obj, &request_msg))
+ &lecp_obj, &remote_providerID))
return NULL;
}
else return NULL;
-
- codeError = lasso_lecp_process_authn_request_envelope_msg(LassoLecp_get(lecp_obj), request_msg);
-
- return(int_wrap(codeError));
+
+ ret = lecp_process_authn_request_envelope_msg(LassoLecp_get(lecp_obj),
+ remote_providerID);
+
+ return (int_wrap(ret));
}
-PyObject *lecp_process_authn_response_envelope_msg(PyObject *self, PyObject *args){
+PyObject *lecp_process_authn_response_envelope_msg(PyObject *self, PyObject *args) {
PyObject *lecp_obj;
- gchar *response_msg;
-
- gint codeError = 0;
-
+ gchar *remote_providerID;
+ gint ret;
+
if (CheckArgs(args, "OS:lecp_process_authn_response_envelope_msg")) {
if(!PyArg_ParseTuple(args, (char *) "Os:lecp_process_authn_response_envelope_msg",
- &lecp_obj, &response_msg))
+ &lecp_obj, &remote_providerID))
return NULL;
}
else return NULL;
-
- codeError = lasso_lecp_process_authn_response_envelope_msg(LassoLecp_get(lecp_obj), response_msg);
-
- return(int_wrap(codeError));
+
+ ret = lecp_process_authn_response_envelope_msg(LassoLecp_get(lecp_obj),
+ remote_providerID);
+
+ return (int_wrap(ret));
}
diff --git a/python/environs/py_lecp.h b/python/environs/py_lecp.h
index ec24dbac..a24f1ea0 100644
--- a/python/environs/py_lecp.h
+++ b/python/environs/py_lecp.h
@@ -37,26 +37,16 @@ typedef struct {
PyObject *LassoLecp_wrap(LassoLecp *lecp);
PyObject *lecp_getattr(PyObject *self, PyObject *args);
-
PyObject *lecp_new(PyObject *self, PyObject *args);
-
-PyObject *lecp_build_authn_request_msg(PyObject *self, PyObject *args);
-
PyObject *lecp_build_authn_request_envelope_msg(PyObject *self, PyObject *args);
-
+PyObject *lecp_build_authn_request_msg(PyObject *self, PyObject *args);
PyObject *lecp_build_authn_response_msg(PyObject *self, PyObject *args);
-
PyObject *lecp_build_authn_response_envelope_msg(PyObject *self, PyObject *args);
-
PyObject *lecp_destroy(PyObject *self, PyObject *args);
-
-PyObject *lecp_init_authn_request_envelope(PyObject *self, PyObject *args);
-
-PyObject *lecp_init_authn_response_envelope(PyObject *self, PyObject *args);
-
+PyObject *lecp_init_authn_request(PyObject *self, PyObject *args);
+PyObject *lecp_init_from_authn_request_msg(PyObject *self, PyObject *args);
PyObject *lecp_process_authn_request_envelope_msg(PyObject *self, PyObject *args);
-
PyObject *lecp_process_authn_response_envelope_msg(PyObject *self, PyObject *args);
#endif /* __PYLASSO_PY_LECP_H__ */
diff --git a/python/lasso.py b/python/lasso.py
index e1b7a8dd..b3ea2b39 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -1208,13 +1208,13 @@ class RegisterNameIdentifier:
pass
def init_request(self, remote_providerID):
- return lassomod.register_name_identifier_init_request(self, remote_providerID);
+ return lassomod.register_name_identifier_init_request(self, remote_providerID)
def process_request(self):
return lassomod.register_name_identifier_process_request(self)
def process_response_msg(self, response_msg, response_method):
- return lassomod.register_name_identifier_process_response_msg(self, response_msg, response_method);
+ return lassomod.register_name_identifier_process_response_msg(self, response_msg, response_method)
class Lecp:
"""\brief Short desc
@@ -1246,30 +1246,30 @@ class Lecp:
return Lecp(obj)
new = classmethod(new)
+ def build_authn_request_envelope_msg(self):
+ return lassomod.lecp_build_authn_request_envelope_msg(self)
+
+ def build_authn_response_envelope_msg(self):
+ return lassomod.lecp_build_authn_response_envelope_msg(self)
+
def build_authn_request_msg(self):
return lassomod.lecp_build_authn_request_msg(self)
- def build_authn_request_envelope_msg(self):
- return lassomod.lecp_build_authn_request_envelope_msg(self);
-
def build_authn_response_msg(self):
return lassomod.lecp_build_authn_response_msg(self)
- def build_authn_response_envelope_msg(self):
- return lassomod.lecp_build_authn_response_envelope_msg(self)
-
def destroy(self):
lassomod.lecp_destroy(self)
- def init_authn_request_envelope(self, authnRequest):
- return lassomod.lecp_init_authn_request_envelope(self, authnRequest)
+ def init_authn_request(self, remote_providerID):
+ return lassomod.lecp_init_authn_request(self, remote_providerID)
- def init_authn_response_envelope(self, authnRequest, authnResponse):
- return lassomod.lecp_init_authn_response_envelope(self, authnRequest, authnResponse)
+ def init_from_authn_request_msg(self, authn_request_msg, authn_request_method):
+ return lassomod.lecp_init_from_authn_request_msg(self, authn_request_msg, authn_request_method)
def process_authn_request_envelope_msg(self, request_msg):
return lassomod.lecp_process_authn_request_envelope_msg(self, request_msg)
-
+
def process_authn_response_envelope_msg(self, response_msg):
return lassomod.lecp_process_authn_response_envelope_msg(self, response_msg)
diff --git a/python/lassomod.c b/python/lassomod.c
index 7a29481e..1d39fd2d 100644
--- a/python/lassomod.c
+++ b/python/lassomod.c
@@ -229,13 +229,13 @@ static PyMethodDef lasso_methods[] = {
/* py_lecp.h */
{"lecp_new", lecp_new, METH_VARARGS},
{"lecp_getattr", lecp_getattr, METH_VARARGS},
- {"lecp_build_authn_request_msg", lecp_build_authn_request_msg, METH_VARARGS},
{"lecp_build_authn_request_envelope_msg", lecp_build_authn_request_envelope_msg, METH_VARARGS},
+ {"lecp_build_authn_request_msg", lecp_build_authn_request_msg, METH_VARARGS},
{"lecp_build_authn_response_msg", lecp_build_authn_response_msg, METH_VARARGS},
{"lecp_build_authn_response_envelope_msg", lecp_build_authn_response_envelope_msg, METH_VARARGS},
{"lecp_destroy", lecp_destroy, METH_VARARGS},
- {"lecp_init_authn_request_envelope", lecp_init_authn_request_envelope, METH_VARARGS},
- {"lecp_init_authn_response_envelope", lecp_init_authn_response_envelope, METH_VARARGS},
+ {"lecp_init_authn_request", lecp_init_authn_request, METH_VARARGS},
+ {"lecp_init_from_authn_request_msg", lecp_init_from_authn_request_msg, METH_VARARGS},
{"lecp_process_authn_request_envelope_msg", lecp_process_authn_request_envelope_msg, METH_VARARGS},
{"lecp_process_authn_response_envelope_msg", lecp_process_authn_response_envelope_msg, METH_VARARGS},