mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
krb_utils: Simplify get_credentials
Previously, `get_credentials` raises either ValueError or re-raises GSSError. The former makes the handling of this function more difficult without a good reason. With this change: - `get_credentials` no longer handles exceptions by itself, but delegates this to the callers (which already process GSS errors). - `get_credentials_if_valid` doesn't raise any expected exceptions, but return valid credentials (on the moment of calling) or None. This makes it consistent with docs. Related: https://pagure.io/freeipa/issue/8873 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
committed by
Alexander Bokovoy
parent
16ab690bf6
commit
0a169b1bea
@@ -913,6 +913,9 @@ class jsonserver_session(jsonserver, KerberosSession):
|
||||
else:
|
||||
return self.service_unavailable(environ, start_response, msg)
|
||||
|
||||
except CCacheError:
|
||||
return self.need_login(start_response)
|
||||
|
||||
try:
|
||||
response = super(jsonserver_session, self).__call__(environ, start_response)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user