summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-05-11 16:47:33 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-05-11 16:47:33 +0000
commit2e5edf85b8c23ef73069dbd37e453c7e2d30545a (patch)
tree9f7e71980db2fab4900f5e885c8b75fc831535e5
parent6d63bd7cfe78477e39d9557e070f589cb4f3052e (diff)
downloadlasso-2e5edf85b8c23ef73069dbd37e453c7e2d30545a.tar.gz
lasso-2e5edf85b8c23ef73069dbd37e453c7e2d30545a.tar.xz
lasso-2e5edf85b8c23ef73069dbd37e453c7e2d30545a.zip
name identifer mapping c and python binding updates
-rw-r--r--lasso/Attic/protocols/name_identifier_mapping_request.c75
-rw-r--r--lasso/Attic/protocols/name_identifier_mapping_request.h6
-rw-r--r--lasso/Attic/protocols/name_identifier_mapping_response.c114
-rw-r--r--lasso/Attic/protocols/name_identifier_mapping_response.h19
-rw-r--r--python/lasso.py90
-rw-r--r--python/lassomod.c14
-rw-r--r--python/protocols/py_name_identifier_mapping_request.c34
-rw-r--r--python/protocols/py_name_identifier_mapping_request.h2
-rw-r--r--python/protocols/py_name_identifier_mapping_response.c95
-rw-r--r--python/protocols/py_name_identifier_mapping_response.h6
-rwxr-xr-xpython/setup.py9
11 files changed, 414 insertions, 50 deletions
diff --git a/lasso/Attic/protocols/name_identifier_mapping_request.c b/lasso/Attic/protocols/name_identifier_mapping_request.c
index a3d201ff..3e233767 100644
--- a/lasso/Attic/protocols/name_identifier_mapping_request.c
+++ b/lasso/Attic/protocols/name_identifier_mapping_request.c
@@ -110,3 +110,78 @@ lasso_name_identifier_mapping_request_new(const xmlChar *providerID,
return (request);
}
+
+LassoNode *
+lasso_name_identifier_mapping_request_new_from_query(const xmlChar *query)
+{
+ LassoNode *request, *identifier;
+ xmlChar *str;
+ GData *gd;
+
+ request = LASSO_NODE(g_object_new(LASSO_TYPE_NAME_IDENTIFIER_MAPPING_REQUEST, NULL));
+
+ gd = lasso_query_to_dict(query);
+
+ /* RequestID */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "RequestID"), 0);
+ lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request), str);
+
+
+ /* MajorVersion */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "MajorVersion"), 0);
+ lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), str);
+
+ /* MinorVersion */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "MinorVersion"), 0);
+ lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), str);
+
+ /* IssueInstant */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "IssueInstance"), 0);
+ lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request), str);
+
+ /* ProviderID */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "ProviderID"), 0);
+ lasso_lib_name_identifier_mapping_request_set_providerID(LASSO_LIB_NAME_IDENTIFIER_MAPPING_REQUEST(request), str);
+
+ /* NameIdentifier */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "NameIdentifier"), 0);
+ identifier = lasso_saml_name_identifier_new(str);
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "NameQualifier"), 0);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(identifier), str);
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "Format"), 0);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(identifier), str);
+
+ lasso_lib_name_identifier_mapping_request_set_nameIdentifier(LASSO_LIB_NAME_IDENTIFIER_MAPPING_REQUEST(request), identifier);
+
+ /* consent */
+ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "consent"), 0);
+ if (str != NULL)
+ lasso_lib_name_identifier_mapping_request_set_consent(LASSO_LIB_NAME_IDENTIFIER_MAPPING_REQUEST(request), str);
+
+ g_datalist_clear(&gd);
+
+ return(request);
+}
+
+LassoNode *
+lasso_name_identifier_mapping_request_new_from_soap(const xmlChar *buffer)
+{
+ LassoNode *request;
+ LassoNode *envelope, *lassoNode_request;
+ xmlNodePtr xmlNode_request;
+ LassoNodeClass *class;
+
+ request = LASSO_NODE(g_object_new(LASSO_TYPE_NAME_IDENTIFIER_MAPPING_REQUEST, NULL));
+
+ envelope = lasso_node_new_from_dump(buffer);
+ lassoNode_request = lasso_node_get_child(envelope, "NameIdentifierMappingRequest");
+
+ class = LASSO_NODE_GET_CLASS(lassoNode_request);
+ xmlNode_request = xmlCopyNode(class->get_xmlNode(LASSO_NODE(lassoNode_request)), 1);
+
+ class = LASSO_NODE_GET_CLASS(request);
+ class->set_xmlNode(LASSO_NODE(request), xmlNode_request);
+ g_object_unref(envelope);
+
+ return(request);
+}
diff --git a/lasso/Attic/protocols/name_identifier_mapping_request.h b/lasso/Attic/protocols/name_identifier_mapping_request.h
index 67cfcbb7..c5fb5b99 100644
--- a/lasso/Attic/protocols/name_identifier_mapping_request.h
+++ b/lasso/Attic/protocols/name_identifier_mapping_request.h
@@ -53,11 +53,15 @@ struct _LassoNameIdentifierMappingRequestClass {
};
LASSO_EXPORT GType lasso_name_identifier_mapping_request_get_type (void);
-LASSO_EXPORT LassoNode* lasso_name_identifier_mapping_request_new (const xmlChar *providerID,
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_request_new (const xmlChar *providerID,
const xmlChar *nameIdentifier,
const xmlChar *nameQualifier,
const xmlChar *format);
+
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_request_new_from_query (const xmlChar *query);
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_request_new_from_soap (const xmlChar *buffer);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/lasso/Attic/protocols/name_identifier_mapping_response.c b/lasso/Attic/protocols/name_identifier_mapping_response.c
index 62989b3a..ee366e32 100644
--- a/lasso/Attic/protocols/name_identifier_mapping_response.c
+++ b/lasso/Attic/protocols/name_identifier_mapping_response.c
@@ -115,3 +115,117 @@ lasso_name_identifier_mapping_response_new(const xmlChar *providerID,
return (response);
}
+
+LassoNode *
+lasso_name_identifier_mapping_response_new_from_dump(const xmlChar *buffer)
+{
+ LassoNode *response;
+
+ response = LASSO_NODE(g_object_new(LASSO_TYPE_NAME_IDENTIFIER_MAPPING_RESPONSE, NULL));
+ lasso_node_load_from_buffer(response, buffer);
+
+ return (response);
+}
+
+// build a NameIdentifierMappingResponse from a query form NameIdentifierMappingResponse
+LassoNode *
+lasso_name_identifier_mapping_response_new_from_query(const xmlChar *query)
+{
+ LassoNode *response;
+ xmlChar *relayState, *consent;
+ GData *gd;
+
+ response = LASSO_NODE(g_object_new(LASSO_TYPE_NAME_IDENTIFIER_MAPPING_RESPONSE, NULL));
+
+ gd = lasso_query_to_dict(query);
+
+ /* ResponseID */
+ lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "ResponseID"), 0));
+
+ /* MajorVersion */
+ lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "MajorVersion"), 0));
+
+ /* MinorVersion */
+ lasso_samlp_response_abstract_set_minorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "MinorVersion"), 0));
+
+ /* IssueInstant */
+ lasso_samlp_response_abstract_set_issueInstance(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "IssueInstance"), 0));
+
+ /* InResponseTo */
+ lasso_samlp_response_abstract_set_inResponseTo(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "InResponseTo"), 0));
+
+ /* Recipient */
+ lasso_samlp_response_abstract_set_recipient(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "Recipient"), 0));
+
+ /* ProviderID */
+ lasso_lib_name_identifier_mapping_response_set_providerID(LASSO_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE(response),
+ lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "ProviderID"), 0));
+
+
+ g_datalist_clear(&gd);
+
+ return(response);
+}
+
+// build a NameIdentifierMappingRespose from a soap form NameIdentifierMappingRequest
+LassoNode *
+lasso_name_identifier_mapping_response_new_from_request_soap(const xmlChar *buffer,
+ const xmlChar *providerID,
+ const xmlChar *statusCodeValue)
+{
+ LassoNode *request, *response;
+
+ request = lasso_name_identifier_mapping_request_new_from_soap(buffer);
+
+ response = lasso_name_identifier_mapping_response_new(providerID,
+ statusCodeValue,
+ request);
+
+ return(response);
+}
+
+LassoNode *
+lasso_name_identifier_mapping_response_new_from_soap(const xmlChar *buffer)
+{
+ LassoNode *response;
+ LassoNode *envelope, *lassoNode_response;
+ xmlNodePtr xmlNode_response;
+ LassoNodeClass *class;
+
+ response = LASSO_NODE(g_object_new(LASSO_TYPE_NAME_IDENTIFIER_MAPPING_RESPONSE, NULL));
+
+ envelope = lasso_node_new_from_dump(buffer);
+ lassoNode_response = lasso_node_get_child(envelope, "NameIdentifierMappingResponse");
+
+ class = LASSO_NODE_GET_CLASS(lassoNode_response);
+ xmlNode_response = xmlCopyNode(class->get_xmlNode(LASSO_NODE(lassoNode_response)), 1);
+
+ class = LASSO_NODE_GET_CLASS(response);
+ class->set_xmlNode(LASSO_NODE(response), xmlNode_response);
+ g_object_unref(envelope);
+
+ return(response);
+}
+
+// build a NameIdentifierMappingResponse from a query form NameIdentifierMappingRequest
+LassoNode *
+lasso_name_identifier_mapping_response_new_from_request_query(const xmlChar *query,
+ const xmlChar *providerID,
+ const xmlChar *statusCodeValue)
+{
+ LassoNode *request, *response;
+
+ request = lasso_name_identifier_mapping_request_new_from_query(query);
+
+ response = lasso_name_identifier_mapping_response_new(providerID,
+ statusCodeValue,
+ request);
+
+ return(response);
+}
diff --git a/lasso/Attic/protocols/name_identifier_mapping_response.h b/lasso/Attic/protocols/name_identifier_mapping_response.h
index f2e18dc2..7b3334c5 100644
--- a/lasso/Attic/protocols/name_identifier_mapping_response.h
+++ b/lasso/Attic/protocols/name_identifier_mapping_response.h
@@ -52,10 +52,21 @@ struct _LassoNameIdentifierMappingResponseClass {
LassoLibNameIdentifierMappingResponseClass parent;
};
-LASSO_EXPORT GType lasso_name_identifier_mapping_response_get_type (void);
-LASSO_EXPORT LassoNode* lasso_name_identifier_mapping_response_new (const xmlChar *providerID,
- const xmlChar *statusCodeValue,
- LassoNode *request);
+LASSO_EXPORT GType lasso_name_identifier_mapping_response_get_type (void);
+LASSO_EXPORT LassoNode* lasso_name_identifier_mapping_response_new (const xmlChar *providerID,
+ const xmlChar *statusCodeValue,
+ LassoNode *request);
+
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_response_new_from_dump (const xmlChar *buffer);
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_response_new_from_query (const xmlChar *query);
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_response_new_from_request_soap (const xmlChar *buffer,
+ const xmlChar *providerID,
+ const xmlChar *statusCodeValue);
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_response_new_from_soap (const xmlChar *buffer);
+LASSO_EXPORT LassoNode *lasso_name_identifier_mapping_response_new_from_request_query (const xmlChar *query,
+ const xmlChar *providerID,
+ const xmlChar *statusCodeValue);
+
#ifdef __cplusplus
}
diff --git a/python/lasso.py b/python/lasso.py
index e89463b0..3bcfa3f4 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -226,6 +226,18 @@ class LibNameIdentifierMappingRequest(Node):
def set_consent(self, consent):
lassomod.lib_name_identifier_mapping_request_set_consent(self, consent)
+class LibNameIdentifierMappingResponse(Node):
+ def __init__(self, _obj = None):
+ """
+ """
+ if _obj != None:
+ self._o = _obj
+ return
+ _obj = lassomod.lib_name_identifier_mapping_response_new()
+ if _obj is None:
+ raise Error('lasso_lib_name_identifier_mapping_response_new() failed')
+ Node.__init__(self, _obj=_obj)
+
class SamlNameIdentifier(Node):
def __init__(self, _obj=None):
@@ -346,10 +358,10 @@ class FederationTerminationNotification(LibFederationTerminationNotification):
new_from_query = classmethod(new_from_query)
class LogoutRequest(LibLogoutRequest):
- def __init__(self, obj):
+ def __init__(self, _obj):
"""
"""
- self._o = obj
+ self._o = _obj
LibLogoutRequest.__init__(self, _obj = self._o)
def new(cls, providerID, nameIdentifier, nameQualifier, format):
@@ -369,10 +381,10 @@ class LogoutRequest(LibLogoutRequest):
class LogoutResponse(LibLogoutResponse):
- def __init__(self, obj):
+ def __init__(self, _obj):
"""
"""
- self._o = obj
+ self._o = _obj
LibLogoutResponse.__init__(self, _obj = self._o)
def new_from_request_soap(cls, envelope, providerID, status_code_value):
@@ -402,35 +414,59 @@ class LogoutResponse(LibLogoutResponse):
class NameIdentifierMappingRequest(LibNameIdentifierMappingRequest):
- def __init__(self, providerID, nameIdentifier, nameQualifier, format,
- _obj=None):
+ def __init__(self, _obj):
"""
"""
- if _obj != None:
- self._o = _obj
- return
- _obj = lassomod.name_identifier_mapping_request_new(providerID,
- nameIdentifier,
- nameQualifier,
- format)
- if _obj is None:
- raise Error('lasso_name_identifier_mapping_request_new() failed')
- LibNameIdentifierMappingRequest.__init__(self, _obj=_obj)
+ self._o = _obj
+ LibNameIdentifierMappingRequest.__init__(self, _obj = self._o)
+ def new(cls, providerID, nameIdentifier, nameQualifier, format):
+ obj = lassomod.name_identifier_mapping_request_new(providerID, nameIdentifier, nameQualifier, format)
+ return NameIdentifierMappingRequest(obj)
+ new = classmethod(new)
-class NameIdentifierMappingResponse(Node):
- def __init__(self, providerID, statusCodeValue, request, _obj=None):
+ def new_from_soap(cls, envelope):
+ obj = lassomod.name_identifier_mapping_request_new_from_soap(envelope)
+ return NameIdentifierMappingRequest(obj)
+ new_from_soap = classmethod(new_from_soap)
+
+ def new_from_query(cls, query):
+ obj = lassomod.name_identifier_mapping_request_new_from_query(query)
+ return NameIdentifierMappingRequest(obj)
+ new_from_query = classmethod(new_from_query)
+
+
+class NameIdentifierMappingResponse(LibNameIdentifierMappingResponse):
+ def __init__(self, _obj):
"""
"""
- if _obj != None:
- self._o = _obj
- return
- _obj = lassomod.name_identifier_mapping_response_new(providerID,
- statusCodeValue,
- request)
- if _obj is None:
- raise Error('lasso_name_identifier_mapping_response_new() failed')
- Node.__init__(self, _obj=_obj)
+ self._o = _obj
+ LibNameIdentifierMappingResponse.__init__(self, _obj = self._o)
+
+ def new_from_request_soap(cls, envelope, providerID, status_code_value):
+ obj = lassomod.name_identifier_mapping_response_new_from_request_soap(envelope, providerID, status_code_value)
+ return NameIdentifierMappingResponse(obj)
+ new_from_request_soap = classmethod(new_from_request_soap)
+
+ def new_from_soap(cls, envelope):
+ obj = lassomod.name_identifier_mapping_response_new_from_soap(envelope)
+ return NameIdentifierMappingResponse(obj)
+ new_from_soap = classmethod(new_from_soap)
+
+ def new_from_dump(cls, dump):
+ obj = lassomod.name_identifier_mapping_response_new_from_dump(dump)
+ return NameIdentifierMappingResponse(obj)
+ new_from_dump = classmethod(new_from_dump)
+
+ def new_from_request_query(cls, query, providerID, status_code_value):
+ obj = lassomod.name_identifier_mapping_response_new_from_request_query(query, providerID, status_code_value)
+ return NameIdentifierMappingResponse(obj);
+ new_from_request_query = classmethod(new_from_request_query)
+
+ def new_from_query(cls, query):
+ obj = lassomod.name_identifier_mapping_response_new_from_query(query)
+ return NameIdentifierMappingResponse(obj);
+ new_from_query = classmethod(new_from_query)
class RegisterNameIdentifierRequest(Node):
diff --git a/python/lassomod.c b/python/lassomod.c
index 30e048ca..fa9fae8e 100644
--- a/python/lassomod.c
+++ b/python/lassomod.c
@@ -33,6 +33,7 @@
#include "xml/py_lib_logout_request.h"
#include "xml/py_lib_logout_response.h"
#include "xml/py_lib_name_identifier_mapping_request.h"
+#include "xml/py_lib_name_identifier_mapping_response.h"
#include "xml/py_lib_register_name_identifier_request.h"
#include "xml/py_saml_assertion.h"
#include "xml/py_saml_authentication_statement.h"
@@ -100,6 +101,9 @@ static PyMethodDef lasso_methods[] = {
{"lib_name_identifier_mapping_request_new", lib_name_identifier_mapping_request_new, METH_VARARGS},
{"lib_name_identifier_mapping_request_set_consent", lib_name_identifier_mapping_request_set_consent, METH_VARARGS},
+ /* py_lib_name_identifier_mapping_response.h */
+ {"lib_name_identifier_mapping_response_new", lib_name_identifier_mapping_response_new, METH_VARARGS},
+
/* py_lib_register_name_identifier_request.h */
{"lib_register_name_identifier_request_new", lib_register_name_identifier_request_new, METH_VARARGS},
{"lib_register_name_identifier_request_set_relayState", lib_register_name_identifier_request_set_relayState, METH_VARARGS},
@@ -150,10 +154,16 @@ static PyMethodDef lasso_methods[] = {
{"logout_response_new_from_query", logout_response_new_from_query, METH_VARARGS},
/* py_name_identifier_mapping_request.h */
- {"name_identifier_mapping_request_new", name_identifier_mapping_request_new, METH_VARARGS},
+ {"name_identifier_mapping_request_new", name_identifier_mapping_request_new, METH_VARARGS},
+ {"name_identifier_mapping_request_new_from_soap", name_identifier_mapping_request_new_from_soap, METH_VARARGS},
+ {"name_identifier_mapping_request_new_from_query", name_identifier_mapping_request_new_from_query, METH_VARARGS},
/* py_name_identifier_mapping_response.h */
- {"name_identifier_mapping_response_new", name_identifier_mapping_response_new, METH_VARARGS},
+ {"name_identifier_mapping_response_new_from_request_soap", name_identifier_mapping_response_new_from_request_soap, METH_VARARGS},
+ {"name_identifier_mapping_response_new_from_soap", name_identifier_mapping_response_new_from_soap, METH_VARARGS},
+ {"name_identifier_mapping_response_new_from_dump", name_identifier_mapping_response_new_from_dump, METH_VARARGS},
+ {"name_identifier_mapping_response_new_from_request_query", name_identifier_mapping_response_new_from_request_query, METH_VARARGS},
+ {"name_identifier_mapping_response_new_from_query", name_identifier_mapping_response_new_from_query, METH_VARARGS},
/* py_register_name_identifier_request.h */
{"register_name_identifier_request_new", register_name_identifier_request_new, METH_VARARGS},
diff --git a/python/protocols/py_name_identifier_mapping_request.c b/python/protocols/py_name_identifier_mapping_request.c
index 1d287fc8..975ac9b8 100644
--- a/python/protocols/py_name_identifier_mapping_request.c
+++ b/python/protocols/py_name_identifier_mapping_request.c
@@ -62,3 +62,37 @@ PyObject *name_identifier_mapping_request_new(PyObject *self, PyObject *args) {
return (LassoNameIdentifierMappingRequest_wrap(LASSO_NAME_IDENTIFIER_MAPPING_REQUEST(request)));
}
+
+PyObject *name_identifier_mapping_request_new_from_soap(PyObject *self, PyObject *args) {
+ const xmlChar *soap_buffer;
+
+ LassoNode *request;
+
+ if (CheckArgs(args, "S:name_identifier_mapping_request_new_from_soap")) {
+ if(!PyArg_ParseTuple(args, (char *) "s:name_identifier_mapping_request_new_from_soap",
+ &soap_buffer))
+ return NULL;
+ }
+ else return NULL;
+
+ request = lasso_name_identifier_mapping_request_new_from_soap(soap_buffer);
+
+ return (LassoNameIdentifierMappingRequest_wrap(LASSO_NAME_IDENTIFIER_MAPPING_REQUEST(request)));
+}
+
+PyObject *name_identifier_mapping_request_new_from_query(PyObject *self, PyObject *args) {
+ const xmlChar *query;
+
+ LassoNode *request;
+
+ if (CheckArgs(args, "S:name_identifier_mapping_request_new_from_query")) {
+ if(!PyArg_ParseTuple(args, (char *) "s:name_identifier_mapping_request_new_from_query",
+ &query))
+ return NULL;
+ }
+ else return NULL;
+
+ request = lasso_name_identifier_mapping_request_new_from_query(query);
+
+ 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 f9e17f39..647e6e80 100644
--- a/python/protocols/py_name_identifier_mapping_request.h
+++ b/python/protocols/py_name_identifier_mapping_request.h
@@ -37,5 +37,7 @@ typedef struct {
PyObject *LassoNameIdentifierMappingRequest_wrap(LassoNameIdentifierMappingRequest *request);
PyObject *name_identifier_mapping_request_new(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_request_new_from_soap(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_request_new_from_query(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 6cd90c57..39d8798c 100644
--- a/python/protocols/py_name_identifier_mapping_response.c
+++ b/python/protocols/py_name_identifier_mapping_response.c
@@ -42,24 +42,97 @@ PyObject *LassoNameIdentifierMappingResponse_wrap(LassoNameIdentifierMappingResp
/******************************************************************************/
-PyObject *name_identifier_mapping_response_new(PyObject *self, PyObject *args) {
- const xmlChar *providerID;
- const xmlChar *statusCodeValue;
- PyObject *request_obj;
+PyObject *name_identifier_mapping_response_new_from_request_soap(PyObject *self, PyObject *args) {
+ const xmlChar *request_soap_dump;
+ const xmlChar *providerID;
+ const xmlChar *status_code_value;
- LassoNode *response;
+ LassoNode *response = NULL;
- if (CheckArgs(args, "SSO:name_identifier_mapping_response_new")) {
- if(!PyArg_ParseTuple(args, (char *) "ssO:name_identifier_mapping_response_new",
+ if (CheckArgs(args, "SSS:name_identifier_mapping_response_new_from_request_soap")) {
+ if(!PyArg_ParseTuple(args, (char *) "sss:name_identifier_mapping_response_new_from_request_soap",
+ &request_soap_dump,
&providerID,
- &statusCodeValue, &request_obj))
+ &status_code_value))
return NULL;
}
else return NULL;
- response = lasso_name_identifier_mapping_response_new(providerID,
- statusCodeValue,
- LassoNameIdentifierMappingRequest_get(request_obj));
+ response = lasso_name_identifier_mapping_response_new_from_request_soap(request_soap_dump,
+ providerID,
+ status_code_value);
+
+ return (LassoNameIdentifierMappingResponse_wrap(LASSO_NAME_IDENTIFIER_MAPPING_RESPONSE(response)));
+}
+
+PyObject *name_identifier_mapping_response_new_from_soap(PyObject *self, PyObject *args) {
+ const xmlChar *response_soap_dump;
+
+ LassoNode *response = NULL;
+
+ if (CheckArgs(args, "S:name_identifier_mapping_response_new_from_soap")) {
+ if(!PyArg_ParseTuple(args, (char *) "s:name_identifier_mapping_response_new_from_soap",
+ &response_soap_dump))
+ return NULL;
+ }
+ else return NULL;
+
+ response = lasso_name_identifier_mapping_response_new_from_soap(response_soap_dump);
+
+ return (LassoNameIdentifierMappingResponse_wrap(LASSO_NAME_IDENTIFIER_MAPPING_RESPONSE(response)));
+}
+
+PyObject *name_identifier_mapping_response_new_from_dump(PyObject *self, PyObject *args) {
+ const xmlChar *dump;
+
+ LassoNode *response = NULL;
+
+ if (CheckArgs(args, "S:name_identifier_mapping_response_new_from_dump")) {
+ if(!PyArg_ParseTuple(args, (char *) "s:name_identifier_mapping_response_new_from_dump",
+ &dump))
+ return NULL;
+ }
+ else return NULL;
+
+ response = lasso_name_identifier_mapping_response_new_from_soap(dump);
+
+ return (LassoNameIdentifierMappingResponse_wrap(LASSO_NAME_IDENTIFIER_MAPPING_RESPONSE(response)));
+}
+
+PyObject *name_identifier_mapping_response_new_from_request_query(PyObject *self, PyObject *args) {
+ const xmlChar *query;
+ const xmlChar *providerID;
+ const xmlChar *status_code_value;
+
+ LassoNode *response = NULL;
+
+ if (CheckArgs(args, "SSS:name_identifier_mapping_response_new_from_request_query")) {
+ if(!PyArg_ParseTuple(args, (char *) "sss:name_identifier_mapping_response_new_from_request_query",
+ &query,
+ &providerID,
+ &status_code_value))
+ return NULL;
+ }
+ else return NULL;
+
+ response = lasso_name_identifier_mapping_response_new_from_request_query(query, providerID, status_code_value);
+
+ return (LassoNameIdentifierMappingResponse_wrap(LASSO_NAME_IDENTIFIER_MAPPING_RESPONSE(response)));
+}
+
+PyObject *name_identifier_mapping_response_new_from_query(PyObject *self, PyObject *args) {
+ const xmlChar *query;
+
+ LassoNode *response = NULL;
+
+ if (CheckArgs(args, "S:name_identifier_mapping_response_new_from_query")) {
+ if(!PyArg_ParseTuple(args, (char *) "s:name_identifier_mapping_response_new_from_query",
+ &query))
+ return NULL;
+ }
+ else return NULL;
+
+ response = lasso_name_identifier_mapping_response_new_from_query(query);
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 50ac6a42..f2fc0ef1 100644
--- a/python/protocols/py_name_identifier_mapping_response.h
+++ b/python/protocols/py_name_identifier_mapping_response.h
@@ -35,6 +35,10 @@ typedef struct {
#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_new(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_response_new_from_request_soap(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_response_new_from_soap(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_response_new_from_dump(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_response_new_from_request_query(PyObject *self, PyObject *args);
+PyObject *name_identifier_mapping_response_new_from_query(PyObject *self, PyObject *args);
#endif /* __PYLASSO_PY_NAME_IDENTIFIER_MAPPING_RESPONSE_H__ */
diff --git a/python/setup.py b/python/setup.py
index 49aadb6e..bd57b91a 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -180,10 +180,10 @@ extract_cflags(xmlsec1_cflags)
extract_libs(xmlsec1_libs)
# FIXME : cflags & libs for lasso
-include_dirs.append('..')
-library_dirs.append('../lasso/.libs')
-#include_dirs.append('/usr/local/include')
-#library_dirs.append('/usr/local/lib')
+#include_dirs.append('..')
+#library_dirs.append('../lasso/.libs')
+include_dirs.append('/usr/local/include')
+library_dirs.append('/usr/local/lib')
libraries.append('lasso')
em = Extension("lassomod",
@@ -195,6 +195,7 @@ em = Extension("lassomod",
"xml/py_lib_logout_request.c",
"xml/py_lib_logout_response.c",
"xml/py_lib_name_identifier_mapping_request.c",
+ "xml/py_lib_name_identifier_mapping_response.c",
"xml/py_lib_register_name_identifier_request.c",
"xml/py_saml_assertion.c",
"xml/py_saml_authentication_statement.c",