Skip to content

Fixing JWT expiration extraction - #692

Open
Myllyenko wants to merge 1 commit into
ydb-platform:masterfrom
Myllyenko:fix/jwt-base64url-decoding
Open

Fixing JWT expiration extraction#692
Myllyenko wants to merge 1 commit into
ydb-platform:masterfrom
Myllyenko:fix/jwt-base64url-decoding

Conversation

@Myllyenko

Copy link
Copy Markdown

JWT parts are base64url encoded (RFC 7515), but extractExpireAt used Base64.getDecoder(), which rejects - and _ with IllegalArgumentException. Any token whose payload happened to contain those characters failed to parse, so the caller fell back to the default value.

Also stop logging the jwt itself on a parse failure - it is a bearer credential and does not belong in the logs.

JWT parts are base64url encoded (RFC 7515), but extractExpireAt used
Base64.getDecoder(), which rejects '-' and '_' with
IllegalArgumentException. Any token whose payload happened to contain
those characters failed to parse, so the caller fell back to the default
value.

Also stop logging the jwt itself on a parse failure - it is a bearer
credential and does not belong in the logs.
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.96%. Comparing base (d876581) to head (b971a96).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #692      +/-   ##
============================================
+ Coverage     71.91%   71.96%   +0.04%     
  Complexity     3474     3474              
============================================
  Files           390      390              
  Lines         16220    16220              
  Branches       1698     1698              
============================================
+ Hits          11664    11672       +8     
+ Misses         3904     3898       -6     
+ Partials        652      650       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant