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/protocols | |
| parent | ee6e79e10b4285ac15a18794291eb8079065579a (diff) | |
| download | lasso-43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551.tar.gz lasso-43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551.tar.xz lasso-43c7e91e2576d48b5446aee9ca6a3ff9ed4bd551.zip | |
*** empty log message ***
Diffstat (limited to 'python/protocols')
| -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 |
3 files changed, 18 insertions, 114 deletions
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__ */ |
