Skip to content

Commit 2e771db

Browse files
committed
fix(secrets): show a renamed variable as a variable before save
The rename carried visibility into the save payload but not into the render, which still resolved disclosure from server state only. The new name has no server visibility yet, so the row defaulted to secret: it jumped into Workspace secrets and bullet-masked a value the member can plainly read, until save landed.
1 parent 40c5188 commit 2e771db

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/settings/components/secrets/components/secrets-manager

apps/sim/app/workspace/[workspaceId]/settings/components/secrets/components/secrets-manager/secrets-manager.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,19 @@ export function SecretsManager() {
904904
return entries.map(([key, value]) => ({
905905
key,
906906
value,
907-
visibility: visibilityMap[key] ?? ('secret' as EnvVisibility),
907+
// A pending rename is checked FIRST: the new name has no server-side
908+
// visibility yet, so falling straight through to `visibilityMap` would
909+
// default it to `secret` — bouncing the row into Workspace secrets and
910+
// bullet-masking a value the member can plainly read, until save lands.
911+
visibility: renamedKeyVisibility[key] ?? visibilityMap[key] ?? ('secret' as EnvVisibility),
908912
}))
909-
}, [searchTerm, filteredWorkspaceEntries, workspaceVars, workspaceEnvData?.visibility])
913+
}, [
914+
searchTerm,
915+
filteredWorkspaceEntries,
916+
workspaceVars,
917+
workspaceEnvData?.visibility,
918+
renamedKeyVisibility,
919+
])
910920

911921
/**
912922
* Renders one workspace section. Both sections share the row component and

0 commit comments

Comments
 (0)