Repository navigation
fix(serviceaccount): stop returning the kubeconfig from /serviceaccount/login (#36) - #41
Merged
Merged
Conversation
…nt/login (#36) The response's `data` carried the issued identity's full kubeconfig, including client-key-data (a private key), so printing a success response leaked it. The response now carries only accessToken, user and groups. The generator still mints the identity and persists <username>-clientconfig, which plumbing endpoints, snowplow and bff read from the Secret. Before the change, a grep across 56 repos found four clients of the endpoint, all decoding accessToken only: core-provider, its cdc, rest-dynamic-controller and snowplow. The human strategies are unchanged. Adds a handler test against a fake apiserver. It asserts that the response has no data and no client-key-data and that the clientconfig is still minted; it fails on the previous handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLFnUe4HXFphxQNAfqFawZ
braghettos
force-pushed
the
fix/serviceaccount-login-omit-kubeconfig
branch
from
October 29, 2026 14:28
9622532 to
bf68f89
Compare
1 task
1 task done
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.
Closes #36.
Summary
POST /serviceaccount/loginreturned the issued identity's full kubeconfig indata, includingclient-key-data, a private key. The natural first debugging step, printing the response, wrote that key into a terminal or CI log, as reported in #36.accessToken,userandgroups.<username>-clientconfigSecret. plumbingendpoints, snowplow and bff read the kubeconfig from that Secret, so the Secret is untouched.data, and the frontend uses it, e.g./basic/login?d.Compatibility
Response-contract change: the next release should be a minor bump. Before shipping, the endpoint's consumers were checked:
accessTokenonly:core-provider/internal/tools/authn/authn.go:116composition-dynamic-controller/internal/authn/authn.gorest-dynamic-controller/internal/tools/authn/authn.go:111snowplow/internal/authn/authn.go:135krateo-scheduled-export0.5.0) pipes the body intojq .accessToken. It's also unaffected.Docs
behavior.mdandapi.md: the response contract now notes that the serviceaccount login omitsdata, and thatclient-key-datais a private key.log.md: new entry.Test plan
TestHandlerOmitsKubeconfigFromResponsedrives the real handler against a fake apiserver (TokenReview + mapping list). It asserts:dataand noclient-key-datain the body;accessToken,userandgroupsare present;Merge order
This PR conflicts trivially with #40, which adds
CertNotAfterto the sameencode.Successcall. Whichever merges second needs a one-line rebase.🤖 Generated with Claude Code
https://claude.ai/code/session_01TLFnUe4HXFphxQNAfqFawZ