From f0df38d028e4997d1e7008c4fcf998a8a553981d Mon Sep 17 00:00:00 2001 From: Cristian Betivu Date: Sat, 16 Nov 2024 15:30:09 +0200 Subject: [PATCH] Some docstring --- src/keycloak/keycloak_openid.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/keycloak/keycloak_openid.py b/src/keycloak/keycloak_openid.py index 23381d2..1ee655c 100644 --- a/src/keycloak/keycloak_openid.py +++ b/src/keycloak/keycloak_openid.py @@ -583,6 +583,14 @@ def introspect(self, token, rpt=None, token_type_hint=None): @staticmethod def _verify_token(token, key: Union[jwk.JWK, jwk.JWKSet, None], **kwargs): + """Decode and optionally validate a token. + + :param token: The token to verify + :param key: Which key should be used for validation. + If not provided, the validation is not performed and the token is implicitly valid. + :param kwargs: Additional keyword arguments for jwcrypto's JWT object + :returns: Decoded token + """ # keep the function free of IO # this way it can be used by `decode_token` and `a_decode_token`