Skip to content

Generate the redaction test values with crypto/rand - #41

Merged
imanimanyara merged 1 commit into
mainfrom
test/generated-credentials
Nov 7, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
test/generated-credentials

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Summary

  • internal/secret/redact_test.go wrote down supersecretvalue. Its token-shape cases were a prefix plus one repeated letter, which GitGuardian still matched.
  • Every value now comes from crypto/rand in the alphabet its pattern expects.

Verification

  • go test -count=5 ./internal/secret/ and go vet are clean.
  • A planted case that should not match turns the test red.

TestRedactLiterals wrote 'supersecretvalue' down, and the token-shape
cases were a prefix plus a run of one repeated letter, which GitGuardian
still matched and reported. Every value is now drawn from crypto/rand in
the alphabet its pattern expects, so the cases also cover more than one
fixed string.
Copilot AI balanced review requested due to automatic review settings November 7, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@imanimanyara
imanimanyara merged commit ea71e8d into main Nov 7, 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.

2 participants