Update
This commit is contained in:
parent
04c32c9de2
commit
407ce45c3b
|
@ -8,12 +8,12 @@ INCLUDES = \
|
|||
$(NULL)
|
||||
|
||||
|
||||
ENVSOURCES = py_federation_termination.c py_lecp.c py_login.c py_logout.c py_profile_context.c py_register_name_identifier.c py_server.c py_identity.c
|
||||
ENVSOURCES = py_federation_termination.c py_lecp.c py_login.c py_logout.c py_profile.c py_register_name_identifier.c py_server.c py_session.c py_identity.c
|
||||
|
||||
if WITH_PYTHON
|
||||
noinst_LIBRARIES = libenvirons.a
|
||||
libenvirons_a_SOURCES = $(ENVSOURCES)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = $(ENVSOURCES) py_federation_termination.h py_lecp.h py_login.h py_logout.h py_profile_context.h py_register_name_identifier.h py_server.h py_identity.h
|
||||
EXTRA_DIST = $(ENVSOURCES) py_federation_termination.h py_lecp.h py_login.h py_logout.h py_profile.h py_register_name_identifier.h py_server.h py_session.h py_identity.h
|
||||
|
||||
|
|
|
@ -62,42 +62,6 @@ PyObject *identity_new_from_dump(PyObject *self, PyObject *args) {
|
|||
return (LassoIdentity_wrap(identity));
|
||||
}
|
||||
|
||||
PyObject *identity_add_assertion(PyObject *self, PyObject *args){
|
||||
PyObject *identity_obj, *assertion_obj;
|
||||
gchar *remote_providerID;
|
||||
|
||||
if (CheckArgs(args, "OSO:identity_add_assertion")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "OsO:identity_add_assertion", &identity_obj,
|
||||
&remote_providerID, &assertion_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
lasso_identity_add_assertion(LassoIdentity_get(identity_obj), remote_providerID,
|
||||
LASSO_NODE(LassoAssertion_get(assertion_obj)));
|
||||
/* lasso_identity_add_assertion(LassoIdentity_get(identity_obj), remote_providerID, */
|
||||
/* LassoNode_get(assertion_obj)); */
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
|
||||
PyObject *identity_destroy(PyObject *self, PyObject *args) {
|
||||
PyObject *identity_obj;
|
||||
|
||||
if (CheckArgs(args, "O:identity_destroy")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:identity_destroy",
|
||||
&identity_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
lasso_identity_destroy(LassoIdentity_get(identity_obj));
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
|
||||
PyObject *identity_dump(PyObject *self, PyObject *args) {
|
||||
PyObject *identity_obj;
|
||||
gchar *dump;
|
||||
|
@ -112,72 +76,3 @@ PyObject *identity_dump(PyObject *self, PyObject *args) {
|
|||
|
||||
return (charPtrConst_wrap(dump));
|
||||
}
|
||||
|
||||
PyObject *identity_get_assertion(PyObject *self, PyObject *args) {
|
||||
PyObject *identity_obj;
|
||||
LassoNode *assertion_node;
|
||||
gchar *remote_providerID;
|
||||
|
||||
if (CheckArgs(args, "OS:identity_get_assertion")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Os:identity_get_assertion", &identity_obj,
|
||||
&remote_providerID))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
assertion_node = lasso_identity_get_assertion(LassoIdentity_get(identity_obj),
|
||||
remote_providerID);
|
||||
|
||||
return (LassoNode_wrap(assertion_node));
|
||||
}
|
||||
|
||||
PyObject *identity_get_authentication_method(PyObject *self, PyObject *args) {
|
||||
PyObject *identity_obj;
|
||||
gchar *remote_providerID;
|
||||
gchar *authentication_method;
|
||||
|
||||
if (CheckArgs(args, "Os:identity_get_authentication_method")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Oz:identity_get_authentication_method",
|
||||
&identity_obj, &remote_providerID))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
authentication_method = lasso_identity_get_authentication_method(LassoIdentity_get(identity_obj),
|
||||
remote_providerID);
|
||||
|
||||
return (charPtrConst_wrap(authentication_method));
|
||||
}
|
||||
|
||||
PyObject *identity_get_next_assertion_remote_providerID(PyObject *self, PyObject *args) {
|
||||
PyObject *identity_obj;
|
||||
gchar *remote_providerID;
|
||||
|
||||
if (CheckArgs(args, "O:identity_get_next_assertion_remote_providerID")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:identity_get_next_assertion_remote_providerID",
|
||||
&identity_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
remote_providerID = lasso_identity_get_next_assertion_remote_providerID(LassoIdentity_get(identity_obj));
|
||||
|
||||
return (charPtrConst_wrap(remote_providerID));
|
||||
}
|
||||
|
||||
PyObject *identity_remove_assertion(PyObject *self, PyObject *args) {
|
||||
PyObject *identity_obj;
|
||||
gchar *remote_providerID;
|
||||
int code;
|
||||
|
||||
if (CheckArgs(args, "OS:identity_remove_assertion")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Os:identity_remove_assertion", &identity_obj,
|
||||
&remote_providerID))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
code = lasso_identity_remove_assertion(LassoIdentity_get(identity_obj), remote_providerID);
|
||||
|
||||
return (int_wrap(code));
|
||||
}
|
||||
|
|
|
@ -38,13 +38,6 @@ PyObject *LassoIdentity_wrap(LassoIdentity *identity);
|
|||
|
||||
PyObject *identity_new(PyObject *self, PyObject *args);
|
||||
PyObject *identity_new_from_dump(PyObject *self, PyObject *args);
|
||||
|
||||
PyObject *identity_add_assertion(PyObject *self, PyObject *args);
|
||||
PyObject *identity_destroy(PyObject *self, PyObject *args);
|
||||
PyObject *identity_dump(PyObject *self, PyObject *args);
|
||||
PyObject *identity_get_assertion(PyObject *self, PyObject *args);
|
||||
PyObject *identity_get_authentication_method(PyObject *self, PyObject *args);
|
||||
PyObject *identity_get_next_assertion_remote_providerID(PyObject *self, PyObject *args);
|
||||
PyObject *identity_remove_assertion(PyObject *self, PyObject *args);
|
||||
|
||||
#endif /* __PYLASSO_PY_IDENTITY_H__ */
|
||||
|
|
|
@ -213,12 +213,12 @@ PyObject *login_build_request_msg(PyObject *self, PyObject *args) {
|
|||
return (int_wrap(ret));
|
||||
}
|
||||
|
||||
PyObject *login_accespt_sso(PyObject *self, PyObject *args) {
|
||||
PyObject *login_accept_sso(PyObject *self, PyObject *args) {
|
||||
PyObject *login_obj;
|
||||
gint ret;
|
||||
|
||||
if (CheckArgs(args, "O:login_accespt_sso")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:login_accespt_sso",
|
||||
if (CheckArgs(args, "O:login_accept_sso")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:login_accept_sso",
|
||||
&login_obj))
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -42,11 +42,11 @@ PyObject *LassoLogin_wrap(LassoLogin *login);
|
|||
PyObject *login_getattr(PyObject *self, PyObject *args);
|
||||
PyObject *login_new(PyObject *self, PyObject *args);
|
||||
PyObject *login_new_from_dump(PyObject *self, PyObject *args);
|
||||
PyObject *login_accept_sso(PyObject *self, PyObject *args);
|
||||
PyObject *login_build_artifact_msg(PyObject *self, PyObject *args);
|
||||
PyObject *login_build_authn_request_msg(PyObject *self, PyObject *args);
|
||||
PyObject *login_build_authn_response_msg(PyObject *self, PyObject *args);
|
||||
PyObject *login_build_request_msg(PyObject *self, PyObject *args);
|
||||
PyObject *login_create_user(PyObject *self, PyObject *args);
|
||||
PyObject *login_dump(PyObject *self, PyObject *args);
|
||||
PyObject *login_init_authn_request(PyObject *self, PyObject *args);
|
||||
PyObject *login_init_from_authn_request_msg(PyObject *self, PyObject *args);
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
#include "../lassomod.h"
|
||||
#include "py_profile.h"
|
||||
#include "py_user.h"
|
||||
#include "py_identity.h"
|
||||
#include "py_session.h"
|
||||
#include "py_server.h"
|
||||
|
||||
PyObject *LassoProfile_wrap(LassoProfile *ctx) {
|
||||
|
@ -61,40 +62,44 @@ PyObject *profile_get_request_type_from_soap_msg(PyObject *self, PyObject *args)
|
|||
/******************************************************************************/
|
||||
|
||||
PyObject *profile_new(PyObject *self, PyObject *args) {
|
||||
PyObject *server_obj, *user_obj;
|
||||
PyObject *server_obj, *identity_obj, *session_obj;
|
||||
LassoProfile *ctx;
|
||||
LassoUser *user = NULL;
|
||||
LassoIdentity *identity = NULL;
|
||||
LassoSession *session = NULL;
|
||||
|
||||
if (CheckArgs(args, "Oo:profile_new")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O|O:profile_new",
|
||||
&server_obj, &user_obj))
|
||||
if (CheckArgs(args, "Ooo:profile_new")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O|OO:profile_new",
|
||||
&server_obj, &identity_obj, &session_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
if (user_obj != Py_None) {
|
||||
user = LassoUser_get(user_obj);
|
||||
if (identity_obj != Py_None) {
|
||||
identity = LassoIdentity_get(identity_obj);
|
||||
}
|
||||
if (session_obj != Py_None) {
|
||||
session = LassoSession_get(session_obj);
|
||||
}
|
||||
ctx = lasso_profile_new(LassoServer_get(server_obj),
|
||||
user);
|
||||
identity, session);
|
||||
|
||||
return (LassoProfile_wrap(ctx));
|
||||
}
|
||||
|
||||
PyObject *profile_set_user_from_dump(PyObject *self, PyObject *args) {
|
||||
PyObject *profile_set_identity_from_dump(PyObject *self, PyObject *args) {
|
||||
PyObject *ctx_obj;
|
||||
gchar *dump;
|
||||
gint ret;
|
||||
|
||||
if (CheckArgs(args, "OS:profile_set_user_from_dump")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Os:profile_set_user_from_dump",
|
||||
if (CheckArgs(args, "OS:profile_set_identity_from_dump")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Os:profile_set_identity_from_dump",
|
||||
&ctx_obj, &dump))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
ret = lasso_profile_set_user_from_dump(LassoProfile_get(ctx_obj),
|
||||
dump);
|
||||
ret = lasso_profile_set_identity_from_dump(LassoProfile_get(ctx_obj),
|
||||
dump);
|
||||
|
||||
return(int_wrap(ret));
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ PyObject *LassoProfile_wrap(LassoProfile *ctx);
|
|||
PyObject *profile_get_request_type_from_soap_msg(PyObject *self, PyObject *args);
|
||||
|
||||
PyObject *profile_new(PyObject *self, PyObject *args);
|
||||
PyObject *profile_set_user_from_dump(PyObject *self, PyObject *args);
|
||||
PyObject *profile_set_identity_from_dump(PyObject *self, PyObject *args);
|
||||
|
||||
#endif /* __PYLASSO_PY_PROFILE_H__ */
|
||||
|
||||
|
|
|
@ -55,16 +55,16 @@ PyObject *register_name_identifier_getattr(PyObject *self, PyObject *args) {
|
|||
register_name_identifier = LassoRegisterNameIdentifier_get(register_name_identifier_obj);
|
||||
|
||||
if (!strcmp(attr, "__members__"))
|
||||
return Py_BuildValue("[ssss]", "user", "msg_url", "msg_body",
|
||||
return Py_BuildValue("[ssss]", "identity", "msg_url", "msg_body",
|
||||
"msg_relayState");
|
||||
if (!strcmp(attr, "user"))
|
||||
return (LassoUser_wrap(LASSO_PROFILE_CONTEXT(register_name_identifier)->user));
|
||||
if (!strcmp(attr, "identity"))
|
||||
return (LassoIdentity_wrap(LASSO_PROFILE(register_name_identifier)->identity));
|
||||
if (!strcmp(attr, "msg_url"))
|
||||
return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(register_name_identifier)->msg_url));
|
||||
return (charPtrConst_wrap(LASSO_PROFILE(register_name_identifier)->msg_url));
|
||||
if (!strcmp(attr, "msg_body"))
|
||||
return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(register_name_identifier)->msg_body));
|
||||
return (charPtrConst_wrap(LASSO_PROFILE(register_name_identifier)->msg_body));
|
||||
if (!strcmp(attr, "msg_relayState"))
|
||||
return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(register_name_identifier)->msg_relayState));
|
||||
return (charPtrConst_wrap(LASSO_PROFILE(register_name_identifier)->msg_relayState));
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
|
@ -155,21 +155,18 @@ PyObject *register_name_identifier_init_request(PyObject *self, PyObject *args)
|
|||
return(int_wrap(codeError));
|
||||
}
|
||||
|
||||
PyObject *register_name_identifier_process_request_msg(PyObject *self, PyObject *args) {
|
||||
PyObject *register_name_identifier_process_request(PyObject *self, PyObject *args) {
|
||||
PyObject *register_name_identifier_obj;
|
||||
gchar *request_msg;
|
||||
gint request_method;
|
||||
gint codeError;
|
||||
|
||||
if (CheckArgs(args, "OSI:register_name_identifier_process_request_msg")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Osi:register_name_identifier_process_request_msg",
|
||||
®ister_name_identifier_obj, &request_msg, &request_method))
|
||||
if (CheckArgs(args, "O:register_name_identifier_process_request")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:register_name_identifier_process_request",
|
||||
®ister_name_identifier_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
codeError = lasso_register_name_identifier_process_request_msg(LassoRegisterNameIdentifier_get(register_name_identifier_obj),
|
||||
request_msg, request_method);
|
||||
codeError = lasso_register_name_identifier_process_request(LassoRegisterNameIdentifier_get(register_name_identifier_obj));
|
||||
|
||||
return(int_wrap(codeError));
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <lasso/environs/register_name_identifier.h>
|
||||
|
||||
#include "py_server.h"
|
||||
#include "py_user.h"
|
||||
#include "py_identity.h"
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
|
@ -47,7 +47,7 @@ PyObject *register_name_identifier_build_response_msg(PyObject *self, PyObject *
|
|||
PyObject *register_name_identifier_destroy(PyObject *self, PyObject *args);
|
||||
PyObject *register_name_identifier_init_request(PyObject *self, PyObject *args);
|
||||
PyObject *register_name_identifier_new(PyObject *self, PyObject *args);
|
||||
PyObject *register_name_identifier_process_request_msg(PyObject *self, PyObject *args);
|
||||
PyObject *register_name_identifier_process_request(PyObject *self, PyObject *args);
|
||||
PyObject *register_name_identifier_process_response_msg(PyObject *self, PyObject *args);
|
||||
|
||||
#endif /* __PYLASSO_PY_REGISTER_NAME_IDENTIFIER_H__ */
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PyLasso -- Python bindings for Lasso library
|
||||
*
|
||||
* Copyright (C) 2004 Entr'ouvert
|
||||
* http://lasso.entrouvert.org
|
||||
*
|
||||
* Authors: Nicolas Clapies <nclapies@entrouvert.com>
|
||||
* Valery Febvre <vfebvre@easter-eggs.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_session.h"
|
||||
#include "../xml/py_xml.h"
|
||||
|
||||
PyObject *LassoSession_wrap(LassoSession *session) {
|
||||
PyObject *ret;
|
||||
|
||||
if (session == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) session,
|
||||
(char *) "LassoSession *", NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
PyObject *session_new(PyObject *self, PyObject *args) {
|
||||
return (LassoSession_wrap(lasso_session_new()));
|
||||
}
|
||||
|
||||
PyObject *session_new_from_dump(PyObject *self, PyObject *args) {
|
||||
LassoSession *session;
|
||||
gchar *dump;
|
||||
|
||||
if (CheckArgs(args, "S:session_new_from_dump")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "s:session_new_from_dump", &dump))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
session = lasso_session_new_from_dump(dump);
|
||||
|
||||
return (LassoSession_wrap(session));
|
||||
}
|
||||
|
||||
PyObject *session_add_assertion(PyObject *self, PyObject *args){
|
||||
PyObject *session_obj, *assertion_obj;
|
||||
gchar *remote_providerID;
|
||||
|
||||
if (CheckArgs(args, "OSO:session_add_assertion")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "OsO:session_add_assertion", &session_obj,
|
||||
&remote_providerID, &assertion_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
lasso_session_add_assertion(LassoSession_get(session_obj), remote_providerID,
|
||||
LassoNode_get(assertion_obj));
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
|
||||
PyObject *session_destroy(PyObject *self, PyObject *args) {
|
||||
PyObject *session_obj;
|
||||
|
||||
if (CheckArgs(args, "O:session_destroy")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:session_destroy",
|
||||
&session_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
lasso_session_destroy(LassoSession_get(session_obj));
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
|
||||
PyObject *session_dump(PyObject *self, PyObject *args) {
|
||||
PyObject *session_obj;
|
||||
gchar *dump;
|
||||
|
||||
if (CheckArgs(args, "O:session_dump")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:session_dump", &session_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
dump = lasso_session_dump(LassoSession_get(session_obj));
|
||||
|
||||
return (charPtrConst_wrap(dump));
|
||||
}
|
||||
|
||||
PyObject *session_get_assertion(PyObject *self, PyObject *args) {
|
||||
PyObject *session_obj;
|
||||
LassoNode *assertion_node;
|
||||
gchar *remote_providerID;
|
||||
|
||||
if (CheckArgs(args, "OS:session_get_assertion")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Os:session_get_assertion", &session_obj,
|
||||
&remote_providerID))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
assertion_node = lasso_session_get_assertion(LassoSession_get(session_obj),
|
||||
remote_providerID);
|
||||
|
||||
return (LassoNode_wrap(assertion_node));
|
||||
}
|
||||
|
||||
PyObject *session_get_authentication_method(PyObject *self, PyObject *args) {
|
||||
PyObject *session_obj;
|
||||
gchar *remote_providerID;
|
||||
gchar *authentication_method;
|
||||
|
||||
if (CheckArgs(args, "Os:session_get_authentication_method")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Oz:session_get_authentication_method",
|
||||
&session_obj, &remote_providerID))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
authentication_method = lasso_session_get_authentication_method(LassoSession_get(session_obj),
|
||||
remote_providerID);
|
||||
|
||||
return (charPtrConst_wrap(authentication_method));
|
||||
}
|
||||
|
||||
PyObject *session_get_next_assertion_remote_providerID(PyObject *self, PyObject *args) {
|
||||
PyObject *session_obj;
|
||||
gchar *remote_providerID;
|
||||
|
||||
if (CheckArgs(args, "O:session_get_next_assertion_remote_providerID")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "O:session_get_next_assertion_remote_providerID",
|
||||
&session_obj))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
remote_providerID = lasso_session_get_next_assertion_remote_providerID(LassoSession_get(session_obj));
|
||||
|
||||
return (charPtrConst_wrap(remote_providerID));
|
||||
}
|
||||
|
||||
PyObject *session_remove_assertion(PyObject *self, PyObject *args) {
|
||||
PyObject *session_obj;
|
||||
gchar *remote_providerID;
|
||||
int code;
|
||||
|
||||
if (CheckArgs(args, "OS:session_remove_assertion")) {
|
||||
if(!PyArg_ParseTuple(args, (char *) "Os:session_remove_assertion", &session_obj,
|
||||
&remote_providerID))
|
||||
return NULL;
|
||||
}
|
||||
else return NULL;
|
||||
|
||||
code = lasso_session_remove_assertion(LassoSession_get(session_obj),
|
||||
remote_providerID);
|
||||
|
||||
return (int_wrap(code));
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/* $Id$
|
||||
*
|
||||
* PyLasso -- Python bindings for Lasso library
|
||||
*
|
||||
* Copyright (C) 2004 Entr'ouvert
|
||||
* http://lasso.entrouvert.org
|
||||
*
|
||||
* Authors: Nicolas Clapies <nclapies@entrouvert.com>
|
||||
* Valery Febvre <vfebvre@easter-eggs.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_USER_H__
|
||||
#define __PYLASSO_PY_USER_H__
|
||||
|
||||
#include <lasso/environs/session.h>
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
LassoSession *obj;
|
||||
} LassoSession_object;
|
||||
|
||||
#define LassoSession_get(v) (((v) == Py_None) ? NULL : (((LassoSession_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj))
|
||||
PyObject *LassoSession_wrap(LassoSession *session);
|
||||
|
||||
PyObject *session_new(PyObject *self, PyObject *args);
|
||||
PyObject *session_new_from_dump(PyObject *self, PyObject *args);
|
||||
|
||||
PyObject *session_add_assertion(PyObject *self, PyObject *args);
|
||||
PyObject *session_destroy(PyObject *self, PyObject *args);
|
||||
PyObject *session_dump(PyObject *self, PyObject *args);
|
||||
PyObject *session_get_assertion(PyObject *self, PyObject *args);
|
||||
PyObject *session_get_authentication_method(PyObject *self, PyObject *args);
|
||||
PyObject *session_get_next_assertion_remote_providerID(PyObject *self, PyObject *args);
|
||||
PyObject *session_remove_assertion(PyObject *self, PyObject *args);
|
||||
|
||||
#endif /* __PYLASSO_PY_SESSION_H__ */
|
|
@ -793,7 +793,7 @@ class Server:
|
|||
def destroy(self):
|
||||
lassomod.server_destroy(self)
|
||||
|
||||
class User:
|
||||
class Session:
|
||||
"""
|
||||
"""
|
||||
|
||||
|
@ -803,35 +803,35 @@ class User:
|
|||
self._o = _obj
|
||||
|
||||
def new(cls):
|
||||
obj = lassmod.user_new()
|
||||
return User(obj)
|
||||
obj = lassmod.session_new()
|
||||
return Session(obj)
|
||||
new = classmethod(new)
|
||||
|
||||
def new_from_dump(cls, dump):
|
||||
obj = lassomod.user_new_from_dump(dump)
|
||||
return User(obj)
|
||||
obj = lassomod.session_new_from_dump(dump)
|
||||
return Session(obj)
|
||||
new_from_dump = classmethod(new_from_dump)
|
||||
|
||||
def add_assertion(self, remote_providerID, assertion):
|
||||
lassomod.user_add_assertion(self, remote_providerID, assertion)
|
||||
lassomod.session_add_assertion(self, remote_providerID, assertion)
|
||||
|
||||
def dump(self):
|
||||
return lassomod.user_dump(self)
|
||||
return lassomod.session_dump(self)
|
||||
|
||||
def destroy(self):
|
||||
lassomod.user_destroy(self)
|
||||
lassomod.session_destroy(self)
|
||||
|
||||
def get_assertion(self, remote_providerID):
|
||||
return Node(lassomod.user_get_assertion(self, remote_providerID))
|
||||
return Node(lassomod.session_get_assertion(self, remote_providerID))
|
||||
|
||||
def get_authentication_method(self, remote_providerID = None):
|
||||
return lassomod.user_get_authentication_method(self, remote_providerID)
|
||||
return lassomod.session_get_authentication_method(self, remote_providerID)
|
||||
|
||||
def get_next_assertion_remote_providerID(self):
|
||||
return lassomod.user_get_next_assertion_remote_providerID(self)
|
||||
return lassomod.session_get_next_assertion_remote_providerID(self)
|
||||
|
||||
def remove_assertion(self, remote_providerID):
|
||||
lassomod.user_remove_assertion(self, remote_providerID)
|
||||
lassomod.session_remove_assertion(self, remote_providerID)
|
||||
|
||||
## ProfileContext
|
||||
# Request types
|
||||
|
@ -844,7 +844,7 @@ requestTypeNameIdentifierMapping = 5
|
|||
def get_request_type_from_soap_msg(soap_buffer):
|
||||
return lassomod.profile_context_get_request_type_from_soap_msg(soap_buffer);
|
||||
|
||||
class ProfileContext:
|
||||
class Profile:
|
||||
"""\brief Short desc
|
||||
|
||||
Long desc
|
||||
|
@ -855,19 +855,19 @@ class ProfileContext:
|
|||
"""
|
||||
self._o = _obj
|
||||
|
||||
def new(cls, server, user=None):
|
||||
obj = lassomod.profile_context_new(server, user)
|
||||
return ProfileContext(obj)
|
||||
def new(cls, server, identity=None, session=None):
|
||||
obj = lassomod.profile_new(server, identity, session)
|
||||
return Profile(obj)
|
||||
new = classmethod(new)
|
||||
|
||||
def set_user_from_dump(self, dump):
|
||||
return lassomod.profile_context_set_user_from_dump(self, dump)
|
||||
def set_identity_from_dump(self, dump):
|
||||
return lassomod.profile_set_identity_from_dump(self, dump)
|
||||
|
||||
## login
|
||||
loginProtocolProfileBrwsArt = 1
|
||||
loginProtocolProfileBrwsPost = 2
|
||||
|
||||
class Login(ProfileContext):
|
||||
class Login(Profile):
|
||||
"""\brief Short desc
|
||||
|
||||
Long desc
|
||||
|
@ -878,7 +878,7 @@ class Login(ProfileContext):
|
|||
The constructor
|
||||
"""
|
||||
self._o = _obj
|
||||
ProfileContext.__init__(self, _obj=_obj)
|
||||
Profile.__init__(self, _obj=_obj)
|
||||
|
||||
def __isprivate(self, name):
|
||||
return name == '_o'
|
||||
|
@ -907,11 +907,14 @@ class Login(ProfileContext):
|
|||
return Login(obj)
|
||||
new = classmethod(new)
|
||||
|
||||
def new_from_dump(cls, server, user, dump):
|
||||
obj = lassomod.login_new_from_dump(server, user, dump)
|
||||
def new_from_dump(cls, server, identity, dump):
|
||||
obj = lassomod.login_new_from_dump(server, identity, dump)
|
||||
return Login(obj)
|
||||
new_from_dump = classmethod(new_from_dump)
|
||||
|
||||
def accept_sso(self):
|
||||
return lassomod.login_accept_sso(self)
|
||||
|
||||
def build_artifact_msg(self, authentication_result, authenticationMethod,
|
||||
reauthenticateOnOrAfter, method):
|
||||
return lassomod.login_build_artifact_msg(self, authentication_result,
|
||||
|
@ -931,9 +934,6 @@ class Login(ProfileContext):
|
|||
def build_request_msg(self):
|
||||
return lassomod.login_build_request_msg(self)
|
||||
|
||||
def create_user(self, user_dump):
|
||||
return lassomod.login_create_user(self, user_dump)
|
||||
|
||||
def dump(self):
|
||||
return lassomod.login_dump(self)
|
||||
|
||||
|
@ -964,7 +964,7 @@ providerTypeNone = 0
|
|||
providerTypeSp = 1
|
||||
providerTypeIdp = 2
|
||||
|
||||
class Logout(ProfileContext):
|
||||
class Logout(Profile):
|
||||
"""\brief Short desc
|
||||
|
||||
Long desc
|
||||
|
@ -974,7 +974,7 @@ class Logout(ProfileContext):
|
|||
The constructor
|
||||
"""
|
||||
self._o = _obj
|
||||
ProfileContext.__init__(self, _obj=_obj)
|
||||
Profile.__init__(self, _obj=_obj)
|
||||
|
||||
def __isprivate(self, name):
|
||||
return name == '_o'
|
||||
|
@ -1024,7 +1024,7 @@ class Logout(ProfileContext):
|
|||
def process_response_msg(self, response_msg, response_method):
|
||||
return lassomod.logout_process_response_msg(self, response_msg, response_method);
|
||||
|
||||
class FederationTermination(ProfileContext):
|
||||
class FederationTermination(Profile):
|
||||
"""\brief Short desc
|
||||
|
||||
Long desc
|
||||
|
@ -1034,7 +1034,7 @@ class FederationTermination(ProfileContext):
|
|||
The constructor
|
||||
"""
|
||||
self._o = _obj
|
||||
ProfileContext.__init__(self, _obj=_obj)
|
||||
Profile.__init__(self, _obj=_obj)
|
||||
|
||||
def __isprivate(self, name):
|
||||
return name == '_o'
|
||||
|
@ -1094,8 +1094,8 @@ class RegisterNameIdentifier:
|
|||
ret = lassomod.register_name_identifier_getattr(self, name)
|
||||
return ret
|
||||
|
||||
def new(cls, server, user, provider_type):
|
||||
obj = lassomod.register_name_identifier_new(server, user, provider_type)
|
||||
def new(cls, server, identity, provider_type):
|
||||
obj = lassomod.register_name_identifier_new(server, identity, provider_type)
|
||||
return RegisterNameIdentifier(obj)
|
||||
new = classmethod(new)
|
||||
|
||||
|
@ -1111,8 +1111,8 @@ class RegisterNameIdentifier:
|
|||
def init_request(self, remote_providerID):
|
||||
return lassomod.register_name_identifier_init_request(self, remote_providerID);
|
||||
|
||||
def process_request_msg(self, request_msg, request_method):
|
||||
return lassomod.register_name_identifier_process_request_msg(self, request_msg, request_method);
|
||||
def process_request(self):
|
||||
return lassomod.register_name_identifier_process_request_msg(self)
|
||||
|
||||
def process_response_msg(self, response_msg, response_method):
|
||||
return lassomod.register_name_identifier_process_response_msg(self, response_msg, response_method);
|
||||
|
@ -1162,4 +1162,3 @@ class Lecp:
|
|||
|
||||
def process_authn_response_envelope_msg(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -55,13 +55,14 @@
|
|||
#include "protocols/elements/py_authentication_statement.h"
|
||||
|
||||
#include "environs/py_federation_termination.h"
|
||||
#include "environs/py_identity.h"
|
||||
#include "environs/py_lecp.h"
|
||||
#include "environs/py_login.h"
|
||||
#include "environs/py_logout.h"
|
||||
#include "environs/py_profile_context.h"
|
||||
#include "environs/py_profile.h"
|
||||
#include "environs/py_register_name_identifier.h"
|
||||
#include "environs/py_server.h"
|
||||
#include "environs/py_user.h"
|
||||
#include "environs/py_session.h"
|
||||
|
||||
static PyMethodDef lasso_methods[] = {
|
||||
/* py_lasso.h */
|
||||
|
@ -195,13 +196,17 @@ static PyMethodDef lasso_methods[] = {
|
|||
{"authentication_statement_new", authentication_statement_new, METH_VARARGS},
|
||||
|
||||
/* environs */
|
||||
{"profile_context_get_request_type_from_soap_msg", profile_context_get_request_type_from_soap_msg, METH_VARARGS},
|
||||
{"profile_context_new", profile_context_new, METH_VARARGS},
|
||||
{"profile_context_set_user_from_dump", profile_context_set_user_from_dump, METH_VARARGS},
|
||||
{"profile_get_request_type_from_soap_msg", profile_get_request_type_from_soap_msg, METH_VARARGS},
|
||||
{"profile_new", profile_new, METH_VARARGS},
|
||||
{"profile_set_identity_from_dump", profile_set_identity_from_dump, METH_VARARGS},
|
||||
|
||||
/* py_identity.h */
|
||||
{"identity_new", identity_new, METH_VARARGS},
|
||||
{"identity_new_from_dump", identity_new_from_dump, METH_VARARGS},
|
||||
{"identity_dump", identity_dump, METH_VARARGS},
|
||||
|
||||
/* py_federation_termination.h */
|
||||
{"federation_termination_getattr", federation_termination_getattr, METH_VARARGS},
|
||||
|
||||
{"federation_termination_getattr", federation_termination_getattr, METH_VARARGS},
|
||||
{"federation_termination_new", federation_termination_new, METH_VARARGS},
|
||||
{"federation_termination_build_notification_msg", federation_termination_build_notification_msg, METH_VARARGS},
|
||||
{"federation_termination_destroy", federation_termination_destroy, METH_VARARGS},
|
||||
|
@ -219,15 +224,15 @@ static PyMethodDef lasso_methods[] = {
|
|||
{"lecp_process_authn_response_envelope_msg", lecp_process_authn_response_envelope_msg, METH_VARARGS},
|
||||
|
||||
/* py_login.h */
|
||||
{"login_getattr", login_getattr, METH_VARARGS},
|
||||
{"login_getattr", login_getattr, METH_VARARGS},
|
||||
{"login_new", login_new, METH_VARARGS},
|
||||
{"login_new_from_dump", login_new_from_dump, METH_VARARGS},
|
||||
{"login_accept_sso", login_accept_sso, METH_VARARGS},
|
||||
{"login_build_artifact_msg", login_build_artifact_msg, METH_VARARGS},
|
||||
{"login_build_authn_request_msg", login_build_authn_request_msg, METH_VARARGS},
|
||||
{"login_build_authn_response_msg", login_build_authn_response_msg, METH_VARARGS},
|
||||
{"login_build_request_msg", login_build_request_msg, METH_VARARGS},
|
||||
{"login_dump", login_dump, METH_VARARGS},
|
||||
{"login_create_user", login_create_user, METH_VARARGS},
|
||||
{"login_init_authn_request", login_init_authn_request, METH_VARARGS},
|
||||
{"login_init_from_authn_request_msg", login_init_from_authn_request_msg, METH_VARARGS},
|
||||
{"login_init_request", login_init_request, METH_VARARGS},
|
||||
|
@ -237,8 +242,7 @@ static PyMethodDef lasso_methods[] = {
|
|||
{"login_process_response_msg", login_process_response_msg, METH_VARARGS},
|
||||
|
||||
/* py_logout.h */
|
||||
{"logout_getattr", logout_getattr, METH_VARARGS},
|
||||
|
||||
{"logout_getattr", logout_getattr, METH_VARARGS},
|
||||
{"logout_new", logout_new, METH_VARARGS},
|
||||
{"logout_build_request_msg", logout_build_request_msg, METH_VARARGS},
|
||||
{"logout_build_response_msg", logout_build_response_msg, METH_VARARGS},
|
||||
|
@ -250,17 +254,15 @@ static PyMethodDef lasso_methods[] = {
|
|||
{"logout_process_response_msg", logout_process_response_msg, METH_VARARGS},
|
||||
|
||||
/* py_register_name_identifier.h */
|
||||
{"register_name_identifier_getattr", register_name_identifier_getattr, METH_VARARGS},
|
||||
|
||||
{"register_name_identifier_getattr", register_name_identifier_getattr, METH_VARARGS},
|
||||
{"register_name_identifier_new", register_name_identifier_new, METH_VARARGS},
|
||||
{"register_name_identifier_build_request_msg", register_name_identifier_build_request_msg, METH_VARARGS},
|
||||
{"register_name_identifier_build_response_msg", register_name_identifier_build_response_msg, METH_VARARGS},
|
||||
{"register_name_identifier_destroy", register_name_identifier_destroy, METH_VARARGS},
|
||||
{"register_name_identifier_init_request", register_name_identifier_init_request, METH_VARARGS},
|
||||
{"register_name_identifier_process_request_msg", register_name_identifier_process_request_msg, METH_VARARGS},
|
||||
{"register_name_identifier_process_request", register_name_identifier_process_request, METH_VARARGS},
|
||||
{"register_name_identifier_process_response_msg", register_name_identifier_process_response_msg, METH_VARARGS},
|
||||
|
||||
|
||||
/* py_server.h */
|
||||
{"server_new", server_new, METH_VARARGS},
|
||||
{"server_new_from_dump", server_new_from_dump, METH_VARARGS},
|
||||
|
@ -268,16 +270,16 @@ static PyMethodDef lasso_methods[] = {
|
|||
{"server_destroy", server_destroy, METH_VARARGS},
|
||||
{"server_dump", server_dump, METH_VARARGS},
|
||||
|
||||
/* py_user.h */
|
||||
{"user_new", user_new, METH_VARARGS},
|
||||
{"user_new_from_dump", user_new_from_dump, METH_VARARGS},
|
||||
{"user_add_assertion", user_add_assertion, METH_VARARGS},
|
||||
{"user_destroy", user_destroy, METH_VARARGS},
|
||||
{"user_dump", user_dump, METH_VARARGS},
|
||||
{"user_get_assertion", user_get_assertion, METH_VARARGS},
|
||||
{"user_get_authentication_method", user_get_authentication_method, METH_VARARGS},
|
||||
{"user_get_next_assertion_remote_providerID", user_get_next_assertion_remote_providerID, METH_VARARGS},
|
||||
{"user_remove_assertion", user_remove_assertion, METH_VARARGS},
|
||||
/* py_session.h */
|
||||
{"session_new", session_new, METH_VARARGS},
|
||||
{"session_new_from_dump", session_new_from_dump, METH_VARARGS},
|
||||
{"session_add_assertion", session_add_assertion, METH_VARARGS},
|
||||
{"session_destroy", session_destroy, METH_VARARGS},
|
||||
{"session_dump", session_dump, METH_VARARGS},
|
||||
{"session_get_assertion", session_get_assertion, METH_VARARGS},
|
||||
{"session_get_authentication_method", session_get_authentication_method, METH_VARARGS},
|
||||
{"session_get_next_assertion_remote_providerID", session_get_next_assertion_remote_providerID, METH_VARARGS},
|
||||
{"session_remove_assertion", session_remove_assertion, METH_VARARGS},
|
||||
|
||||
{NULL, NULL} /* End of Methods Sentinel */
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue