Skip to content

test: use plainly fake values for the passthrough and redaction test tokens - #115

Open
braghettos wants to merge 1 commit into
kagent-dev:mainfrom
braghettos:test/no-token-shaped-fixture
Open

braghettos wants to merge 1 commit into
kagent-dev:mainfrom
braghettos:test/no-token-shaped-fixture

Conversation

@braghettos

Copy link
Copy Markdown
Contributor

Why

The token-passthrough and span-redaction tests I added in #107 use JWT-shaped literals:

  • internal/commands/token_kubeconfig_test.go
  • internal/mcp/mcp_test.go
  • pkg/k8s/token_passthrough_test.go

They're fake, but secret scanners flag them; gitleaks reports generic-api-key at internal/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 --token and Bearer, not on the JWT shape. No behaviour change, test-only.

Checks

  • go test -tags=test ./internal/commands/ ./internal/mcp/ ./pkg/k8s/: pass.
  • git grep finds no eyJ… literals left.
  • gitleaks reports 0 findings on the changed tree.

#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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant