summaryrefslogtreecommitdiffstats
path: root/python/environs
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-07-25 09:24:26 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-07-25 09:24:26 +0000
commitd4b79b874b04c57e23eddae03b9105f282c817a8 (patch)
treed0cc32ff860dcc9fdd948490070a07d91cf84e60 /python/environs
parent3d230ade52498c06e36b7f46840d2504b407b6c7 (diff)
downloadlasso-d4b79b874b04c57e23eddae03b9105f282c817a8.tar.gz
lasso-d4b79b874b04c57e23eddae03b9105f282c817a8.tar.xz
lasso-d4b79b874b04c57e23eddae03b9105f282c817a8.zip
udpate of C lecp, add python lecp
Diffstat (limited to 'python/environs')
-rw-r--r--python/environs/Makefile.am4
-rw-r--r--python/environs/py_lecp.c199
-rw-r--r--python/environs/py_lecp.h58
3 files changed, 259 insertions, 2 deletions
diff --git a/python/environs/Makefile.am b/python/environs/Makefile.am
index 72a98510..1d12ea3c 100644
--- a/python/environs/Makefile.am
+++ b/python/environs/Makefile.am
@@ -8,12 +8,12 @@ INCLUDES = \
$(NULL)
-ENVSOURCES = py_federation_termination.c py_login.c py_logout.c py_profile_context.c py_register_name_identifier.c py_server.c py_user.c
+ENVSOURCES = py_federation_termination.c py_lecp.c py_login.c py_logout.c py_profile_context.c py_register_name_identifier.c py_server.c py_user.c
if WITH_PYTHON
noinst_LIBRARIES = libenvirons.a
libenvirons_a_SOURCES = $(ENVSOURCES)
endif
-EXTRA_DIST = $(ENVSOURCES) py_federation_termination.h py_login.h py_logout.h py_profile_context.h py_register_name_identifier.h py_server.h py_user.h
+EXTRA_DIST = $(ENVSOURCES) py_federation_termination.h py_lecp.h py_login.h py_logout.h py_profile_context.h py_register_name_identifier.h py_server.h py_user.h
diff --git a/python/environs/py_lecp.c b/python/environs/py_lecp.c
new file mode 100644
index 00000000..2859bd3c
--- /dev/null
+++ b/python/environs/py_lecp.c
@@ -0,0 +1,199 @@
+/* $Id$
+ *
+ * PyLasso -- Python bindings for Lasso library
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "../lassomod.h"
+
+#include "py_lecp.h"
+
+PyObject *LassoLecp_wrap(LassoLecp *lecp) {
+ PyObject *ret;
+
+ if (lecp == NULL) {
+ Py_INCREF(Py_None);
+ return (Py_None);
+ }
+ ret = PyCObject_FromVoidPtrAndDesc((void *) lecp,
+ (char *) "LassoLecp *", NULL);
+ return (ret);
+}
+
+/******************************************************************************/
+
+PyObject *lecp_getattr(PyObject *self, PyObject *args) {
+ PyObject *lecp_obj;
+ LassoLecp *lecp;
+ const char *attr;
+
+ if (CheckArgs(args, "OS:lecp_get_attr")) {
+ if (!PyArg_ParseTuple(args, "Os:lecp_get_attr", &lecp_obj, &attr))
+ return NULL;
+ }
+ else return NULL;
+
+ lecp = LassoLecp_get(lecp_obj);
+
+ if (!strcmp(attr, "__members__"))
+ return Py_BuildValue("[ssss]", "user", "msg_url", "msg_body",
+ "msg_relayState");
+ if (!strcmp(attr, "msg_url"))
+ return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(lecp)->msg_url));
+ if (!strcmp(attr, "msg_body"))
+ return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(lecp)->msg_body));
+
+ Py_INCREF(Py_None);
+ return (Py_None);
+}
+
+PyObject *lecp_new(PyObject *self, PyObject *args) {
+ LassoLecp *lecp;
+
+ if (CheckArgs(args, ":lecp_new")) {
+ if(!PyArg_ParseTuple(args, (char *) ":lecp_new"))
+ return NULL;
+ }
+ else return NULL;
+
+ lecp = lasso_lecp_new();
+
+ return (LassoLecp_wrap(lecp));
+}
+
+PyObject *lecp_build_authn_request_envelope_msg(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+ gint codeError;
+
+ 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_envelope_msg(LassoLecp_get(lecp_obj)); */
+
+ return(int_wrap(codeError));
+}
+
+PyObject *lecp_build_authn_response_envelope_msg(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+ gint codeError;
+
+ 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 = lecp_build_authn_response_envelope_msg(LassoLecp_get(lecp_obj)); */
+
+ return(int_wrap(codeError));
+}
+
+PyObject *lecp_destroy(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+
+ if (CheckArgs(args, "O:lecp_destroy")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:lecp_destroy",
+ &lecp_obj))
+ return NULL;
+ }
+ else return NULL;
+
+ lasso_lecp_destroy(LassoLecp_get(lecp_obj));
+
+ Py_INCREF(Py_None);
+ return(Py_None);
+}
+
+PyObject *lecp_init_authn_request_envelope(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+ gchar *remote_providerID;
+ gint codeError;
+
+ if (CheckArgs(args, "Os:lecp_init_authn_request_envelope")) {
+ if(!PyArg_ParseTuple(args, (char *) "Oz:lecp_init_authn_request_envelope",
+ &lecp_obj, &remote_providerID))
+ return NULL;
+ }
+ else return NULL;
+
+/* codeError = lecp_init_authn_request_envelope(LassoLecp_get(lecp_obj), remote_providerID); */
+
+ return(int_wrap(codeError));
+}
+
+PyObject *lecp_init_authn_response_envelope(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+ gchar *remote_providerID;
+ gint codeError;
+
+ if (CheckArgs(args, "Os:lecp_init_authn_response_envelope")) {
+ if(!PyArg_ParseTuple(args, (char *) "Oz:lecp_init_authn_response_envelope",
+ &lecp_obj, &remote_providerID))
+ return NULL;
+ }
+ else return NULL;
+
+/* codeError = lecp_init_authn_request_envelope(LassoLecp_get(lecp_obj), remote_providerID); */
+
+ return(int_wrap(codeError));
+}
+
+PyObject *lecp_process_authn_request_envelope_msg(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+ gchar *request_msg;
+ gint request_method;
+ gint codeError;
+
+ 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))
+ return NULL;
+ }
+ else return NULL;
+
+/* codeError = lasso_lecp_process_authn_request_envelope_msg(LassoLecp_get(lecp_obj), request_msg, request_method); */
+
+ return(int_wrap(codeError));
+}
+
+PyObject *lecp_process_authn_response_envelope_msg(PyObject *self, PyObject *args){
+ PyObject *lecp_obj;
+ gchar *response_msg;
+ gint response_method;
+ gint codeError;
+
+ 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))
+ return NULL;
+ }
+ else return NULL;
+
+/* codeError = lasso_lecp_process_authn_response_envelope_msg(LassoLecp_get(lecp_obj), response_msg, response_method); */
+
+ return(int_wrap(codeError));
+}
diff --git a/python/environs/py_lecp.h b/python/environs/py_lecp.h
new file mode 100644
index 00000000..bcf2cd50
--- /dev/null
+++ b/python/environs/py_lecp.h
@@ -0,0 +1,58 @@
+/* $Id$
+ *
+ * PyLasso -- Python bindings for Lasso library
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __PYLASSO_PY_LECP_H__
+#define __PYLASSO_PY_LECP_H__
+
+#include <lasso/environs/lecp.h>
+
+typedef struct {
+ PyObject_HEAD
+ LassoLecp *obj;
+} LassoLecp_object;
+
+#define LassoLecp_get(v) (((v) == Py_None) ? NULL : (((LassoLecp_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj))
+PyObject *LassoLecp_wrap(LassoLecp *lecp);
+
+PyObject *lecp_getattr(PyObject *self, PyObject *args);
+
+PyObject *lecp_new(PyObject *self, PyObject *args);
+
+
+PyObject *lecp_build_authn_request_envelope_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_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__ */