Repository navigation
fix(frontend): preserve stored node TLS credentials on redacted edits - #510
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Node read responses redact
tls_ca_cert,tls_certandtls_key(server side: PR509 / ADR 0018). The edit form copied those empty values back intoUpdateNode, where a non-redaction-aware server interprets them as a clear and bumpsEndpointGeneration, invalidating cached Docker pool clients.This PR makes the frontend treat redacted/empty TLS material as unchanged: the secret fields are omitted from
UpdateNodeentirely 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 currentrpcClient.node.updateNodepattern; labels andaria-invalid/aria-describedbykeep keyboard/a11y intact.Form-seam tests
web/carbon-panel/src/lib/utils/node-tls-form.test.tscovers:Verification
bun install --frozen-lockfileOKbun run check— 0 errors, 0 warnings (both tsconfigs) OKbun test— 284 pass, 0 fail (54 files) OKbun run lint— Prettier + ESLint clean OKgo run ./cmd/knowledge-lint -root .— OK (one pre-existing unrelated invariant warning)Scope / holds
ClearNodeTLSCredentialsservice 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.: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