MCPcopy Create free account
hub / github.com/cloudflare/artifact-fs / TestFormatStatusLineRedactsPrepareError

Function TestFormatStatusLineRedactsPrepareError

internal/cli/cli_test.go:63–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61 if strings.ContainsAny(got, "\n\t") {
62 t.Fatalf("status line contains raw whitespace: %q", got)
63 }
64 if !strings.Contains(got, "prepare_error=fatal:_clone_failed_try_again_later") {
65 t.Fatalf("status line %q missing normalized prepare error", got)
66 }
67}
68
69func TestFormatStatusLineRedactsPrepareError(t *testing.T) {
70 st := model.RepoRuntimeState{PrepareError: "clone https://token@example.com/org/repo.git?access_token=secret failed"}
71
72 got := formatStatusLine(st)
73 if strings.Contains(got, "token@example.com") || strings.Contains(got, "secret") {
74 t.Fatalf("status line leaked prepare error credential: %q", got)
75 }
76 if !strings.Contains(got, "REDACTED") {

Callers

nothing calls this directly

Calls 1

formatStatusLineFunction · 0.85

Tested by

no test coverage detected