Skip to content

Commit

Permalink
Adjust for pyjwt change in header key order
Browse files Browse the repository at this point in the history
  • Loading branch information
reweeden committed Oct 18, 2022
1 parent 2692276 commit 8602cf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rain_api_core/logging.py
Expand Up @@ -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>XXX<JWTTOKEN>XXX\\g<2>",
"description": "X-out JWT Token payload"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_view_util.py
Expand Up @@ -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"}'


Expand Down

0 comments on commit 8602cf1

Please sign in to comment.