Skip to content

fix(authn): correct struct tag typo jsom -> json for Expiration in kubernetes auth claims#5908

Merged
markphelps merged 2 commits into
v2from
rd/v2/jsom
May 28, 2026
Merged

fix(authn): correct struct tag typo jsom -> json for Expiration in kubernetes auth claims#5908
markphelps merged 2 commits into
v2from
rd/v2/jsom

Conversation

@erka

@erka erka commented May 25, 2026

Copy link
Copy Markdown
Contributor

The Expiration field in the claims struct had a typo in its struct tag:

jsom:"exp" → json:"exp"

This caused Go's encoding/json to never unmarshal the exp field from the Kubernetes service account JWT, leaving Expiration always as 0 (Unix epoch). Downstream this causes token expiry to be treated as January 1, 1970, effectively making all SA tokens immediately expired

Co-authored-by: Koren Ben Ezri [email protected]

closes #5906

@erka erka changed the title fix(authn): correct struct tag typo jsom -> json for Expiration field fix(authn): correct struct tag typo jsom -> json for Expiration in kubernetes auth claims May 25, 2026
@erka erka added the v2 Flipt v2 label May 25, 2026
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.28%. Comparing base (8f286b1) to head (007adc5).
⚠️ Report is 1 commits behind head on v2.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2    #5908      +/-   ##
==========================================
+ Coverage   59.38%   61.28%   +1.90%     
==========================================
  Files         141      141              
  Lines       14208    14208              
==========================================
+ Hits         8437     8707     +270     
+ Misses       5035     4772     -263     
+ Partials      736      729       -7     
Flag Coverage Δ
integrationtests 34.50% <ø> (+7.08%) ⬆️
unittests 52.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erka
erka force-pushed the rd/v2/jsom branch 2 times, most recently from d771a5e to 940784b Compare May 28, 2026 20:13

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve

The PR corrects a typo in a struct tag that prevented the Expiration claim from deserializing in Kubernetes JWT authentication. The change is direct, follows Go and project conventions, and is well-tested by a new unit test confirming correct behavior. No other issues found; documentation and coverage check out. Looks good — no changes requested.

🤖 Automated review by the Flipt PR review agent.

The Expiration field in the claims struct had a typo in its struct tag:

jsom:"exp" → json:"exp"

This caused Go's encoding/json to never unmarshal the exp field from
the Kubernetes service account JWT, leaving Expiration always as 0
(Unix epoch). Downstream this causes token expiry to be treated as
January 1, 1970, effectively making all SA tokens immediately expired

Signed-off-by: Roman Dmytrenko <[email protected]>
Co-authored-by: Koren Ben Ezri <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve

The PR fixes a struct tag typo in Kubernetes authentication claims ('jsom' → 'json'), ensuring proper JWT deserialization for the 'exp' field. The new unit test verifies correct behavior, coverage is complete for all modified lines, and no open issues remain. Change follows Go and repo conventions.

🤖 Automated review by the Flipt PR review agent.

@erka
erka marked this pull request as ready for review May 28, 2026 20:24
@erka
erka requested a review from a team as a code owner May 28, 2026 20:24
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 28, 2026
@erka erka added the automerge Used by Kodiak bot to automerge PRs label May 28, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve

This is a precise, well-tested fix for a struct tag typo that prevented the Kubernetes JWT exp claim from being unmarshaled. The new unit test directly verifies correct deserialization. No other issues found.

🤖 Automated review by the Flipt PR review agent.

@markphelps
markphelps enabled auto-merge (squash) May 28, 2026 23:22

@markphelps markphelps left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one

@markphelps
markphelps merged commit a67ffbe into v2 May 28, 2026
33 checks passed
@markphelps
markphelps deleted the rd/v2/jsom branch May 28, 2026 23:27
@github-project-automation github-project-automation Bot moved this to Done in Flipt V2 May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Used by Kodiak bot to automerge PRs size:XS This PR changes 0-9 lines, ignoring generated files. v2 Flipt v2

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants