diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-09 17:13:24 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-09 17:13:24 +0000 |
| commit | 43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551 (patch) | |
| tree | 57bd344890db180529297ca56753d7c79f44ad67 /python | |
| parent | ee6e79e10b4285ac15a18794291eb8079065579a (diff) | |
| download | lasso-43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551.tar.gz lasso-43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551.tar.xz lasso-43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551.zip | |
*** empty log message ***
Diffstat (limited to 'python')
| -rw-r--r-- | python/environs/py_logout.c | 21 | ||||
| -rw-r--r-- | python/environs/py_logout.h | 7 | ||||
| -rw-r--r-- | python/lassomod.c | 10 | ||||
| -rw-r--r-- | python/protocols/elements/py_authentication_statement.c | 34 | ||||
| -rw-r--r-- | python/protocols/py_authn_response.c | 91 | ||||
| -rw-r--r-- | python/protocols/py_authn_response.h | 7 | ||||
| -rwxr-xr-x | python/setup.py | 1 |
7 files changed, 38 insertions, 133 deletions
diff --git a/python/environs/py_logout.c b/python/environs/py_logout.c index ac565552..0382b1b3 100644 --- a/python/environs/py_logout.c +++ b/python/environs/py_logout.c @@ -95,6 +95,7 @@ PyObject *logout_build_response_msg(PyObject *self, PyObject *args) { PyObject *logout_init_request(PyObject *self, PyObject *args) { PyObject *logout_obj; gchar *remote_providerID; + gint codeError; if (CheckArgs(args, "OS:logout_init_request")) { if(!PyArg_ParseTuple(args, (char *) "Os:logout_init_request", @@ -103,41 +104,43 @@ PyObject *logout_init_request(PyObject *self, PyObject *args) { } else return NULL; - codeError = logout_init_request(LassoLogout_get(logout_obj), remote_providerID); + codeError = lasso_logout_init_request(LassoLogout_get(logout_obj), remote_providerID); return(int_wrap(codeError)); } -PyObject *logout_handle_request(PyObject *self, PyObject *args) { +PyObject *logout_handle_request_msg(PyObject *self, PyObject *args) { PyObject *logout_obj; gchar *request_msg; gint request_method; + gint codeError; - if (CheckArgs(args, "OSI:logout_handle_request")) { - if(!PyArg_ParseTuple(args, (char *) "Osi:logout_handle_request", + if (CheckArgs(args, "OSI:logout_handle_request_msg")) { + if(!PyArg_ParseTuple(args, (char *) "Osi:logout_handle_request_msg", &logout_obj, &request_msg, &request_method)) return NULL; } else return NULL; - codeError = logout_init_request(LassoLogout_get(logout_obj), request_msg, request_method); + codeError = lasso_logout_handle_request_msg(LassoLogout_get(logout_obj), request_msg, request_method); return(int_wrap(codeError)); } -PyObject *logout_handle_response(PyObject *self, PyObject *args) { +PyObject *logout_handle_response_msg(PyObject *self, PyObject *args) { PyObject *logout_obj; gchar *response_msg; gint response_method; + gint codeError; - if (CheckArgs(args, "OSI:logout_handle_response")) { - if(!PyArg_ParseTuple(args, (char *) "Osi:logout_handle_response", + if (CheckArgs(args, "OSI:logout_handle_response_msg")) { + if(!PyArg_ParseTuple(args, (char *) "Osi:logout_handle_response_msg", &logout_obj, &response_msg, &response_method)) return NULL; } else return NULL; - codeError = logout_init_request(LassoLogout_get(logout_obj), response_msg, response_method); + codeError = lasso_logout_handle_response_msg(LassoLogout_get(logout_obj), response_msg, response_method); return(int_wrap(codeError)); } diff --git a/python/environs/py_logout.h b/python/environs/py_logout.h index 9bd8e5b6..20806913 100644 --- a/python/environs/py_logout.h +++ b/python/environs/py_logout.h @@ -28,6 +28,9 @@ #include <lasso/environs/logout.h> +#include "py_server.h" +#include "py_user.h" + typedef struct { PyObject_HEAD LassoLogout *obj; @@ -40,7 +43,7 @@ PyObject *logout_new(PyObject *self, PyObject *args); PyObject *logout_build_request_msg(PyObject *self, PyObject *args); PyObject *logout_build_response_msg(PyObject *self, PyObject *args); PyObject *logout_init_request(PyObject *self, PyObject *args); -PyObject *logout_handle_request(PyObject *self, PyObject *args) -PyObject *logout_handle_response(PyObject *self, PyObject *args); +PyObject *logout_handle_request_msg(PyObject *self, PyObject *args); +PyObject *logout_handle_response_msg(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_LOGOUT_H__ */ diff --git a/python/lassomod.c b/python/lassomod.c index feec7cec..21fa9c9d 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -141,13 +141,7 @@ static PyMethodDef lasso_methods[] = { {"authn_request_get_protocolProfile", authn_request_get_protocolProfile, METH_VARARGS}, /* py_authn_response.h */ - {"authn_response_getattr", authn_response_getattr, METH_VARARGS}, - {"authn_response_new_from_dump", authn_response_new_from_dump, METH_VARARGS}, {"authn_response_new_from_export", authn_response_new_from_export, METH_VARARGS}, - //{"authn_response_new_from_request_query", authn_response_new_from_request_query, METH_VARARGS}, - {"authn_response_must_authenticate", authn_response_must_authenticate, METH_VARARGS}, - {"authn_response_process_authentication_result", authn_response_process_authentication_result, METH_VARARGS}, - {"authn_response_verify_signature", authn_response_verify_signature, METH_VARARGS}, /* py_federation_termination_notification.h */ {"federation_termination_notification_new", federation_termination_notification_new, METH_VARARGS}, @@ -216,8 +210,8 @@ static PyMethodDef lasso_methods[] = { {"logout_build_request_msg", logout_build_request_msg, METH_VARARGS}, {"logout_build_response_msg", logout_build_response_msg, METH_VARARGS}, {"logout_init_request", logout_init_request, METH_VARARGS}, - {"logout_handle_request", logout_handle_request, METH_VARARGS}, - {"logout_handle_response", logout_handle_response, METH_VARARGS}, + {"logout_handle_request_msg", logout_handle_request_msg, METH_VARARGS}, + {"logout_handle_response_msg", logout_handle_response_msg, METH_VARARGS}, /* py_server.h */ {"server_new", server_new, METH_VARARGS}, diff --git a/python/protocols/elements/py_authentication_statement.c b/python/protocols/elements/py_authentication_statement.c index acef02dc..4e7e8946 100644 --- a/python/protocols/elements/py_authentication_statement.c +++ b/python/protocols/elements/py_authentication_statement.c @@ -25,6 +25,7 @@ #include "../../lassomod.h" +#include "../../xml/py_saml_name_identifier.h" #include "py_authentication_statement.h" PyObject *LassoAuthenticationStatement_wrap(LassoAuthenticationStatement *statement) { @@ -42,30 +43,29 @@ PyObject *LassoAuthenticationStatement_wrap(LassoAuthenticationStatement *statem /******************************************************************************/ PyObject *authentication_statement_new(PyObject *self, PyObject *args) { + PyObject *identifier_obj, *idp_identifier_obj; const xmlChar *authenticationMethod; const xmlChar *reauthenticateOnOrAfter; - xmlChar *nameIdentifier; - const xmlChar *nameQualifier; - const xmlChar *format; - xmlChar *idp_nameIdentifier; - const xmlChar *idp_nameQualifier; - const xmlChar *idp_format; + LassoSamlNameIdentifier *identifier=NULL, *idp_identifier; LassoNode *statement; - if(!PyArg_ParseTuple(args, (char *) "ssssssss:authentication_statement_new", - &authenticationMethod, &reauthenticateOnOrAfter, - &nameIdentifier, &nameQualifier, &format, - &idp_nameIdentifier, &idp_nameQualifier, &idp_format)) - return NULL; + if (CheckArgs(args, "SSoO:authentication_statement_new")) { + if(!PyArg_ParseTuple(args, (char *) "ssOO:authentication_statement_new", + &authenticationMethod, &reauthenticateOnOrAfter, + &identifier_obj, &idp_identifier_obj)) + return NULL; + } + else return NULL; + + if (identifier_obj != Py_None) { + identifier = LassoSamlNameIdentifier_get(identifier_obj); + } + idp_identifier = LassoSamlNameIdentifier_get(idp_identifier_obj); statement = lasso_authentication_statement_new(authenticationMethod, reauthenticateOnOrAfter, - nameIdentifier, - nameQualifier, - format, - idp_nameIdentifier, - idp_nameQualifier, - idp_format); + identifier, + idp_identifier); return (LassoAuthenticationStatement_wrap(LASSO_AUTHENTICATION_STATEMENT(statement))); } diff --git a/python/protocols/py_authn_response.c b/python/protocols/py_authn_response.c index 77471893..52315ae3 100644 --- a/python/protocols/py_authn_response.c +++ b/python/protocols/py_authn_response.c @@ -27,7 +27,6 @@ #include "../xml/py_xml.h" #include "py_authn_response.h" -#include "py_authn_request.h" /******************************************************************************/ /* LassoAuthnResponse */ @@ -47,28 +46,12 @@ PyObject *LassoAuthnResponse_wrap(LassoAuthnResponse *response) { /******************************************************************************/ -PyObject *authn_response_new_from_dump(PyObject *self, PyObject *args) { - xmlChar *buffer; - LassoNode *response; - - if (CheckArgs(args, "S:authn_response_new_from_dump")) { - if(!PyArg_ParseTuple(args, (char *) "s:authn_response_new_from_dump", - &buffer)) - return NULL; - } - else return NULL; - - response = lasso_authn_response_new_from_dump(buffer); - - return (LassoAuthnResponse_wrap(LASSO_AUTHN_RESPONSE(response))); -} - PyObject *authn_response_new_from_export(PyObject *self, PyObject *args) { xmlChar *buffer; gint type; LassoNode *response; - if (CheckArgs(args, "Si:authn_response_new_from_export")) { + if (CheckArgs(args, "SI:authn_response_new_from_export")) { if(!PyArg_ParseTuple(args, (char *) "si:authn_response_new_from_export", &buffer, &type)) return NULL; @@ -79,75 +62,3 @@ PyObject *authn_response_new_from_export(PyObject *self, PyObject *args) { return (LassoAuthnResponse_wrap(LASSO_AUTHN_RESPONSE(response))); } - -PyObject *authn_response_new_from_request_query(PyObject *self, PyObject *args) { - xmlChar *query = NULL; - const xmlChar *providerID = NULL; - LassoNode *response; - - if (CheckArgs(args, "ss:authn_response_new_from_request_query")) { - if(!PyArg_ParseTuple(args, (char *) "zz:authn_response_new_from_request_query", - &query, &providerID)) - return NULL; - } - else return NULL; - - response = lasso_authn_response_new_from_request_query(query, providerID); - - return (LassoAuthnResponse_wrap(LASSO_AUTHN_RESPONSE(response))); -} - -PyObject *authn_response_must_authenticate(PyObject *self, PyObject *args) { - PyObject *response_obj; - gboolean is_authenticated; - gboolean ret; - - if (CheckArgs(args, "OI:authn_response_must_authenticate")) { - if(!PyArg_ParseTuple(args, (char *) "Oi:authn_response_must_authenticate", - &response_obj, &is_authenticated)) - return NULL; - } - else return NULL; - - ret = lasso_authn_response_must_authenticate(LassoAuthnResponse_get(response_obj), - is_authenticated); - - return (int_wrap(ret)); -} - -PyObject *authn_response_process_authentication_result(PyObject *self, PyObject *args) { - PyObject *response_obj; - gboolean authentication_result; - - if (CheckArgs(args, "OI:authn_response_process_authentication_result")) { - if(!PyArg_ParseTuple(args, (char *) "Oi:authn_response_process_authentication_result", - &response_obj, &authentication_result)) - return NULL; - } - else return NULL; - - lasso_authn_response_process_authentication_result(LassoAuthnResponse_get(response_obj), - authentication_result); - - Py_INCREF(Py_None); - return (Py_None); -} - -PyObject *authn_response_verify_signature(PyObject *self, PyObject *args) { - PyObject *response_obj; - xmlChar *public_key_file; - xmlChar *private_key_file; - gboolean ret; - - if (CheckArgs(args, "OSS:authn_response_verify_signature")) { - if(!PyArg_ParseTuple(args, (char *) "Oss:authn_response_verify_signature", - &response_obj, &public_key_file, &private_key_file)) - return NULL; - } - else return NULL; - - ret = lasso_authn_response_verify_signature(LassoAuthnResponse_get(response_obj), - public_key_file, private_key_file); - - return (int_wrap(ret)); -} diff --git a/python/protocols/py_authn_response.h b/python/protocols/py_authn_response.h index f11a9638..be21a522 100644 --- a/python/protocols/py_authn_response.h +++ b/python/protocols/py_authn_response.h @@ -27,7 +27,6 @@ #define __PYLASSO_PY_AUTHN_RESPONSE_H__ #include <lasso/protocols/authn_response.h> -#include "elements/py_assertion.h" typedef struct { PyObject_HEAD @@ -37,12 +36,6 @@ typedef struct { #define LassoAuthnResponse_get(v) (((v) == Py_None) ? NULL : (((LassoAuthnResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) PyObject *LassoAuthnResponse_wrap(LassoAuthnResponse *response); -PyObject *authn_response_getattr(PyObject *self, PyObject *args); -PyObject *authn_response_new_from_dump(PyObject *self, PyObject *args); PyObject *authn_response_new_from_export(PyObject *self, PyObject *args); -//PyObject *authn_response_new_from_request_query(PyObject *self, PyObject *args); -PyObject *authn_response_must_authenticate(PyObject *self, PyObject *args); -PyObject *authn_response_process_authentication_result(PyObject *self, PyObject *args); -PyObject *authn_response_verify_signature(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_AUTHN_RESPONSE_H__ */ diff --git a/python/setup.py b/python/setup.py index a1965bc6..ba1cf784 100755 --- a/python/setup.py +++ b/python/setup.py @@ -217,6 +217,7 @@ em = Extension("lassomod", "protocols/elements/py_assertion.c", "protocols/elements/py_authentication_statement.c", "environs/py_login.c", + "environs/py_logout.c", "environs/py_server.c", "environs/py_user.c", "lassomod.c", |
