diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-04-27 17:20:36 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-04-27 17:20:36 +0000 |
| commit | 6f1ffb6de23ab0c05f0eb7d1b4119f73a58d8bd8 (patch) | |
| tree | afda82e1ce1da0d3a9ee105835cfc80dbb466ea3 /python/protocols | |
| parent | 22e74ede81046574292d305a1bc1f123491c36d0 (diff) | |
| download | lasso-6f1ffb6de23ab0c05f0eb7d1b4119f73a58d8bd8.tar.gz lasso-6f1ffb6de23ab0c05f0eb7d1b4119f73a58d8bd8.tar.xz lasso-6f1ffb6de23ab0c05f0eb7d1b4119f73a58d8bd8.zip | |
add NameIdentifierMappingRequest/Response class and binding
Diffstat (limited to 'python/protocols')
4 files changed, 259 insertions, 0 deletions
diff --git a/python/protocols/py_name_identifier_mapping_request.c b/python/protocols/py_name_identifier_mapping_request.c new file mode 100644 index 00000000..7b691326 --- /dev/null +++ b/python/protocols/py_name_identifier_mapping_request.c @@ -0,0 +1,93 @@ +/* $Id$ + * + * PyLasso -- Python bindings for Lasso library + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.labs.libre-entreprise.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.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 "../xml/py_xml.h" +#include "py_name_identifier_mapping_request.h" + +PyObject *lassoNameIdentifierMappingRequest_wrap(LassoNameIdentifierMappingRequest *request) { + PyObject *ret; + + if (request == NULL) { + Py_INCREF(Py_None); + return (Py_None); + } + ret = PyCObject_FromVoidPtrAndDesc((void *) request, + (char *) "LassoNameIdentifierMappingRequest *", NULL); + return (ret); +} + +PyObject *name_identifier_mapping_request_getattr(PyObject *self, PyObject *args) { + PyObject *request_obj; + LassoNameIdentifierMappingRequest *request; + const char *attr; + + if (CheckArgs(args, "OS:name_identifier_mapping_request_get_attr")) { + if (!PyArg_ParseTuple(args, "Os:name_identifier_mapping_request_get_attr", &request_obj, &attr)) + return NULL; + } + else return NULL; + + request = lassoNameIdentifierMappingRequest_get(request_obj); + + Py_INCREF(Py_None); + return (Py_None); +} + +PyObject *name_identifier_mapping_request(PyObject *self, PyObject *args) { + const xmlChar *providerID; + const xmlChar *nameIdentifier; + const xmlChar *nameQualifier; + const xmlChar *format; + + LassoNameIdentifierMappingRequest *request; + + if(!PyArg_ParseTuple(args, (char *) "ssss:name_identifier_mapping_request", + &providerID, + &nameIdentifier, &nameQualifier, &format)) + return NULL; + + request = (LassoNameIdentifierMappingRequest *)lasso_name_identifier_mapping_request_new(providerID, + nameIdentifier, + nameQualifier, + format); + + return (lassoNameIdentifierMappingRequest_wrap(request)); +} + +PyObject *name_identifier_mapping_request_set_consent(PyObject *self, PyObject *args){ + PyObject *request_obj; + const xmlChar *consent; + + if(!PyArg_ParseTuple(args, (char *) "Os:name_identifier_mapping_request_set_consent", + &request_obj, &consent)) + return NULL; + + lasso_lib_name_identifier_mapping_request_set_consent(lassoNameIdentifierMappingRequest_get(request_obj), + consent); + + return (int_wrap(1)); +} diff --git a/python/protocols/py_name_identifier_mapping_request.h b/python/protocols/py_name_identifier_mapping_request.h new file mode 100644 index 00000000..fca869ca --- /dev/null +++ b/python/protocols/py_name_identifier_mapping_request.h @@ -0,0 +1,47 @@ +/* $Id$ + * + * PyLasso -- Python bindings for Lasso library + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.labs.libre-entreprise.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.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_NAME_IDENTIFIER_MAPPING_REQUEST_H__ +#define __PYLASSO_PY_NAME_IDENTIFIER_MAPPING_REQUEST_H__ + +#include <lasso/protocols/name_identifier_mapping_request.h> +#include <lasso/xml/lib_name_identifier_mapping_request.h> + +typedef struct { + PyObject_HEAD + LassoNameIdentifierMappingRequest *obj; +} LassoNameIdentifierMappingRequest_object; + +#define lassoNameIdentifierMappingRequest_get(v) (((v) == Py_None) ? NULL : (((LassoNameIdentifierMappingRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *lassoNameIdentifierMappingRequest_wrap(LassoNameIdentifierMappingRequest *request); + +PyObject *name_identifier_mapping_request_getattr(PyObject *self, PyObject *args); +PyObject *name_identifier_mapping_request(PyObject *self, PyObject *args); + +PyObject *name_identifier_mapping_request_set_sessionIndex(PyObject *self, PyObject *args); +PyObject *name_identifier_mapping_request_set_relayState(PyObject *self, PyObject *args); +PyObject *name_identifier_mapping_request_set_consent(PyObject *self, PyObject *args); + +#endif /* __PYLASSO_PY_NAME_IDENTIFIER_MAPPING_REQUEST_H__ */ diff --git a/python/protocols/py_name_identifier_mapping_response.c b/python/protocols/py_name_identifier_mapping_response.c new file mode 100644 index 00000000..76a2cd40 --- /dev/null +++ b/python/protocols/py_name_identifier_mapping_response.c @@ -0,0 +1,78 @@ +/* $Id$ + * + * PyLasso -- Python bindings for Lasso library + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.labs.libre-entreprise.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.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 "../xml/py_xml.h" +#include "py_name_identifier_mapping_request.h" +#include "py_name_identifier_mapping_response.h" + +PyObject *lassoNameIdentifierMappingResponse_wrap(LassoNameIdentifierMappingResponse *response) { + PyObject *ret; + + if (response == NULL) { + Py_INCREF(Py_None); + return (Py_None); + } + ret = PyCObject_FromVoidPtrAndDesc((void *) response, + (char *) "LassoNameIdentifierMappingResponse *", NULL); + return (ret); +} + +PyObject *name_identifier_mapping_response_getattr(PyObject *self, PyObject *args) { + PyObject *response_obj; + LassoNameIdentifierMappingResponse *response; + const char *attr; + + if (CheckArgs(args, "OS:name_identifier_mapping_response_get_attr")) { + if (!PyArg_ParseTuple(args, "Os:name_identifier_mapping_response_get_attr", &response_obj, &attr)) + return NULL; + } + else return NULL; + + response = lassoNameIdentifierMappingResponse_get(response_obj); + + Py_INCREF(Py_None); + return (Py_None); +} + +PyObject *name_identifier_mapping_response(PyObject *self, PyObject *args) { + const xmlChar *providerID; + const xmlChar *statusCodeValue; + PyObject *request_obj; + + LassoNameIdentifierMappingResponse *response; + + if(!PyArg_ParseTuple(args, (char *) "ssO:name_identifier_mapping_response", + &providerID, + &statusCodeValue, &request_obj)) + return NULL; + + response = (LassoNameIdentifierMappingResponse *)lasso_name_identifier_mapping_response_new(providerID, + statusCodeValue, + lassoNameIdentifierMappingRequest_get(request_obj)); + + return (lassoNameIdentifierMappingResponse_wrap(response)); +} diff --git a/python/protocols/py_name_identifier_mapping_response.h b/python/protocols/py_name_identifier_mapping_response.h new file mode 100644 index 00000000..cdf1bb59 --- /dev/null +++ b/python/protocols/py_name_identifier_mapping_response.h @@ -0,0 +1,41 @@ +/* $Id$ + * + * PyLasso -- Python bindings for Lasso library + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.labs.libre-entreprise.org + * + * Author: 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_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ +#define __PYLASSO_PY_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ + +#include <lasso/protocols/name_identifier_mapping_response.h> + +typedef struct { + PyObject_HEAD + LassoNameIdentifierMappingResponse *obj; +} LassoNameIdentifierMappingResponse_object; + +#define lassoNameIdentifierMappingResponse_get(v) (((v) == Py_None) ? NULL : (((LassoNameIdentifierMappingResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *lassoNameIdentifierMappingResponse_wrap(LassoNameIdentifierMappingResponse *response); + +PyObject *name_identifier_mapping_response_getattr(PyObject *self, PyObject *args); +PyObject *name_identifier_mapping_response(PyObject *self, PyObject *args); + +#endif /* __PYLASSO_PY_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ */ |
