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
fix(secrets): never send carried rename visibility for a known key
The render treated a stale carried entry as inert, but handleSave still
spread the raw map into the upsert payload — and since the PUT now
applies visibility to existing keys, that entry could flip a real key.
A rename-back let the next unrelated value save revert a confirmed
convert-to-secret, and a rename onto an existing secret could turn it
into a variable with no confirm dialog at all.
Render and save now read one narrowed derivation, restricted to keys the
server has no visibility for, so a carried value can only ever describe
the new name it was created for. Sharing the derivation is the point:
the last two defects were the two halves disagreeing.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/settings/components/secrets/components/secrets-manager/secrets-manager.tsx
+36-18Lines changed: 36 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -898,30 +898,47 @@ export function SecretsManager() {
898
898
* each section can take its own slice. Derived once rather than filtered twice
899
899
* so the two sections cannot disagree about which kind a key is.
900
900
*/
901
+
/**
902
+
* The carried rename visibility, narrowed to keys the server has no opinion
903
+
* about — the single source both the render and the save payload read.
904
+
*
905
+
* The narrowing is the safety property, not an optimization. A rename-back,
906
+
* or a rename onto a key that already exists, leaves an entry for a key that
907
+
* still has a credential; sending that in the save payload would flip a real
908
+
* key's disclosure. Since the PUT now applies visibility to existing keys,
909
+
* that could revert a confirmed convert-to-secret on the next unrelated value
910
+
* save, or turn an existing secret into a variable with no confirm dialog at
911
+
* all. Restricted to keys the server does not know, the carried value can
912
+
* only ever describe the new name it was created for.
0 commit comments