diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-05-02 22:19:01 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-05-02 22:19:01 +0000 |
| commit | fadb14e123c3f661d79cfca4192985bfaf1d5bb9 (patch) | |
| tree | ade93fa8dd752506de98e13da186e649bc689347 /python/protocols | |
| parent | 290e743aa70ca648d9e252209130aaa2fe1c1c2d (diff) | |
| download | lasso-fadb14e123c3f661d79cfca4192985bfaf1d5bb9.tar.gz lasso-fadb14e123c3f661d79cfca4192985bfaf1d5bb9.tar.xz lasso-fadb14e123c3f661d79cfca4192985bfaf1d5bb9.zip | |
Many many changes
Diffstat (limited to 'python/protocols')
| -rw-r--r-- | python/protocols/py_authn_request.c | 23 | ||||
| -rw-r--r-- | python/protocols/py_authn_request.h | 5 | ||||
| -rw-r--r-- | python/protocols/py_federation_termination_notification.c | 64 | ||||
| -rw-r--r-- | python/protocols/py_federation_termination_notification.h | 8 | ||||
| -rw-r--r-- | python/protocols/py_logout_request.c | 90 | ||||
| -rw-r--r-- | python/protocols/py_logout_request.h | 10 | ||||
| -rw-r--r-- | python/protocols/py_logout_response.c | 49 | ||||
| -rw-r--r-- | python/protocols/py_logout_response.h | 7 | ||||
| -rw-r--r-- | python/protocols/py_name_identifier_mapping_request.c | 61 | ||||
| -rw-r--r-- | python/protocols/py_name_identifier_mapping_request.h | 12 | ||||
| -rw-r--r-- | python/protocols/py_name_identifier_mapping_response.c | 45 | ||||
| -rw-r--r-- | python/protocols/py_name_identifier_mapping_response.h | 7 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_request.c | 95 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_request.h | 8 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_response.c | 46 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_response.h | 7 |
16 files changed, 175 insertions, 362 deletions
diff --git a/python/protocols/py_authn_request.c b/python/protocols/py_authn_request.c index d0b197f6..f52e95b3 100644 --- a/python/protocols/py_authn_request.c +++ b/python/protocols/py_authn_request.c @@ -5,7 +5,8 @@ * Copyright (C) 2004 Entr'ouvert * http://lasso.labs.libre-entreprise.org * - * Author: Valery Febvre <vfebvre@easter-eggs.com> + * 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 @@ -24,13 +25,8 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" #include "py_authn_request.h" -/******************************************************************************/ -/* LassoAuthnRequest */ -/******************************************************************************/ - PyObject *LassoAuthnRequest_wrap(LassoAuthnRequest *request) { PyObject *ret; @@ -98,3 +94,18 @@ PyObject *authn_request_set_scoping(PyObject *self, PyObject *args) { Py_INCREF(Py_None); return (Py_None); } + +/******************************************************************************/ + +PyObject *authn_request_get_protocolProfile(PyObject *self, PyObject *args) { + xmlChar *query; + xmlChar *protocolProfile; + + if(!PyArg_ParseTuple(args, (char *) "s:authn_request_get_protocolProfile", + &query)) + return NULL; + + protocolProfile = lasso_authn_request_get_protocolProfile(query); + + return (xmlCharPtr_wrap(protocolProfile)); +} diff --git a/python/protocols/py_authn_request.h b/python/protocols/py_authn_request.h index f2dfa2ad..992d9749 100644 --- a/python/protocols/py_authn_request.h +++ b/python/protocols/py_authn_request.h @@ -5,7 +5,8 @@ * Copyright (C) 2004 Entr'ouvert * http://lasso.labs.libre-entreprise.org * - * Author: Valery Febvre <vfebvre@easter-eggs.com> + * 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 @@ -39,4 +40,6 @@ PyObject *authn_request_new(PyObject *self, PyObject *args); PyObject *authn_request_set_requestAuthnContext(PyObject *self, PyObject *args); PyObject *authn_request_set_scoping(PyObject *self, PyObject *args); +PyObject *authn_request_get_protocolProfile(PyObject *self, PyObject *args); + #endif /* __PYLASSO_PY_AUTHN_REQUEST_H__ */ diff --git a/python/protocols/py_federation_termination_notification.c b/python/protocols/py_federation_termination_notification.c index 059b8524..08cb780e 100644 --- a/python/protocols/py_federation_termination_notification.c +++ b/python/protocols/py_federation_termination_notification.c @@ -25,11 +25,9 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" #include "py_federation_termination_notification.h" - -PyObject *lassoFederationTerminationNotification_wrap(LassoFederationTerminationNotification *notification) { +PyObject *LassoFederationTerminationNotification_wrap(LassoFederationTerminationNotification *notification) { PyObject *ret; if (notification == NULL) { @@ -41,54 +39,28 @@ PyObject *lassoFederationTerminationNotification_wrap(LassoFederationTermination return (ret); } -PyObject *federation_termination_notification_getattr(PyObject *self, PyObject *args) { - PyObject *notification_obj; - LassoFederationTerminationNotification *notification; - const char *attr; - - if (CheckArgs(args, "OS:federation_termination_notification_get_attr")) { - if (!PyArg_ParseTuple(args, "Os:federation_termination_notification_get_attr", ¬ification_obj, &attr)) - return NULL; - } - else return NULL; - - notification = lassoFederationTerminationNotification_get(notification_obj); - - Py_INCREF(Py_None); - return (Py_None); -} +/******************************************************************************/ -PyObject *federation_termination_notification(PyObject *self, PyObject *args) { +PyObject *federation_termination_notification_new(PyObject *self, PyObject *args) { const xmlChar *providerID; const xmlChar *nameIdentifier; - const xmlChar *nameQualifier; - const xmlChar *format; - - LassoFederationTerminationNotification *notification; + const xmlChar *nameQualifier = NULL; + const xmlChar *format = NULL; - if(!PyArg_ParseTuple(args, (char *) "ssss:federation_termination_notification", - &providerID, - &nameIdentifier, &nameQualifier, &format)) - return NULL; + LassoNode *notification; - notification = (LassoFederationTerminationNotification *)lasso_federation_termination_notification_new(providerID, - nameIdentifier, - nameQualifier, - format); - - return (lassoFederationTerminationNotification_wrap(notification)); -} + if (CheckArgs(args, "SSss:federation_termination_notification_new")) { + if(!PyArg_ParseTuple(args, (char *) "sszz:federation_termination_notification_new", + &providerID, &nameIdentifier, + &nameQualifier, &format)) + return NULL; + } + else return NULL; -PyObject *federation_termination_notification_set_consent(PyObject *self, PyObject *args){ - PyObject *request_obj; - const xmlChar *consent; - - if(!PyArg_ParseTuple(args, (char *) "Os:federation_termination_notification_set_consent", - &request_obj, &consent)) - return NULL; + notification = lasso_federation_termination_notification_new(providerID, + nameIdentifier, + nameQualifier, + format); - lasso_lib_federation_termination_notification_set_consent(lassoFederationTerminationNotification_get(request_obj), - consent); - - return (int_wrap(1)); + return (LassoFederationTerminationNotification_wrap(LASSO_FEDERATION_TERMINATION_NOTIFICATION(notification))); } diff --git a/python/protocols/py_federation_termination_notification.h b/python/protocols/py_federation_termination_notification.h index a3a17146..a20a947e 100644 --- a/python/protocols/py_federation_termination_notification.h +++ b/python/protocols/py_federation_termination_notification.h @@ -33,11 +33,9 @@ typedef struct { LassoFederationTerminationNotification *obj; } LassoFederationTerminationNotification_object; -#define lassoFederationTerminationNotification_get(v) (((v) == Py_None) ? NULL : (((LassoFederationTerminationNotification_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) -PyObject *lassoFederationTerminationNotification_wrap(LassoFederationTerminationNotification *notification); +#define LassoFederationTerminationNotification_get(v) (((v) == Py_None) ? NULL : (((LassoFederationTerminationNotification_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *LassoFederationTerminationNotification_wrap(LassoFederationTerminationNotification *notification); -PyObject *federation_termination_notification_getattr(PyObject *self, PyObject *args); -PyObject *federation_termination_notification(PyObject *self, PyObject *args); -PyObject *federation_termination_notification_set_consent(PyObject *self, PyObject *args); +PyObject *federation_termination_notification_new(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_FEDERATION_TERMINATION_NOTIFICATION_H__ */ diff --git a/python/protocols/py_logout_request.c b/python/protocols/py_logout_request.c index f876e325..86e9d282 100644 --- a/python/protocols/py_logout_request.c +++ b/python/protocols/py_logout_request.c @@ -25,11 +25,9 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" #include "py_logout_request.h" - -PyObject *lassoLogoutRequest_wrap(LassoLogoutRequest *request) { +PyObject *LassoLogoutRequest_wrap(LassoLogoutRequest *request) { PyObject *ret; if (request == NULL) { @@ -41,83 +39,25 @@ PyObject *lassoLogoutRequest_wrap(LassoLogoutRequest *request) { return (ret); } -PyObject *logout_request_getattr(PyObject *self, PyObject *args) { - PyObject *request_obj; - LassoLogoutRequest *request; - const char *attr; - - if (CheckArgs(args, "OS:logout_request_get_attr")) { - if (!PyArg_ParseTuple(args, "Os:logout_request_get_attr", &request_obj, &attr)) - return NULL; - } - else return NULL; - - request = lassoLogoutRequest_get(request_obj); +/******************************************************************************/ - Py_INCREF(Py_None); - return (Py_None); -} - -PyObject *logout_request(PyObject *self, PyObject *args) { +PyObject *logout_request_new(PyObject *self, PyObject *args) { const xmlChar *providerID; const xmlChar *nameIdentifier; - const xmlChar *nameQualifier; - const xmlChar *format; - - LassoLogoutRequest *request; + const xmlChar *nameQualifier = NULL; + const xmlChar *format = NULL; - if(!PyArg_ParseTuple(args, (char *) "ssss:logout_request", - &providerID, - &nameIdentifier, &nameQualifier, &format)) - return NULL; - - request = (LassoLogoutRequest *)lasso_logout_request_new(providerID, - nameIdentifier, - nameQualifier, - format); - - return (lassoLogoutRequest_wrap(request)); -} + LassoNode *request; -PyObject *logout_request_set_sessionIndex(PyObject *self, PyObject *args){ - PyObject *request_obj; - const xmlChar *sessionIndex; - - if(!PyArg_ParseTuple(args, (char *) "Os:logout_request_set_sessionIndex", - &request_obj, &sessionIndex)) - return NULL; - - lasso_lib_logout_request_set_sessionIndex(lassoLogoutRequest_get(request_obj), - sessionIndex); - - return (int_wrap(1)); -} - -PyObject *logout_request_set_relayState(PyObject *self, PyObject *args){ - PyObject *request_obj; - const xmlChar *relayState; - - if(!PyArg_ParseTuple(args, (char *) "Os:logout_request_set_relayState", - &request_obj, &relayState)) - return NULL; - - lasso_lib_logout_request_set_relayState(lassoLogoutRequest_get(request_obj), - relayState); - - return (int_wrap(1)); -} - -PyObject *logout_request_set_consent(PyObject *self, PyObject *args){ - PyObject *request_obj; - const xmlChar *consent; - + if (CheckArgs(args, "SSss:logout_request_new")) { + if(!PyArg_ParseTuple(args, (char *) "sszz:logout_request_new", + &providerID, &nameIdentifier, &nameQualifier, &format)) + return NULL; + } + else return NULL; - if(!PyArg_ParseTuple(args, (char *) "Os:logout_request_set_consent", - &request_obj, &consent)) - return NULL; + request = lasso_logout_request_new(providerID, nameIdentifier, + nameQualifier, format); - lasso_lib_logout_request_set_consent(lassoLogoutRequest_get(request_obj), - consent); - - return (int_wrap(1)); + return (LassoLogoutRequest_wrap(LASSO_LOGOUT_REQUEST(request))); } diff --git a/python/protocols/py_logout_request.h b/python/protocols/py_logout_request.h index af305e34..4357767f 100644 --- a/python/protocols/py_logout_request.h +++ b/python/protocols/py_logout_request.h @@ -34,14 +34,10 @@ typedef struct { LassoLogoutRequest *obj; } LassoLogoutRequest_object; -#define lassoLogoutRequest_get(v) (((v) == Py_None) ? NULL : (((LassoLogoutRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) -PyObject *lassoLogoutRequest_wrap(LassoLogoutRequest *request); +#define LassoLogoutRequest_get(v) (((v) == Py_None) ? NULL : (((LassoLogoutRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *LassoLogoutRequest_wrap(LassoLogoutRequest *request); PyObject *logout_request_getattr(PyObject *self, PyObject *args); -PyObject *logout_request(PyObject *self, PyObject *args); - -PyObject *logout_request_set_sessionIndex(PyObject *self, PyObject *args); -PyObject *logout_request_set_relayState(PyObject *self, PyObject *args); -PyObject *logout_request_set_consent(PyObject *self, PyObject *args); +PyObject *logout_request_new(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_LOGOUT_REQUEST_H__ */ diff --git a/python/protocols/py_logout_response.c b/python/protocols/py_logout_response.c index 8ee1eb40..ee71dad2 100644 --- a/python/protocols/py_logout_response.c +++ b/python/protocols/py_logout_response.c @@ -25,12 +25,10 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" -#include "py_logout_request.h" #include "py_logout_response.h" +#include "py_logout_request.h" - -PyObject *lassoLogoutResponse_wrap(LassoLogoutResponse *response) { +PyObject *LassoLogoutResponse_wrap(LassoLogoutResponse *response) { PyObject *ret; if (response == NULL) { @@ -42,39 +40,26 @@ PyObject *lassoLogoutResponse_wrap(LassoLogoutResponse *response) { return (ret); } +/******************************************************************************/ -PyObject *logout_response_getattr(PyObject *self, PyObject *args) { - PyObject *response_obj; - LassoLogoutResponse *response; - const char *attr; +PyObject *logout_response_new(PyObject *self, PyObject *args) { + const xmlChar *providerID; + const xmlChar *statusCodeValue; + PyObject *request_obj; - if (CheckArgs(args, "OS:logout_response_get_attr")) { - if (!PyArg_ParseTuple(args, "Os:logout_response_get_attr", &response_obj, &attr)) + LassoNode *response; + + if (CheckArgs(args, "SSO:logout_response_new")) { + if(!PyArg_ParseTuple(args, (char *) "ssO:logout_response_new", + &providerID, + &statusCodeValue, &request_obj)) return NULL; } else return NULL; - response = lassoLogoutResponse_get(response_obj); - - Py_INCREF(Py_None); - return (Py_None); -} - -PyObject *logout_response(PyObject *self, PyObject *args) { - const xmlChar *providerID; - const xmlChar *statusCodeValue; - PyObject *request_obj; - - LassoLogoutResponse *response; - - if(!PyArg_ParseTuple(args, (char *) "ssO:logout_response", - &providerID, - &statusCodeValue, &request_obj)) - return NULL; - - response = (LassoLogoutResponse *)lasso_logout_response_new(providerID, - statusCodeValue, - lassoLogoutRequest_get(request_obj)); + response = lasso_logout_response_new(providerID, + statusCodeValue, + LassoLogoutRequest_get(request_obj)); - return (lassoLogoutResponse_wrap(response)); + return (LassoLogoutResponse_wrap(LASSO_LOGOUT_RESPONSE(response))); } diff --git a/python/protocols/py_logout_response.h b/python/protocols/py_logout_response.h index cace07dc..faad0c25 100644 --- a/python/protocols/py_logout_response.h +++ b/python/protocols/py_logout_response.h @@ -32,10 +32,9 @@ typedef struct { LassoLogoutResponse *obj; } LassoLogoutResponse_object; -#define lassoLogoutResponse_get(v) (((v) == Py_None) ? NULL : (((LassoLogoutResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) -PyObject *lassoLogoutResponse_wrap(LassoLogoutResponse *response); +#define LassoLogoutResponse_get(v) (((v) == Py_None) ? NULL : (((LassoLogoutResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *LassoLogoutResponse_wrap(LassoLogoutResponse *response); -PyObject *logout_response_getattr(PyObject *self, PyObject *args); -PyObject *logout_response(PyObject *self, PyObject *args); +PyObject *logout_response_new(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_LOGOUT_RESPONSE_H__ */ diff --git a/python/protocols/py_name_identifier_mapping_request.c b/python/protocols/py_name_identifier_mapping_request.c index 7b691326..bcc02cab 100644 --- a/python/protocols/py_name_identifier_mapping_request.c +++ b/python/protocols/py_name_identifier_mapping_request.c @@ -25,10 +25,9 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" #include "py_name_identifier_mapping_request.h" -PyObject *lassoNameIdentifierMappingRequest_wrap(LassoNameIdentifierMappingRequest *request) { +PyObject *LassoNameIdentifierMappingRequest_wrap(LassoNameIdentifierMappingRequest *request) { PyObject *ret; if (request == NULL) { @@ -40,54 +39,26 @@ PyObject *lassoNameIdentifierMappingRequest_wrap(LassoNameIdentifierMappingReque 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) { +PyObject *name_identifier_mapping_request_new(PyObject *self, PyObject *args) { const xmlChar *providerID; const xmlChar *nameIdentifier; - const xmlChar *nameQualifier; - const xmlChar *format; + const xmlChar *nameQualifier = NULL; + const xmlChar *format = NULL; - LassoNameIdentifierMappingRequest *request; + LassoNode *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)); -} + if (CheckArgs(args, "SSss:name_identifier_mapping_request_new")) { + if(!PyArg_ParseTuple(args, (char *) "sszz:name_identifier_mapping_request_new", + &providerID, &nameIdentifier, + &nameQualifier, &format)) + return NULL; + } + else return NULL; -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; + request = lasso_name_identifier_mapping_request_new(providerID, nameIdentifier, + nameQualifier, format); - lasso_lib_name_identifier_mapping_request_set_consent(lassoNameIdentifierMappingRequest_get(request_obj), - consent); - - return (int_wrap(1)); + return (LassoNameIdentifierMappingRequest_wrap(LASSO_NAME_IDENTIFIER_MAPPING_REQUEST(request))); } diff --git a/python/protocols/py_name_identifier_mapping_request.h b/python/protocols/py_name_identifier_mapping_request.h index fca869ca..f9e17f39 100644 --- a/python/protocols/py_name_identifier_mapping_request.h +++ b/python/protocols/py_name_identifier_mapping_request.h @@ -27,21 +27,15 @@ #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); +#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); +PyObject *name_identifier_mapping_request_new(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 index 76a2cd40..6cd90c57 100644 --- a/python/protocols/py_name_identifier_mapping_response.c +++ b/python/protocols/py_name_identifier_mapping_response.c @@ -25,11 +25,10 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" -#include "py_name_identifier_mapping_request.h" #include "py_name_identifier_mapping_response.h" +#include "py_name_identifier_mapping_request.h" -PyObject *lassoNameIdentifierMappingResponse_wrap(LassoNameIdentifierMappingResponse *response) { +PyObject *LassoNameIdentifierMappingResponse_wrap(LassoNameIdentifierMappingResponse *response) { PyObject *ret; if (response == NULL) { @@ -41,38 +40,26 @@ PyObject *lassoNameIdentifierMappingResponse_wrap(LassoNameIdentifierMappingResp 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) { +PyObject *name_identifier_mapping_response_new(PyObject *self, PyObject *args) { const xmlChar *providerID; const xmlChar *statusCodeValue; PyObject *request_obj; - LassoNameIdentifierMappingResponse *response; + LassoNode *response; - if(!PyArg_ParseTuple(args, (char *) "ssO:name_identifier_mapping_response", - &providerID, - &statusCodeValue, &request_obj)) - return NULL; + if (CheckArgs(args, "SSO:name_identifier_mapping_response_new")) { + if(!PyArg_ParseTuple(args, (char *) "ssO:name_identifier_mapping_response_new", + &providerID, + &statusCodeValue, &request_obj)) + return NULL; + } + else return NULL; - response = (LassoNameIdentifierMappingResponse *)lasso_name_identifier_mapping_response_new(providerID, - statusCodeValue, - lassoNameIdentifierMappingRequest_get(request_obj)); + response = lasso_name_identifier_mapping_response_new(providerID, + statusCodeValue, + LassoNameIdentifierMappingRequest_get(request_obj)); - return (lassoNameIdentifierMappingResponse_wrap(response)); + return (LassoNameIdentifierMappingResponse_wrap(LASSO_NAME_IDENTIFIER_MAPPING_RESPONSE(response))); } diff --git a/python/protocols/py_name_identifier_mapping_response.h b/python/protocols/py_name_identifier_mapping_response.h index cdf1bb59..50ac6a42 100644 --- a/python/protocols/py_name_identifier_mapping_response.h +++ b/python/protocols/py_name_identifier_mapping_response.h @@ -32,10 +32,9 @@ typedef struct { 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); +#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); +PyObject *name_identifier_mapping_response_new(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ */ diff --git a/python/protocols/py_register_name_identifier_request.c b/python/protocols/py_register_name_identifier_request.c index 3a7476e5..4d6081be 100644 --- a/python/protocols/py_register_name_identifier_request.c +++ b/python/protocols/py_register_name_identifier_request.c @@ -25,10 +25,9 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" #include "py_register_name_identifier_request.h" -PyObject *lassoRegisterNameIdentifierRequest_wrap(LassoRegisterNameIdentifierRequest *request) { +PyObject *LassoRegisterNameIdentifierRequest_wrap(LassoRegisterNameIdentifierRequest *request) { PyObject *ret; if (request == NULL) { @@ -40,24 +39,9 @@ PyObject *lassoRegisterNameIdentifierRequest_wrap(LassoRegisterNameIdentifierReq return (ret); } -PyObject *register_name_identifier_request_getattr(PyObject *self, PyObject *args) { - PyObject *request_obj; - LassoRegisterNameIdentifierRequest *request; - const char *attr; +/******************************************************************************/ - if (CheckArgs(args, "OS:register_name_identifier_request_get_attr")) { - if (!PyArg_ParseTuple(args, "Os:register_name_identifier_request_get_attr", &request_obj, &attr)) - return NULL; - } - else return NULL; - - request = lassoRegisterNameIdentifierRequest_get(request_obj); - - Py_INCREF(Py_None); - return (Py_None); -} - -PyObject *register_name_identifier_request(PyObject *self, PyObject *args) { +PyObject *register_name_identifier_request_new(PyObject *self, PyObject *args) { const xmlChar *providerID; const xmlChar *idpNameIdentifier; @@ -72,51 +56,44 @@ PyObject *register_name_identifier_request(PyObject *self, PyObject *args) { const xmlChar *oldNameQualifier; const xmlChar *oldFormat; - LassoRegisterNameIdentifierRequest *request; + LassoNode *request; - if(!PyArg_ParseTuple(args, (char *) "ssssssssss:register_name_identifier_request", - &providerID, - &idpNameIdentifier, &idpNameQualifier, &idpFormat, - &spNameIdentifier, &spNameQualifier, &spFormat, - &oldNameIdentifier, &oldNameQualifier, &oldFormat)) - return NULL; - - request = (LassoRegisterNameIdentifierRequest *)lasso_register_name_identifier_request_new(providerID, - idpNameIdentifier, - idpNameQualifier, - idpFormat, - spNameIdentifier, - spNameQualifier, - spFormat, - oldNameIdentifier, - oldNameQualifier, - oldFormat); + if (CheckArgs(args, "SSSSSSSSSS:register_name_identifier_request_new")) { + if(!PyArg_ParseTuple(args, (char *) "ssssssssss:register_name_identifier_request_new", + &providerID, + &idpNameIdentifier, &idpNameQualifier, &idpFormat, + &spNameIdentifier, &spNameQualifier, &spFormat, + &oldNameIdentifier, &oldNameQualifier, &oldFormat)) + return NULL; + } + else return NULL; - return (lassoRegisterNameIdentifierRequest_wrap(request)); + request = lasso_register_name_identifier_request_new(providerID, + idpNameIdentifier, + idpNameQualifier, + idpFormat, + spNameIdentifier, + spNameQualifier, + spFormat, + oldNameIdentifier, + oldNameQualifier, + oldFormat); + + return (LassoRegisterNameIdentifierRequest_wrap(LASSO_REGISTER_NAME_IDENTIFIER_REQUEST(request))); } PyObject *register_name_identifier_request_change_attribute_names_identifiers(PyObject *self, PyObject *args){ - PyObject *request_obj; - - if(!PyArg_ParseTuple(args, (char *) "O:register_name_identifier_request", - &request_obj)) - return NULL; - - lasso_register_name_identifier_change_attribute_names_identifiers(lassoRegisterNameIdentifierRequest_get(request_obj)); - - return (int_wrap(1)); -} - -PyObject *register_name_identifier_request_set_relayState(PyObject *self, PyObject *args){ - PyObject *request_obj; - const xmlChar *relayState; - - if(!PyArg_ParseTuple(args, (char *) "Os:register_name_identifier_request_set_relayState", - &request_obj, &relayState)) - return NULL; + PyObject *request_obj; - lasso_lib_register_name_identifier_request_set_relayState(lassoRegisterNameIdentifierRequest_get(request_obj), - relayState); + if (CheckArgs(args, "O:register_name_identifier_request_change_attribute_names_identifiers")) { + if(!PyArg_ParseTuple(args, (char *) "O:register_name_identifier_request_change_attribute_names_identifiers", + &request_obj)) + return NULL; + } + else return NULL; - return (int_wrap(1)); + lasso_register_name_identifier_change_attribute_names_identifiers(LassoRegisterNameIdentifierRequest_get(request_obj)); + + Py_INCREF(Py_None); + return (Py_None); } diff --git a/python/protocols/py_register_name_identifier_request.h b/python/protocols/py_register_name_identifier_request.h index 0622c581..98d708bb 100644 --- a/python/protocols/py_register_name_identifier_request.h +++ b/python/protocols/py_register_name_identifier_request.h @@ -33,12 +33,10 @@ typedef struct { LassoRegisterNameIdentifierRequest *obj; } LassoRegisterNameIdentifierRequest_object; -#define lassoRegisterNameIdentifierRequest_get(v) (((v) == Py_None) ? NULL : (((LassoRegisterNameIdentifierRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) -PyObject *lassoRegisterNameIdentifierRequest_wrap(LassoRegisterNameIdentifierRequest *request); +#define LassoRegisterNameIdentifierRequest_get(v) (((v) == Py_None) ? NULL : (((LassoRegisterNameIdentifierRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *LassoRegisterNameIdentifierRequest_wrap(LassoRegisterNameIdentifierRequest *request); -PyObject *register_name_identifier_request_getattr(PyObject *self, PyObject *args); -PyObject *register_name_identifier_request(PyObject *self, PyObject *args); +PyObject *register_name_identifier_request_new(PyObject *self, PyObject *args); PyObject *register_name_identifier_request_change_attribute_names_identifiers(PyObject *self, PyObject *args); -PyObject *register_name_identifier_request_set_relayState(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_REGISTER_NAME_IDENTIFIER_REQUEST_H__ */ diff --git a/python/protocols/py_register_name_identifier_response.c b/python/protocols/py_register_name_identifier_response.c index e50e1d06..4f8d50fd 100644 --- a/python/protocols/py_register_name_identifier_response.c +++ b/python/protocols/py_register_name_identifier_response.c @@ -25,12 +25,10 @@ #include "../lassomod.h" -#include "../xml/py_xml.h" #include "py_register_name_identifier_request.h" #include "py_register_name_identifier_response.h" - -PyObject *lassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierResponse *response) { +PyObject *LassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierResponse *response) { PyObject *ret; if (response == NULL) { @@ -42,39 +40,25 @@ PyObject *lassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierRe return (ret); } +/******************************************************************************/ -PyObject *register_name_identifier_response_getattr(PyObject *self, PyObject *args) { - PyObject *response_obj; - LassoRegisterNameIdentifierResponse *response; - const char *attr; +PyObject *register_name_identifier_response_new(PyObject *self, PyObject *args) { + const xmlChar *providerID; + const xmlChar *statusCodeValue; + PyObject *request_obj; + LassoNode *response; - if (CheckArgs(args, "OS:register_name_identifier_response_get_attr")) { - if (!PyArg_ParseTuple(args, "Os:register_name_identifier_response_get_attr", &response_obj, &attr)) + if (CheckArgs(args, "SSO:register_name_identifier_response_new")) { + if(!PyArg_ParseTuple(args, (char *) "ssO:register_name_identifier_response_new", + &providerID, + &statusCodeValue, &request_obj)) return NULL; } else return NULL; - response = lassoRegisterNameIdentifierResponse_get(response_obj); - - Py_INCREF(Py_None); - return (Py_None); -} - -PyObject *register_name_identifier_response(PyObject *self, PyObject *args) { - const xmlChar *providerID; - const xmlChar *statusCodeValue; - PyObject *request_obj; - - LassoRegisterNameIdentifierResponse *response; - - if(!PyArg_ParseTuple(args, (char *) "ssO:register_name_identifier_response", - &providerID, - &statusCodeValue, &request_obj)) - return NULL; - - response = (LassoRegisterNameIdentifierResponse *)lasso_register_name_identifier_response_new(providerID, - statusCodeValue, - lassoRegisterNameIdentifierRequest_get(request_obj)); + response = lasso_register_name_identifier_response_new(providerID, + statusCodeValue, + LassoRegisterNameIdentifierRequest_get(request_obj)); - return (lassoRegisterNameIdentifierResponse_wrap(response)); + return (LassoRegisterNameIdentifierResponse_wrap(LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(response))); } diff --git a/python/protocols/py_register_name_identifier_response.h b/python/protocols/py_register_name_identifier_response.h index fd9cefda..05e137cf 100644 --- a/python/protocols/py_register_name_identifier_response.h +++ b/python/protocols/py_register_name_identifier_response.h @@ -33,10 +33,9 @@ typedef struct { LassoRegisterNameIdentifierResponse *obj; } LassoRegisterNameIdentifierResponse_object; -#define lassoRegisterNameIdentifierResponse_get(v) (((v) == Py_None) ? NULL : (((LassoRegisterNameIdentifierResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) -PyObject *lassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierResponse *response); +#define LassoRegisterNameIdentifierResponse_get(v) (((v) == Py_None) ? NULL : (((LassoRegisterNameIdentifierResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *LassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierResponse *response); -PyObject *register_name_identifier_response_getattr(PyObject *self, PyObject *args); -PyObject *register_name_identifier_response(PyObject *self, PyObject *args); +PyObject *register_name_identifier_response_new(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_REGISTER_NAME_IDENTIFIER_RESPONSE_H__ */ |
