Repository navigation
fix(token): don't panic on static JWTs without exp - #16
Merged
Merged
Conversation
GetExpirationTime returns nil when the exp claim is absent, which StaticIdentityTokenProvider then dereferenced. Treat such tokens as never expiring, matching how the other providers handle a zero ExpiresAt.
bonifaido
requested review from
stoader
and
a balanced review from Copilot
and removed request for
stoader
September 30, 2026 11:53
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The nil dereference is correctly prevented and the affected behavior has focused test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Prevents static JWTs without an exp claim from panicking by treating them as non-expiring.
Changes:
- Safely maps a missing expiration claim to zero
ExpiresAt. - Adds tests for expiring, non-expiring, and malformed tokens.
| File | Description |
|---|---|
pkg/token/static_token_provider.go |
Handles absent JWT expiration claims safely. |
pkg/token/static_token_provider_test.go |
Tests static token parsing and expiration behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
baluchicken
approved these changes
Sep 30, 2026
stoader
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StaticIdentityTokenProvider dereferenced the result of GetExpirationTime, which is nil when a JWT has no exp claim. Such tokens now come back with a zero ExpiresAt, which the other providers already treat as never expiring. Adds tests for the provider.