Skip to content

Redact admin passwords from default studio list JSON - #4730

Open
chubes4 wants to merge 1 commit into
trunkfrom
fix/4729-redact-list-json-secrets
Open

Redact admin passwords from default studio list JSON#4730
chubes4 wants to merge 1 commit into
trunkfrom
fix/4729-redact-list-json-secrets

Conversation

@chubes4

@chubes4 chubes4 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Closes #4729.

Summary

  • studio list --format=json no longer emits adminPassword, TLS material, or other secret fields on stdout.
  • Inventory JSON still includes site identity, path, status, runtime, version, and URL fields for automation.
  • studio status --format=json is audited the same way and no longer emits adminPassword.
  • Credential retrieval stays on the existing explicit single-site command: studio config get admin-password. Do not log that value.
  • Desktop/local IPC listSites() still receives the full record so GUI credential flows are unchanged.

Root cause

studio list --format=json serialized each site with ...site, so the entire stored site record — including encoded adminPassword and any extra secret fields — was dumped to stdout. Table output never showed passwords, so JSON had a surprising secret surface.

Verification

  • npx vitest run apps/cli/commands/site/tests/list.test.ts apps/cli/commands/site/tests/status.test.ts apps/cli/lib/tests/site-secret-fields.test.ts (19 passed)
  • npx eslint on the changed CLI files (no findings)
  • Contract tests assert list JSON contains no password/secret keys or values, while keeping non-secret inventory fields

AI assistance

OpenAI gpt-5.6-sol via OpenCode general coding subagent inspected the CLI list/status serializers, implemented the redaction, added contract tests, and opened this PR. Chris Huber directed the work and remains responsible for the change.

Keep inventory machine output non-secret and send credential retrieval through `studio config get admin-password`.
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 5273c82 vs trunk

app-size

Metric trunk 5273c82 Diff Change
App Size (Mac) 1422.63 MB 1422.63 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 5273c82 Diff Change
load 1200 ms 1223 ms +23 ms ⚪ 0.0%

site-startup

Metric trunk 5273c82 Diff Change
siteCreation 7523 ms 7520 ms 3 ms ⚪ 0.0%
siteStartup 3367 ms 3372 ms +5 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redact site admin passwords from Studio list JSON

2 participants