diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-30 15:34:29 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-30 15:34:29 +0000 |
| commit | 8fd99730d003cf1eff4b686fe13498952213ecc5 (patch) | |
| tree | d4bc040534f32cb4e2427b992578b32f0d12d713 /python | |
| parent | 78178c89fbdbe48f3d00ec9b82b457bbae84456f (diff) | |
| download | lasso-8fd99730d003cf1eff4b686fe13498952213ecc5.tar.gz lasso-8fd99730d003cf1eff4b686fe13498952213ecc5.tar.xz lasso-8fd99730d003cf1eff4b686fe13498952213ecc5.zip | |
Update end
Diffstat (limited to 'python')
| -rw-r--r-- | python/environs/py_login.c | 2 | ||||
| -rw-r--r-- | python/environs/py_login.h | 1 | ||||
| -rw-r--r-- | python/environs/py_profile.c | 116 | ||||
| -rw-r--r-- | python/environs/py_profile.h | 7 | ||||
| -rw-r--r-- | python/lasso.py | 45 | ||||
| -rw-r--r-- | python/lassomod.c | 7 |
6 files changed, 177 insertions, 1 deletions
diff --git a/python/environs/py_login.c b/python/environs/py_login.c index 7ed92ce7..26c2f9aa 100644 --- a/python/environs/py_login.c +++ b/python/environs/py_login.c @@ -63,6 +63,8 @@ PyObject *login_getattr(PyObject *self, PyObject *args) { "protocolProfile", "assertionArtifact"); if (!strcmp(attr, "identity")) return (LassoIdentity_wrap(LASSO_PROFILE(login)->identity)); + if (!strcmp(attr, "session")) + return (LassoSession_wrap(LASSO_PROFILE(login)->session)); if (!strcmp(attr, "request")) return (LassoNode_wrap(LASSO_PROFILE(login)->request)); if (!strcmp(attr, "response")) diff --git a/python/environs/py_login.h b/python/environs/py_login.h index a9aa3b38..650ed7cc 100644 --- a/python/environs/py_login.h +++ b/python/environs/py_login.h @@ -30,6 +30,7 @@ #include "py_server.h" #include "py_identity.h" +#include "py_session.h" typedef struct { PyObject_HEAD diff --git a/python/environs/py_profile.c b/python/environs/py_profile.c index a2528d78..3e0bbe98 100644 --- a/python/environs/py_profile.c +++ b/python/environs/py_profile.c @@ -86,6 +86,87 @@ PyObject *profile_new(PyObject *self, PyObject *args) { return (LassoProfile_wrap(ctx)); } +PyObject *profile_get_identity(PyObject *self, PyObject *args) { + PyObject *ctx_obj; + LassoIdentity *identity; + + if (CheckArgs(args, "O:profile_get_identity")) { + if(!PyArg_ParseTuple(args, (char *) "O:profile_get_identity", + &ctx_obj)) + return NULL; + } + else return NULL; + + identity = lasso_profile_get_identity(LassoProfile_get(ctx_obj)); + + return(LassoIdentity_wrap(identity)); +} + +PyObject *profile_get_session(PyObject *self, PyObject *args) { + PyObject *ctx_obj; + LassoSession *session; + + if (CheckArgs(args, "O:profile_get_session")) { + if(!PyArg_ParseTuple(args, (char *) "O:profile_get_session", + &ctx_obj)) + return NULL; + } + else return NULL; + + session = lasso_profile_get_session(LassoProfile_get(ctx_obj)); + + return(LassoSession_wrap(session)); +} + +PyObject *profile_is_identity_dirty(PyObject *self, PyObject *args) { + PyObject *ctx_obj; + int ret; + + if (CheckArgs(args, "O:profile_is_identity_dirty")) { + if(!PyArg_ParseTuple(args, (char *) "O:profile_is_identity_dirty", + &ctx_obj)) + return NULL; + } + else return NULL; + + ret = lasso_profile_is_identity_dirty(LassoProfile_get(ctx_obj)); + + return(int_wrap(ret)); +} + +PyObject *profile_is_session_dirty(PyObject *self, PyObject *args) { + PyObject *ctx_obj; + int ret; + + if (CheckArgs(args, "O:profile_is_session_dirty")) { + if(!PyArg_ParseTuple(args, (char *) "O:profile_is_session_dirty", + &ctx_obj)) + return NULL; + } + else return NULL; + + ret = lasso_profile_is_session_dirty(LassoProfile_get(ctx_obj)); + + return(int_wrap(ret)); +} + +PyObject *profile_set_identity(PyObject *self, PyObject *args) { + PyObject *ctx_obj, *identity_obj; + gint ret; + + if (CheckArgs(args, "OO:profile_set_identity")) { + if(!PyArg_ParseTuple(args, (char *) "OO:profile_set_identity", + &ctx_obj, &identity_obj)) + return NULL; + } + else return NULL; + + ret = lasso_profile_set_identity(LassoProfile_get(ctx_obj), + LassoIdentity_get(identity_obj)); + + return(int_wrap(ret)); +} + PyObject *profile_set_identity_from_dump(PyObject *self, PyObject *args) { PyObject *ctx_obj; gchar *dump; @@ -103,3 +184,38 @@ PyObject *profile_set_identity_from_dump(PyObject *self, PyObject *args) { return(int_wrap(ret)); } + +PyObject *profile_set_session(PyObject *self, PyObject *args) { + PyObject *ctx_obj, *session_obj; + gint ret; + + if (CheckArgs(args, "OO:profile_set_session")) { + if(!PyArg_ParseTuple(args, (char *) "OO:profile_set_session", + &ctx_obj, &session_obj)) + return NULL; + } + else return NULL; + + ret = lasso_profile_set_session(LassoProfile_get(ctx_obj), + LassoSession_get(session_obj)); + + return(int_wrap(ret)); +} + +PyObject *profile_set_session_from_dump(PyObject *self, PyObject *args) { + PyObject *ctx_obj; + gchar *dump; + gint ret; + + if (CheckArgs(args, "OS:profile_set_session_from_dump")) { + if(!PyArg_ParseTuple(args, (char *) "Os:profile_set_session_from_dump", + &ctx_obj, &dump)) + return NULL; + } + else return NULL; + + ret = lasso_profile_set_session_from_dump(LassoProfile_get(ctx_obj), + dump); + + return(int_wrap(ret)); +} diff --git a/python/environs/py_profile.h b/python/environs/py_profile.h index c71142b5..98f7e767 100644 --- a/python/environs/py_profile.h +++ b/python/environs/py_profile.h @@ -39,7 +39,14 @@ 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_get_identity(PyObject *self, PyObject *args); +PyObject *profile_get_session(PyObject *self, PyObject *args); +PyObject *profile_is_identity_dirty(PyObject *self, PyObject *args); +PyObject *profile_is_session_dirty(PyObject *self, PyObject *args); +PyObject *profile_set_identity(PyObject *self, PyObject *args); PyObject *profile_set_identity_from_dump(PyObject *self, PyObject *args); +PyObject *profile_set_session(PyObject *self, PyObject *args); +PyObject *profile_set_session_from_dump(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_PROFILE_H__ */ diff --git a/python/lasso.py b/python/lasso.py index 754687a3..51e95699 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -793,6 +793,28 @@ class Server: def destroy(self): lassomod.server_destroy(self) +class Identity: + """ + """ + + def __init__(self, _obj): + """ + """ + self._o = _obj + + def new(cls): + obj = lassmod.identity_new() + return Identity(obj) + new = classmethod(new) + + def new_from_dump(cls, dump): + obj = lassomod.identity_new_from_dump(dump) + return Identity(obj) + new_from_dump = classmethod(new_from_dump) + + def dump(self): + return lassomod.identity_dump(self) + class Session: """ """ @@ -860,9 +882,30 @@ class Profile: return Profile(obj) new = classmethod(new) + def get_identity(self): + return Identity(_obj=lassomod.profile_get_identity(self)) + + def get_session(self): + return Session(_obj=lassomod.profile_get_session(self)) + + def is_identity_dirty(self): + return lassomod.profile_is_identity_dirty(self) + + def is_session_dirty(self): + return lassomod.profile_is_session_dirty(self) + + def set_identity(self, identity): + return lassomod.profile_set_identity(self, identity) + def set_identity_from_dump(self, dump): return lassomod.profile_set_identity_from_dump(self, dump) + def set_session(self, session): + return lassomod.profile_set_session(self, session) + + def set_session_from_dump(self, dump): + return lassomod.profile_set_session_from_dump(self, dump) + ## login loginProtocolProfileBrwsArt = 1 loginProtocolProfileBrwsPost = 2 @@ -1112,7 +1155,7 @@ class RegisterNameIdentifier: return lassomod.register_name_identifier_init_request(self, remote_providerID); def process_request(self): - return lassomod.register_name_identifier_process_request_msg(self) + return lassomod.register_name_identifier_process_request(self) def process_response_msg(self, response_msg, response_method): return lassomod.register_name_identifier_process_response_msg(self, response_msg, response_method); diff --git a/python/lassomod.c b/python/lassomod.c index cde2bbf7..10457873 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -198,7 +198,14 @@ static PyMethodDef lasso_methods[] = { /* environs */ {"profile_get_request_type_from_soap_msg", profile_get_request_type_from_soap_msg, METH_VARARGS}, {"profile_new", profile_new, METH_VARARGS}, + {"profile_get_identity", profile_get_identity, METH_VARARGS}, + {"profile_get_session", profile_get_session, METH_VARARGS}, + {"profile_is_identity_dirty", profile_is_identity_dirty, METH_VARARGS}, + {"profile_is_session_dirty", profile_is_session_dirty, METH_VARARGS}, + {"profile_set_identity", profile_set_identity, METH_VARARGS}, {"profile_set_identity_from_dump", profile_set_identity_from_dump, METH_VARARGS}, + {"profile_set_session", profile_set_session, METH_VARARGS}, + {"profile_set_session_from_dump", profile_set_session_from_dump, METH_VARARGS}, /* py_identity.h */ {"identity_new", identity_new, METH_VARARGS}, |
