package websource_test import ( "strings" "testing" "amadan.net/oficina/equipo/internal/runnerproto" "amadan.net/oficina/equipo/internal/websource" ) // Whatever the runner's redaction hides, a proposal may not carry. func TestLooksSecretCoversRedaction(t *testing.T) { for _, s := range []string{ "/x/token=abcdef1234", "/x/api_key:abcdef", "/x/password=hunter2", "/sk-abcdefgh1234", "/ghp_abcdefgh12345678", "/github_pat_abcdefgh12345678", "/eyJhbGciOi.eyJzdWIiOi.c2ln", "/" + strings.Repeat("Ab1", 14), } { if runnerproto.RedactDetail(s, 1000) == s { t.Fatalf("sample %q is not redacted; pick another", s) } if !websource.LooksSecret(s) { t.Errorf("redaction hides %q but LooksSecret misses it", s) } } }