summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-07-30 15:36:55 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-07-30 15:36:55 +0000
commit59c6cf97af8fd24d50d1bba610687d007ec19e3e (patch)
treeab8e10b75020eb04a773c729c3bc7f764e3d2538 /python
parent8fd99730d003cf1eff4b686fe13498952213ecc5 (diff)
downloadlasso-59c6cf97af8fd24d50d1bba610687d007ec19e3e.tar.gz
lasso-59c6cf97af8fd24d50d1bba610687d007ec19e3e.tar.xz
lasso-59c6cf97af8fd24d50d1bba610687d007ec19e3e.zip
*** empty log message ***
Diffstat (limited to 'python')
-rw-r--r--python/environs/py_lecp.c101
-rw-r--r--python/environs/py_lecp.h4
-rw-r--r--python/lasso.py29
-rw-r--r--python/lassomod.c4
4 files changed, 100 insertions, 38 deletions
diff --git a/python/environs/py_lecp.c b/python/environs/py_lecp.c
index 60aae49b..60792585 100644
--- a/python/environs/py_lecp.c
+++ b/python/environs/py_lecp.c
@@ -26,6 +26,10 @@
#include "../lassomod.h"
#include "py_lecp.h"
+#include "py_server.h"
+
+#include "../protocols/py_authn_request.h"
+#include "../protocols/py_authn_response.h"
PyObject *LassoLecp_wrap(LassoLecp *lecp) {
PyObject *ret;
@@ -42,8 +46,8 @@ PyObject *LassoLecp_wrap(LassoLecp *lecp) {
/******************************************************************************/
PyObject *lecp_getattr(PyObject *self, PyObject *args) {
- PyObject *lecp_obj;
- LassoLecp *lecp;
+ PyObject *lecp_obj;
+ LassoLecp *lecp;
const char *attr;
if (CheckArgs(args, "OS:lecp_get_attr")) {
@@ -55,12 +59,9 @@ PyObject *lecp_getattr(PyObject *self, PyObject *args) {
lecp = LassoLecp_get(lecp_obj);
if (!strcmp(attr, "__members__"))
- return Py_BuildValue("[ssss]", "identity", "msg_url", "msg_body",
- "msg_relayState");
- if (!strcmp(attr, "msg_url"))
- return (charPtrConst_wrap(LASSO_PROFILE(lecp)->msg_url));
+ return Py_BuildValue("[ss]", "msg_body");
if (!strcmp(attr, "msg_body"))
- return (charPtrConst_wrap(LASSO_PROFILE(lecp)->msg_body));
+ return (charPtrConst_wrap(lecp->msg_body));
Py_INCREF(Py_None);
return (Py_None);
@@ -80,6 +81,22 @@ PyObject *lecp_new(PyObject *self, PyObject *args) {
return (LassoLecp_wrap(lecp));
}
+PyObject *lecp_build_authn_request_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",
+ &lecp_obj))
+ return NULL;
+ }
+ else return NULL;
+
+ codeError = lasso_lecp_build_authn_request_msg(LassoLecp_get(lecp_obj));
+
+ return(int_wrap(codeError));
+}
+
PyObject *lecp_build_authn_request_envelope_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gint codeError = 0;
@@ -91,7 +108,23 @@ PyObject *lecp_build_authn_request_envelope_msg(PyObject *self, PyObject *args){
}
else return NULL;
-/* codeError = lasso_lecp_build_authn_request_envelope_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_response_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",
+ &lecp_obj))
+ return NULL;
+ }
+ else return NULL;
+
+ codeError = lasso_lecp_build_authn_response_msg(LassoLecp_get(lecp_obj));
return(int_wrap(codeError));
}
@@ -107,7 +140,7 @@ PyObject *lecp_build_authn_response_envelope_msg(PyObject *self, PyObject *args)
}
else return NULL;
-/* codeError = lecp_build_authn_response_envelope_msg(LassoLecp_get(lecp_obj)); */
+ codeError = lasso_lecp_build_authn_response_envelope_msg(LassoLecp_get(lecp_obj));
return(int_wrap(codeError));
}
@@ -130,34 +163,44 @@ PyObject *lecp_destroy(PyObject *self, PyObject *args){
PyObject *lecp_init_authn_request_envelope(PyObject *self, PyObject *args){
PyObject *lecp_obj;
- gchar *remote_providerID;
+ PyObject *server_obj;
+ PyObject *authnRequest_obj;
+
gint codeError = 0;
- if (CheckArgs(args, "Os:lecp_init_authn_request_envelope")) {
- if(!PyArg_ParseTuple(args, (char *) "Oz:lecp_init_authn_request_envelope",
- &lecp_obj, &remote_providerID))
+ if (CheckArgs(args, "OOO:lecp_init_authn_request_envelope")) {
+ if(!PyArg_ParseTuple(args, (char *) "OOO:lecp_init_authn_request_envelope",
+ &lecp_obj, &server_obj, &authnRequest_obj))
return NULL;
}
else return NULL;
-/* codeError = lecp_init_authn_request_envelope(LassoLecp_get(lecp_obj), remote_providerID); */
+ codeError = lasso_lecp_init_authn_request_envelope(LassoLecp_get(lecp_obj),
+ LassoServer_get(server_obj),
+ LassoAuthnRequest_get(authnRequest_obj));
return(int_wrap(codeError));
}
PyObject *lecp_init_authn_response_envelope(PyObject *self, PyObject *args){
PyObject *lecp_obj;
- gchar *remote_providerID;
+ PyObject *server_obj;
+ PyObject *authnRequest_obj;
+ PyObject *authnResponse_obj;
+
gint codeError = 0;
- if (CheckArgs(args, "Os:lecp_init_authn_response_envelope")) {
- if(!PyArg_ParseTuple(args, (char *) "Oz:lecp_init_authn_response_envelope",
- &lecp_obj, &remote_providerID))
+ if (CheckArgs(args, "OOOO:lecp_init_authn_response_envelope")) {
+ if(!PyArg_ParseTuple(args, (char *) "OOOO:lecp_init_authn_response_envelope",
+ &lecp_obj, &server_obj, &authnRequest_obj, &authnResponse_obj))
return NULL;
}
else return NULL;
-/* codeError = lecp_init_authn_request_envelope(LassoLecp_get(lecp_obj), remote_providerID); */
+ codeError = lasso_lecp_init_authn_response_envelope(LassoLecp_get(lecp_obj),
+ LassoServer_get(server_obj),
+ LassoAuthnRequest_get(authnRequest_obj),
+ LassoAuthnResponse_get(authnResponse_obj));
return(int_wrap(codeError));
}
@@ -165,17 +208,17 @@ PyObject *lecp_init_authn_response_envelope(PyObject *self, PyObject *args){
PyObject *lecp_process_authn_request_envelope_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gchar *request_msg;
- gint request_method;
+
gint codeError = 0;
- if (CheckArgs(args, "OSI:lecp_process_authn_request_envelope_msg")) {
- if(!PyArg_ParseTuple(args, (char *) "Osi:lecp_process_authn_request_envelope_msg",
- &lecp_obj, &request_msg, &request_method))
+ 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))
return NULL;
}
else return NULL;
-/* codeError = lasso_lecp_process_authn_request_envelope_msg(LassoLecp_get(lecp_obj), request_msg, request_method); */
+ codeError = lasso_lecp_process_authn_request_envelope_msg(LassoLecp_get(lecp_obj), request_msg);
return(int_wrap(codeError));
}
@@ -183,17 +226,17 @@ PyObject *lecp_process_authn_request_envelope_msg(PyObject *self, PyObject *args
PyObject *lecp_process_authn_response_envelope_msg(PyObject *self, PyObject *args){
PyObject *lecp_obj;
gchar *response_msg;
- gint response_method;
+
gint codeError = 0;
- if (CheckArgs(args, "OSI:lecp_process_authn_response_envelope_msg")) {
- if(!PyArg_ParseTuple(args, (char *) "Osi:lecp_process_authn_response_envelope_msg",
- &lecp_obj, &response_msg, &response_method))
+ 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))
return NULL;
}
else return NULL;
-/* codeError = lasso_lecp_process_authn_response_envelope_msg(LassoLecp_get(lecp_obj), response_msg, response_method); */
+ codeError = lasso_lecp_process_authn_response_envelope_msg(LassoLecp_get(lecp_obj), response_msg);
return(int_wrap(codeError));
}
diff --git a/python/environs/py_lecp.h b/python/environs/py_lecp.h
index bcf2cd50..ec24dbac 100644
--- a/python/environs/py_lecp.h
+++ b/python/environs/py_lecp.h
@@ -41,8 +41,12 @@ 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_response_msg(PyObject *self, PyObject *args);
+
PyObject *lecp_build_authn_response_envelope_msg(PyObject *self, PyObject *args);
PyObject *lecp_destroy(PyObject *self, PyObject *args);
diff --git a/python/lasso.py b/python/lasso.py
index 51e95699..c6653b17 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -1181,6 +1181,8 @@ class Lecp:
if name[:2] == "__" and name[-2:] == "__" and name != "__members__":
raise AttributeError, name
ret = lassomod.lecp_getattr(self, name)
+ if ret is None:
+ return None
return ret
def new(cls):
@@ -1188,20 +1190,29 @@ class Lecp:
return Lecp(obj)
new = classmethod(new)
+ def build_authn_request_msg(self):
+ return lassomod.lecp_build_authn_request_msg(self)
+
def build_authn_request_envelope_msg(self):
- pass
+ 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):
- pass
+ return lassomod.lecp_build_authn_response_envelope_msg(self)
def destroy(self):
- pass
+ lassomod.lecp_destroy(self)
- def init_authn_request_envelope(self):
- pass
+ def init_authn_request_envelope(self, server, authnRequest):
+ return lassomod.lecp_init_authn_request_envelope(self, server, authnRequest)
- def process_authn_request_envelope_msg(self):
- pass
+ def init_authn_response_envelope(self, server, authnRequest, authnResponse):
+ return lassomod.lecp_init_authn_response_envelope(self, server, authnRequest, authnResponse)
- def process_authn_response_envelope_msg(self):
- pass
+ 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 10457873..370fa0b6 100644
--- a/python/lassomod.c
+++ b/python/lassomod.c
@@ -223,10 +223,14 @@ 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_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_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},