diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-26 16:46:38 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-26 16:46:38 +0000 |
| commit | 0c32f3bcbbc00f63f126098cc451a9cd2a22f3c4 (patch) | |
| tree | c3626383ab2c5b7a0d52b01eb895a7021fad11ad /python | |
| parent | 589c3383958157e0769d5ea115fd52334c738e07 (diff) | |
| download | lasso-0c32f3bcbbc00f63f126098cc451a9cd2a22f3c4.tar.gz lasso-0c32f3bcbbc00f63f126098cc451a9cd2a22f3c4.tar.xz lasso-0c32f3bcbbc00f63f126098cc451a9cd2a22f3c4.zip | |
Added constant lassoHttpMethodAny.
Added error constants to SWIG (and one to Python).
Diffstat (limited to 'python')
| -rw-r--r-- | python/lasso.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/python/lasso.py b/python/lasso.py index 73aff94f..89160616 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -92,6 +92,9 @@ class ErrorUnknown(Error): return 'Unknown error number %d in Lasso function %s' % (self.code, self.functionName) +# Binding specific errors + + class ErrorLassoAlreadyInitialized(Error): code = 1 msg = 'Lasso already initialized' @@ -135,9 +138,22 @@ class ErrorUnknownResponseType(Error): self.responseType, self.functionName) +# Lasso errors + + +class LogoutErrorUnsupportedProfile(Error): + code = lassomod.LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE + + def __str__(self): + return 'Unsupported logout profile in Lasso function %s()' % self.functionName + + def newError(code, functionName): # FIXME: Use proper ErrorClass, when Lasso will have well defined error codes. - return ErrorUnknown(code, functionName) + if code == lassomod.LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE: + return LogoutErrorUnsupportedProfile(functionName) + else: + return ErrorUnknown(code, functionName) ################################################################################ @@ -455,8 +471,9 @@ class Defederation(_ObjectMixin, lassomod.LassoDefederation, _ProfileChild): if errorCode: raise newError(errorCode, 'lasso_defederation_build_notification_msg') - def init_notification(self, remote_providerID = None): - errorCode = lassomod.lasso_defederation_init_notification(self, remote_providerID) + def init_notification(self, remote_providerID, notification_method = httpMethodAny): + errorCode = lassomod.lasso_defederation_init_notification( + self, remote_providerID, notification_method) if errorCode: raise newError(errorCode, 'lasso_defederation_init_notification') @@ -535,7 +552,7 @@ class Login(_ObjectMixin, lassomod.LassoLogin, _ProfileChild): if errorCode: raise newError(errorCode, 'lasso_login_init_from_authn_request_msg') - def init_request(self, response_msg, response_http_method): + def init_request(self, response_msg, response_http_method = httpMethodRedirect): errorCode = lassomod.lasso_login_init_request(self, response_msg, response_http_method) if errorCode: raise newError(errorCode, 'lasso_login_init_request') @@ -581,8 +598,8 @@ class Logout(_ObjectMixin, lassomod.LassoLogout, _ProfileChild): def get_next_providerID(self): return lassomod.lasso_logout_get_next_providerID(self) - def init_request(self, remote_providerID = None): - errorCode = lassomod.lasso_logout_init_request(self, remote_providerID) + def init_request(self, remote_providerID, request_method = httpMethodAny): + errorCode = lassomod.lasso_logout_init_request(self, remote_providerID, request_method) if errorCode: raise newError(errorCode, 'lasso_logout_init_request') |
