tests: fake platform tokens that do not look like secrets
gitleaks flagged carlos_svc_0123456789 in platform_cli_test.go as a generic API key. Use test-token-not-a-secret and test-platform-token-not-a-secret instead; no allowlist entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+5
−5
platform_cli_test.go+5 −5
CI passed — run details
diff --git a/platform_cli_test.go b/platform_cli_test.go| index 7fac7998a..ded333fe3 100644 |
| --- a/platform_cli_test.go |
| +++ b/platform_cli_test.go |
| @@ -428,7 +428,7 @@ func TestPlatformCustomersUpdateSendsAndPrints(t *testing.T) { |
| // mintReply is the fake console's credential: the customer's account and |
| // name ride on the reply (pre-flight C5). |
| func mintReply() platformCredentialReply { |
| - return platformCredentialReply{Token: "carlos_svc_0123456789", Account: "bdf", Name: "shop", Role: "publish", |
| + return platformCredentialReply{Token: "test-token-not-a-secret", Account: "bdf", Name: "shop", Role: "publish", |
| ExpiresAt: time.Date(2026, time.November, 19, 15, 4, 0, 0, time.UTC)} |
| } |
| @@ -456,7 +456,7 @@ func TestPlatformCredentialsMintPrints(t *testing.T) { |
| got := pc.mustRun(t, runPlatformCredentialsMintWithSession, "--platform", "bcd", "--customer", "bdf") |
| want := `minted a publish credential for shop (bdf) |
| valid until 19 November 2026 15:04 UTC |
| - token carlos_svc_0123456789 |
| + token test-token-not-a-secret |
| use it as CARLOS_SERVICE_TOKEN with --account bdf |
| ` |
| if got != want { |
| @@ -483,7 +483,7 @@ func TestPlatformCredentialsMintPrintsDeploy(t *testing.T) { |
| "--role", "deploy", "--app", "site", "--rungs", "edge") |
| want := `minted a deploy credential for app site in shop (bdf) |
| valid until 19 November 2026 15:04 UTC |
| - token carlos_svc_0123456789 |
| + token test-token-not-a-secret |
| use it as CARLOS_SERVICE_TOKEN with --account bdf |
| ` |
| if got != want { |
| @@ -575,13 +575,13 @@ func TestPlatformCommandsWorkWithAServiceToken(t *testing.T) { |
| t.Cleanup(ts.Close) |
| t.Setenv("CARLOS_DEPLOYMENT_DIR", "") |
| t.Setenv("CARLOS_DEPLOYMENT_BUCKET", "") |
| - t.Setenv("CARLOS_SERVICE_TOKEN", "carlos_svc_platform") |
| + t.Setenv("CARLOS_SERVICE_TOKEN", "test-platform-token-not-a-secret") |
| t.Setenv("CARLOS_CONSOLE", ts.URL) |
| var out bytes.Buffer |
| if err := runPlatformCustomersListWithSession(context.Background(), nil, []string{"--platform", "bcd", "--json"}, &out); err != nil { |
| t.Fatal(err) |
| } |
| - if auth != "Bearer carlos_svc_platform" { |
| + if auth != "Bearer test-platform-token-not-a-secret" { |
| t.Errorf("Authorization %q, want the service token", auth) |
| } |
| if !strings.HasPrefix(out.String(), "{") { |