fix(authn): fix JSON struct tag typo in kubernetes auth claims#5906
Closed
KorenBenEzri wants to merge 931 commits into
Closed
fix(authn): fix JSON struct tag typo in kubernetes auth claims#5906KorenBenEzri wants to merge 931 commits into
KorenBenEzri wants to merge 931 commits into
Conversation
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.
What
Fix a one-character typo in the
claimsstruct ininternal/server/authn/method/kubernetes/server.go.The
Expirationfield has the struct tagjsom:"exp"instead ofjson:"exp".Why
This typo causes Go's
encoding/jsonpackage to never unmarshal theexpfield from the Kubernetes service account JWT. As a result:claims.Expirationis always0time.Unix(0, 0)(January 1, 1970) is used as the token expirytime.Now()will treat the token as immediately expiredWe discovered this while building Flipt from source and had to patch it with
sedin our Dockerfile as a workaround. This PR fixes it properly upstream.Testing
Existing unit tests should continue to pass. K8s auth integration tests may now behave differently — tokens will correctly reflect their actual expiry instead of always being epoch 0.