0a169b1 krb_utils: Simplify get_credentials

3 files Authored by slev 2 years ago, Committed by abbra 2 years ago,
    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>
    
        
file modified
+23 -19
file modified
+3 -0