diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-15 17:42:49 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-15 17:42:49 +0000 |
| commit | 58a10f4c019ed6c30dbe7e18e6265bf2281a8278 (patch) | |
| tree | ff5f4a0de55096ae940e6ea5c1d7d23079baaedb /python | |
| parent | e305d16e5a785040a343643cae9669e3c6601ada (diff) | |
| download | lasso-58a10f4c019ed6c30dbe7e18e6265bf2281a8278.tar.gz lasso-58a10f4c019ed6c30dbe7e18e6265bf2281a8278.tar.xz lasso-58a10f4c019ed6c30dbe7e18e6265bf2281a8278.zip | |
Added method create_user in Login class
+ Update
Diffstat (limited to 'python')
| -rw-r--r-- | python/environs/py_login.c | 39 | ||||
| -rw-r--r-- | python/environs/py_login.h | 1 | ||||
| -rw-r--r-- | python/lasso.py | 12 | ||||
| -rw-r--r-- | python/lassomod.c | 1 |
4 files changed, 38 insertions, 15 deletions
diff --git a/python/environs/py_login.c b/python/environs/py_login.c index 230a0317..aab37384 100644 --- a/python/environs/py_login.c +++ b/python/environs/py_login.c @@ -56,9 +56,11 @@ PyObject *login_getattr(PyObject *self, PyObject *args) { login = LassoLogin_get(login_obj); if (!strcmp(attr, "__members__")) - return Py_BuildValue("[ssssssssss]", "request", "response", "request_type", - "msg_url", "msg_body", "response_dump", "msg_relayState", + return Py_BuildValue("[ssssssssss]", "user", "request", "response", "request_type", + "msg_url", "msg_body", "msg_relayState", "response_dump", "protocolProfile", "assertionArtifact", "nameIdentifier"); + if (!strcmp(attr, "user")) + return (LassoUser_wrap(LASSO_PROFILE_CONTEXT(login)->user)); if (!strcmp(attr, "request")) return (LassoNode_wrap(LASSO_PROFILE_CONTEXT(login)->request)); if (!strcmp(attr, "response")) @@ -69,10 +71,10 @@ PyObject *login_getattr(PyObject *self, PyObject *args) { return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(login)->msg_url)); if (!strcmp(attr, "msg_body")) return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(login)->msg_body)); + if (!strcmp(attr, "msg_relayState")) + return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(login)->msg_relayState)); if (!strcmp(attr, "response_dump")) return (charPtrConst_wrap(login->response_dump)); - if (!strcmp(attr, "msg_relayState")) - return (charPtrConst_wrap(login->msg_relayState)); if (!strcmp(attr, "protocolProfile")) return (int_wrap(login->protocolProfile)); if (!strcmp(attr, "assertionArtifact")) @@ -211,6 +213,24 @@ PyObject *login_build_request_msg(PyObject *self, PyObject *args) { return (int_wrap(ret)); } +PyObject *login_create_user(PyObject *self, PyObject *args) { + PyObject *login_obj; + gchar *user_dump = NULL; + gint ret; + + if (CheckArgs(args, "Os:login_create_user")) { + if(!PyArg_ParseTuple(args, (char *) "Oz:login_create_user", + &login_obj, &user_dump)) + return NULL; + } + else return NULL; + + ret = lasso_login_create_user(LassoLogin_get(login_obj), + user_dump); + + return (int_wrap(ret)); +} + PyObject *login_dump(PyObject *self, PyObject *args) { PyObject *login_obj; gchar *ret; @@ -269,21 +289,18 @@ PyObject *login_init_request(PyObject *self, PyObject *args) { PyObject *login_obj; gchar *response_msg; lassoHttpMethods response_method; - const gchar *remote_providerID; gint ret; - if (CheckArgs(args, "OSIS:login_init_request")) { - if(!PyArg_ParseTuple(args, (char *) "Osis:login_init_request", - &login_obj, &response_msg, - &response_method, &remote_providerID)) + if (CheckArgs(args, "OSI:login_init_request")) { + if(!PyArg_ParseTuple(args, (char *) "Osi:login_init_request", + &login_obj, &response_msg, &response_method)) return NULL; } else return NULL; ret = lasso_login_init_request(LassoLogin_get(login_obj), response_msg, - response_method, - remote_providerID); + response_method); return (int_wrap(ret)); } diff --git a/python/environs/py_login.h b/python/environs/py_login.h index 4fae7931..004cabe6 100644 --- a/python/environs/py_login.h +++ b/python/environs/py_login.h @@ -46,6 +46,7 @@ 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); diff --git a/python/lasso.py b/python/lasso.py index 7c0da38c..d8c01de4 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -887,8 +887,10 @@ class Login: ret = lassomod.login_getattr(self, name) if ret is None: raise AttributeError, name + if name == "user": + ret = LassoUser(_obj=ret) if name == "request": - print "request_type =", lassomod.login_getattr(self, "request_type") + # print "request_type =", lassomod.login_getattr(self, "request_type") if lassomod.login_getattr(self, "request_type") == messageTypeAuthnRequest: ret = AuthnRequest(None, _obj=ret) # TODO @@ -925,6 +927,9 @@ class Login: 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) @@ -935,9 +940,8 @@ class Login: return lassomod.login_init_from_authn_request_msg(self, authn_request_msg, authn_request_method) - def init_request(self, response_msg, response_method, remote_providerID): - return lassomod.login_init_request(self, response_msg, - response_method, remote_providerID) + def init_request(self, response_msg, response_method): + return lassomod.login_init_request(self, response_msg, response_method) def must_authenticate(self): return lassomod.login_must_authenticate(self) diff --git a/python/lassomod.c b/python/lassomod.c index af6a6897..8e8f34e6 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -210,6 +210,7 @@ static PyMethodDef lasso_methods[] = { {"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}, |
