Skip to content

fix(frontend): preserve stored node TLS credentials on redacted edits - #510

Merged
athNdev merged 1 commit into
mainfrom
codex/node-settings-redaction
Nov 18, 2026
Merged

athNdev merged 1 commit into
mainfrom
codex/node-settings-redaction

Conversation

@athNdev

@athNdev athNdev commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What

Node read responses redact tls_ca_cert, tls_cert and tls_key (server side: PR509 / ADR 0018). The edit form copied those empty values back into UpdateNode, where a non-redaction-aware server interprets them as a clear and bumps EndpointGeneration, invalidating cached Docker pool clients.

This PR makes the frontend treat redacted/empty TLS material as unchanged: the secret fields are omitted from UpdateNode entirely on a non-secret edit, so stored credentials survive. An explicit Replace TLS credentials affordance reveals the three PEM fields, requires all of them (per-field errors + disabled Save + toast guard), and sends all three together for a genuine replacement. Cancel clears the intent and the staged values.

No new tokens, colors, or primitives: the affordance reuses the existing CarbonButton, existing palette literals and the current rpcClient.node.updateNode pattern; labels and aria-invalid/aria-describedby keep keyboard/a11y intact.

Form-seam tests

web/carbon-panel/src/lib/utils/node-tls-form.test.ts covers:

  • redacted-empty echo is omitted (no keys, not empty strings), including a non-empty placeholder echo — cannot clear credentials or bump generation;
  • genuine replacement submits all three trimmed fields together;
  • replacement validation requires every field; unchanged mode needs none;
  • component-level guard that the editor uses the seam instead of echoing redacted fields.

Verification

  • bun install --frozen-lockfile OK
  • bun run check — 0 errors, 0 warnings (both tsconfigs) OK
  • bun test — 284 pass, 0 fail (54 files) OK
  • bun run lint — Prettier + ESLint clean OK
  • go run ./cmd/knowledge-lint -root . — OK (one pre-existing unrelated invariant warning)

Scope / holds

  • Frontend only; does not touch PR509's server worktree. Merge requires the server redaction to land in the same or earlier integrated build.
  • No clear-credentials UI in this PR. PR509 defines a named ClearNodeTLSCredentials service action (nodes:update, target confirmation phrase, audit, generation bump), but the wire-exposed clear RPC is deliberately deferred until the proto work is gated. This PR therefore provides no fake or placeholder clear control; the only available credential action is the explicit Replace TLS credentials affordance, and the no-round-trip behavior is unchanged. The clear-affordance UI ships when the versioned clear RPC is available, coordinated with PR509 / ADR 0018.
  • Product merges are currently held by the :edge/Pages publication gate; this PR should stay open until the scoped opt-in lands. No merge requested here — independent review + CI required.

Head: 3e8faa4fe79af2543bc93a8989d3fa04810df9cf

Node read responses redact tls_ca_cert/tls_cert/tls_key (ADR 0018). The
edit form copied those empty values back into UpdateNode, which a non-redacted
server would treat as a clear and bump EndpointGeneration. Treat redacted/empty
TLS material as 'unchanged' and omit the secret fields from the request entirely.

Add an explicit 'Replace TLS credentials' affordance that reveals the three PEM
fields, requires all of them, and sends all three together. Add focused form-seam
tests for the redacted echo, genuine replacement, and validation states.
@athNdev
athNdev merged commit 6acc12e into main Nov 18, 2026
13 checks passed
@athNdev
athNdev deleted the codex/node-settings-redaction branch November 18, 2026 03:15
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.

1 participant