fix(variable): mask values by default (PLA-2368) - #274
Conversation
The create and list commands passed complete variable values directly to table and JSON printers. Keep full values only in the API update payload, show created keys without values, and require --show-values to reveal list output.
|
Review Council started (round 1). Baseline:
The council is reviewing this pull request; the verdict will follow as a separate comment when the round closes. |
|
CHANGES REQUESTED What This PR DoesPrevents the Zeabur CLI from printing plaintext variable values by default. How It Works
Findings
Finding Details🟡 F1:
|
There was a problem hiding this comment.
Council request_changes — 🔴0 🟡1 🟢3. Reviewed at 3548eec. Full report: #274 (comment)
The same audit found delete exposing full values in its selector and success table, while env echoed imported secrets in table and JSON output. Mask delete selections and report only affected keys after mutations.
|
Review Council started (round 2). Baseline:
The council is reviewing this pull request; the verdict will follow as a separate comment when the round closes. |
|
LGTM ✅ — F1 resolved; all variable commands now mask values by default with consistent key-only mutation output. Delta since 3548eec
Findings
Finding DetailsF1 (Resolved):
|
There was a problem hiding this comment.
Council approve — 🔴0 🟡0 🟢0. Reviewed at 94a2f66. Full report: #274 (comment)
Summary
variable create,delete, andenvmutation results from echoing full variable maps; report only affected keysvariable listtable and JSON output by default--show-valuesopt-in for callers that need plaintext list valuesvariable updateand make it Unicode-safeVerified scope
The original
create/listreport is reproducible againstdc6168a(v0.21.0, current npm latest) in both table and JSON paths. A full variable-command audit also found the same plaintext-output class indeleteandenv, so this PR closes those paths too. Full values remain available internally for API mutation payloads and, for list, only through explicit--show-values.Verification
go test ./...go test -race ./internal/cmd/variable/... -count=1golangci-lint run --new-from-rev=origin/main ./...go run ./cmd/main.go variable list --helpFull-repo lint still reports two pre-existing
preallocfindings ininternal/cmd/domain/create/create.goandpkg/selector/selector.go; the changed scope and new-from-main lint are clean.Fixes PLA-2368.