From 8602cf1e466159fb0f1438ddb8546e26d232acc9 Mon Sep 17 00:00:00 2001 From: Rohan Weeden Date: Tue, 18 Oct 2022 09:25:35 -0800 Subject: [PATCH] Adjust for pyjwt change in header key order https://github.com/jpadilla/pyjwt/issues/715 --- rain_api_core/logging.py | 2 +- tests/test_view_util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rain_api_core/logging.py b/rain_api_core/logging.py index 0ea4398..a23d60b 100644 --- a/rain_api_core/logging.py +++ b/rain_api_core/logging.py @@ -8,7 +8,7 @@ LOG_CENSOR = [ { - "regex": r"(eyJ0e[A-Za-z0-9-_]{10})[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*([A-Za-z0-9-_]{10})", + "regex": r"(eyJ[A-Za-z0-9-_]{12})[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*([A-Za-z0-9-_]{10})", "replace": "\\g<1>XXXXXX\\g<2>", "description": "X-out JWT Token payload" }, diff --git a/tests/test_view_util.py b/tests/test_view_util.py index 2d6ed9e..2baf95f 100644 --- a/tests/test_view_util.py +++ b/tests/test_view_util.py @@ -230,7 +230,7 @@ def test_make_jwt_payload(mock_get_jwt_keys, jwt_priv_key): encoded = make_jwt_payload({"foo": "bar"}) header, payload, signature = encoded.split(".") - assert urlsafe_b64decode(header + "==") == b'{"typ":"JWT","alg":"RS256"}' + assert urlsafe_b64decode(header + "==") == b'{"alg":"RS256","typ":"JWT"}' assert urlsafe_b64decode(payload + "==") == b'{"foo":"bar"}'