fix: ignore empty kubeconfig tokens - #638
Merged
Merged
Conversation
An empty inline token reached kube-client as a bearer credential and caused requests to include an empty Authorization header. Treat it as absent before client creation so other authentication methods can be used. Closes #637
|
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.
A kubeconfig user with
token: ''caused kube-client to add an empty bearer header. Treat the empty token as absent before client creation so requests can use the configured client certificate without that header.Add a local TLS regression test for absent, empty, and non-empty tokens with standard and legacy client certificates, with TLS resumption enabled and disabled. The test failed before the fix and passes after it.
Validation:
just checkpassed, including formatting, Clippy with warnings denied, and the full test suite. This change covers empty tokens only; it does not change whitespace handling or establish the cause of the reported cluster-specific 401.Closes #637