You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(macos): display + edit headers and env on server detail
Adds full round-trip support for headers and env on the macOS tray's
server detail screen, matching the new Web UI experience.
API model:
- ServerStatus gains `headers` and `env` (both [String: String]?).
CodingKeys updated to map the JSON `headers` and `env` fields the Go
backend now emits (companion to the runtime + management wiring in
the parent commit).
View:
- Headers section under Connection for HTTP / streamable-http servers,
visible in both view mode (sorted key list with masked values) and
edit mode (KEY=VALUE textarea, parallel to the existing env textarea).
- editEnvVars now pre-populates from `server.env` instead of starting
empty — fixes the long-standing stub at L939 that explicitly noted
the missing config API.
- editHeaders works the same way for headers.
- saveEdits() sends both maps unconditionally so deletes round-trip;
refuses to save if any header value is still `***REDACTED***` (the
backend sentinel emitted when `reveal_secret_headers: false`) so we
don't silently overwrite a real secret with the placeholder.
- New helpers: parseKVTextarea (shared between env and headers) and
maskedHeaderValue (recognises `${keyring:...}` and `${env:...}`
references and renders them as-is, masks literal values, surfaces the
redaction sentinel verbatim so users know to flip
reveal_secret_headers in their config).
Convert-to-secret in Swift: deferred. The Web UI surfaces this per row
through KVValueCell; the equivalent SwiftUI experience would need a new
modal + state machine that doesn't fit the existing textarea-based
edit form. Tracked as a follow-up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
// Parse env vars. The textarea is the user's authoritative copy on
1023
+
// save — sending an empty map clears all env vars on the backend
1024
+
// (matches the existing add-server flow). We pass it through
1025
+
// unconditionally so deletes round-trip.
1026
+
updates["env"]=parseKVTextarea(editEnvVars)
1027
+
1028
+
// Parse headers (HTTP / streamable-http only). Same all-or-nothing
1029
+
// semantics as env: we always send the parsed map so deletes
1030
+
// propagate. The backend handler treats `headers: {}` as "clear",
1031
+
// not "ignore".
1032
+
if server.protocol =="http" || server.protocol =="sse" || server.protocol =="streamable-http"{
1033
+
letheaders=parseKVTextarea(editHeaders)
1034
+
// Refuse to save a literal `***REDACTED***` value — that
1035
+
// sentinel means the backend never sent us the real value
1036
+
// (reveal_secret_headers is off), so persisting it would
1037
+
// silently overwrite a real header with the redaction string.
1038
+
// Users editing redacted headers must either change the value
1039
+
// or enable reveal_secret_headers in their config first.
1040
+
if headers.values.contains("***REDACTED***"){
1041
+
editError ="Some header values are redacted (`***REDACTED***`). Set `reveal_secret_headers: true` in your config to view + edit them, or replace those values with new ones before saving."
0 commit comments