diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-05-11 16:50:24 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-05-11 16:50:24 +0000 |
| commit | 1c046dbd78cb7e3b611eeeb28170b593278f9e79 (patch) | |
| tree | 22bcd82e3f3b37ec3f127af3999c9179938d7edf /python | |
| parent | 2e5edf85b8c23ef73069dbd37e453c7e2d30545a (diff) | |
| download | lasso-1c046dbd78cb7e3b611eeeb28170b593278f9e79.tar.gz lasso-1c046dbd78cb7e3b611eeeb28170b593278f9e79.tar.xz lasso-1c046dbd78cb7e3b611eeeb28170b593278f9e79.zip | |
name identifier mapping response low class binding and, examples ...
Diffstat (limited to 'python')
| -rw-r--r-- | python/examples/mapping.py | 38 | ||||
| -rw-r--r-- | python/xml/py_lib_name_identifier_mapping_response.c | 50 | ||||
| -rw-r--r-- | python/xml/py_lib_name_identifier_mapping_response.h | 42 |
3 files changed, 130 insertions, 0 deletions
diff --git a/python/examples/mapping.py b/python/examples/mapping.py new file mode 100644 index 00000000..bde6ec57 --- /dev/null +++ b/python/examples/mapping.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python + +import sys +sys.path.insert(0, '../') +import lasso + +lasso.init() + +req = lasso.NameIdentifierMappingRequest.new("http://providerid.com", + "CDSC7SCD65SCDSDCCDS", "http://qualifier.com", "federated") +print 'dump req : ', req.dump() + +query = req.url_encode(1, './rsakey.pem') +print 'req url encoded : ', query + +soap = req.soap_envelop() +print 'req soap envelopped : ', soap + +req = lasso.NameIdentifierMappingRequest.new_from_query(query) +print 'dump req2 from query : ', req.dump() + +req = lasso.NameIdentifierMappingRequest.new_from_soap(soap) +print 'dump req3 from soap : ', req.dump() + +res = lasso.NameIdentifierMappingResponse.new_from_request_soap(soap, "http://providerid.com", "success") +print 'dump res from request soap : ', res.dump() + +query = res.url_encode(1, 'rsakey.pem') +soap = res.soap_envelop() + +#res = lasso.NameIdentifierMappingResponse.new_from_request_query(query, "http://providerid.com", "success") +#print 'dump res from request query : ', res.dump() + +res = lasso.NameIdentifierMappingResponse.new_from_soap(soap) +print 'dump res from request soap : ', res.dump() + +res = lasso.NameIdentifierMappingResponse.new_from_query(query) +print 'dump res from request query : ', res.dump() diff --git a/python/xml/py_lib_name_identifier_mapping_response.c b/python/xml/py_lib_name_identifier_mapping_response.c new file mode 100644 index 00000000..af66ffd1 --- /dev/null +++ b/python/xml/py_lib_name_identifier_mapping_response.c @@ -0,0 +1,50 @@ +/* $Id$ + * + * PyLasso -- Python bindings for Lasso library + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.labs.libre-entreprise.org + * + * Authors: 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 "py_lib_name_identifier_mapping_response.h" + +PyObject *LassoLibNameIdentifierMappingResponse_wrap(LassoLibNameIdentifierMappingResponse *response) { + PyObject *ret; + + if (response == NULL) { + Py_INCREF(Py_None); + return (Py_None); + } + ret = PyCObject_FromVoidPtrAndDesc((void *) response, + (char *) "LassoLibNameIdentifierMappingResponse *", NULL); + return (ret); +} + +/******************************************************************************/ + +PyObject *lib_name_identifier_mapping_response_new(PyObject *self, PyObject *args) { + LassoNode *response; + + response = lasso_lib_name_identifier_mapping_response_new(); + + return (LassoLibNameIdentifierMappingResponse_wrap(LASSO_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE(response))); +} diff --git a/python/xml/py_lib_name_identifier_mapping_response.h b/python/xml/py_lib_name_identifier_mapping_response.h new file mode 100644 index 00000000..0d96ffb3 --- /dev/null +++ b/python/xml/py_lib_name_identifier_mapping_response.h @@ -0,0 +1,42 @@ +/* $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_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ +#define __PYLASSO_PY_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ + +#include <lasso/xml/lib_name_identifier_mapping_response.h> + +typedef struct { + PyObject_HEAD + LassoLibNameIdentifierMappingResponse *obj; +} LassoLibNameIdentifierMappingResponse_object; + +#define LassoLibNameIdentifierMappingResponse_get(v) (((v) == Py_None) ? NULL : (((LassoLibNameIdentifierMappingResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *LassoLibNameIdentifierMappingResponse_wrap(LassoLibNameIdentifierMappingResponse *response); + +PyObject *lib_name_identifier_mapping_response_new(PyObject *self, PyObject *args); +PyObject *lib_name_identifier_mapping_response_set_consent(PyObject *self, PyObject *args); + +#endif /* __PYLASSO_PY_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ */ |
