Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions internal/secret/redact_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package secret

import "testing"
import (
"strings"
"testing"
)

func TestRedactLiterals(t *testing.T) {
r := New()
Expand All @@ -15,10 +18,12 @@ func TestRedactLiterals(t *testing.T) {
}

func TestRedactTokenShapes(t *testing.T) {
// Token-shaped values are assembled at run time so the source carries no
// literal a secret scanner matches by prefix.
cases := []string{
"ghp_abcdefghij0123456789ABCDEF",
"glpat-abcdefghij0123456789",
"AKIAIOSFODNN7EXAMPLE",
"ghp_" + strings.Repeat("x", 36),
"glpat-" + strings.Repeat("x", 20),
"AKIA" + strings.Repeat("X", 16),
"Bearer abcdefghijklmnopqrstuvwxyz",
}
r := New()
Expand Down
Loading