Repository navigation
test: use plainly fake values for the passthrough and redaction test tokens - #115
Open
braghettos wants to merge 1 commit into
Open
braghettos wants to merge 1 commit into
braghettos wants to merge 1 commit into
Conversation
…tokens The token-passthrough and span-redaction tests (kagent-dev#107) used JWT-shaped literals. They are fake, but secret scanners flag them (gitleaks generic-api-key on internal/mcp/mcp_test.go), and a token-shaped literal in a repo is a pattern worth not normalising. The tests only need a distinctive value: redaction keys on --token and Bearer, not on the JWT shape. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLFnUd6g7xhDXDvaho4rDW Signed-off-by: Diego Braga <diego.braga86@gmail.com>
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.
Why
The token-passthrough and span-redaction tests I added in #107 use JWT-shaped literals:
internal/commands/token_kubeconfig_test.gointernal/mcp/mcp_test.gopkg/k8s/token_passthrough_test.goThey're fake, but secret scanners flag them; gitleaks reports
generic-api-keyatinternal/mcp/mcp_test.go. A token-shaped literal is also not a pattern worth normalising in a repo.Change
The three constants become plainly fake strings (
test-…-not-a-credential). The tests only need a distinctive value: redaction keys on--tokenandBearer, not on the JWT shape. No behaviour change, test-only.Checks
go test -tags=test ./internal/commands/ ./internal/mcp/ ./pkg/k8s/: pass.git grepfinds noeyJ…literals left.#114 carries the same three constants; I'll merge main into it after this lands.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TLFnUd6g7xhDXDvaho4rDW