Skip to content

test: defang high-entropy fixtures in tenant-registry redaction tests - #1359

Merged
bokelley merged 2 commits into
mainfrom
bokelley/redaction-fixture-entropy
May 2, 2026
Merged

bokelley merged 2 commits into
mainfrom
bokelley/redaction-fixture-entropy

Conversation

@bokelley

@bokelley bokelley commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

GitGuardian's Generic High Entropy Secret detector flags the fake-credential strings in test/server-decisioning-tenant-registry-redaction.test.js (PR #1336). They're test fixtures — exactly the strings the redactor is supposed to redact in production — but the entropy detector can't tell them apart from real leaked credentials, and they trip every PR that merges main (e.g. caught #1352).

Changes

  • Bearer sk_live_secret_value_abc123 → Bearer placeholder_token_for_redactor_test (looked Stripe-prefix-shaped; replaced)
  • token=abc123def456ghi789jkl → token=placeholder_value_for_redactor_test (the one GitGuardian actually flagged)

Both replacements are ≥8 chars (Pattern 1 / Bearer header regex) and ≥4 chars (Pattern 4 / labeled-credential regex), so the redactor still matches and replaces. All 4 tests in the file still pass.

Test plan

  • npm run build:lib clean
  • npm run format:check clean
  • node --test test/server-decisioning-tenant-registry-redaction.test.js — all 4 tests pass
  • Test-only change, no library behavior change → no changeset

🤖 Generated with Claude Code

bokelley and others added 2 commits May 2, 2026 16:43
GitGuardian's "Generic High Entropy Secret" detector flags the
fake-credential strings used to exercise the redactor (the strings the
redactor is supposed to redact in production). Replace them with
obviously-fake low-entropy fixtures that still satisfy the redactor's
regex patterns:

- `Bearer sk_live_secret_value_abc123` →
  `Bearer placeholder_token_for_redactor_test`
- `token=abc123def456ghi789jkl` →
  `token=placeholder_value_for_redactor_test`

Both fixtures are still ≥4 chars (Pattern 4 / labeled credentials) and
≥8 chars (Pattern 1 / Bearer headers), so the redactor's behavior is
unchanged. Test assertions updated in lockstep.

Test-only change; no library behavior change → no changeset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley
bokelley merged commit 46aebff into main May 2, 2026
9 checks passed
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