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(secrets): add optional descriptions to workspace secrets (#6796)
* feat(secrets): add optional descriptions to workspace secrets
Workspace secrets already have a backing credential row with a description
column, but nothing surfaced it. Teammates had no way to record what a
secret is for.
- Add a Description field to the secret detail page, matching the
integrations credential page, gated on workspace-secret admin
- Fold the value and description editors into one Save/Discard pair and
one unsaved-changes guard; two guards cannot coexist, since each seeds
its own same-URL history entry
- Match descriptions in the secrets settings search
- Expose description on GET/PUT /api/v2/secrets and in the CLI
Descriptions are workspace-only: env_personal credential rows are
per-workspace mirrors of one user-global secret, so one saved there would
exist in a single workspace, and a personal secret has no teammates to
inform. The API rejects a description on personal scope rather than
silently dropping it, and omitting it on PUT leaves any existing
description untouched so a value rotation cannot erase it.
* fix(secrets): address review findings on secret descriptions
- Patch the credential detail cache optimistically on update. `onMutate`
cancelled the detail query but only patched the lists, so a detail-backed
editor stayed dirty after a successful save until the refetch landed —
long enough for Discard to restore the pre-save value over the committed
one, and for Back to open the unsaved-changes guard.
- Memoize `useSecretValue`'s returned callbacks and object, per the hook
convention, so the composed form's save/discard stop churning per render.
- Reject a description on a personal secret in the domain layer rather than
only at the v2 boundary. The internal credential update path accepted one
for any type, writing data every reader hides.
- Normalize an empty description to null so the API and UI agree.
- Correct the secrets documentation, which described a Display Name field
the detail view does not have and omitted the scope rule.
- Drop the CLI's copy of the 500-character bound; it can't import the
contract, so a copy only drifts from the message the API already returns.
- Collapse a redundant save guard and align the description write gate with
the render gate.
Leaves the integrations credential page byte-identical to staging.
* fix(secrets): keep the API docs example and CLI column order stable
Backward-compatibility fixes for anyone who never sets a description.
- Move the blank-to-null normalization out of the contract and into the
route. A Zod `.transform()` on any property drops the whole request
schema's OpenAPI examples, which had silently removed the Set Secret
request example from the published docs.
- Append the CLI `description` column instead of inserting it before
`updated`. `--output text` is positional, so inserting would shift every
field an existing script cuts.
- Reject a description on a personal secret with a message that says so,
rather than dropping the field and falling through to the generic
"no updatable fields" error.
|`--value <value>`| No | Secret value; visible to shell history when supplied directly. |
1790
+
|`--description <description>`| No | What the secret is for, shown to teammates; workspace scope only. Omit to leave an existing description unchanged. |
|`--value <value>`| No | Secret value; visible to shell history when supplied directly. |
83
+
|`--description <description>`| No | What the secret is for, shown to teammates; workspace scope only. Omit to leave an existing description unchanged. |
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/platform/credentials.mdx
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,14 +95,15 @@ Click **Details** on any secret row to open its detail view.
95
95
96
96
<Image
97
97
src="/static/secrets/secret-details.png"
98
-
alt="Secret details view showing Display Name, Description, and Members sections"
98
+
alt="Secret details view showing Key, Value, Description, and Members sections"
99
99
width={700}
100
100
height={400}
101
101
/>
102
102
103
103
From here you can:
104
104
105
-
- Edit the **Display Name** and **Description**
105
+
- View the **Key** and edit the **Value**
106
+
- Edit the **Description** — an optional note telling teammates what the secret is for. Workspace secrets only; a personal secret is not shared, so it has none
106
107
- Manage **Members** — invite teammates by email and assign them an **Admin** or **Member** role
107
108
108
109
Click **Save** to apply changes, or **Back** to return to the list.
Copy file name to clipboardExpand all lines: apps/docs/openapi-v2-resources.json
+26-1Lines changed: 26 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5052,6 +5052,17 @@
5052
5052
"enum": ["workspace", "personal"],
5053
5053
"description": "Whether the secret belongs to the workspace or to the caller. A personal secret belongs to the caller across every workspace, not to one workspace."
5054
5054
},
5055
+
"description": {
5056
+
"anyOf": [
5057
+
{
5058
+
"type": "string"
5059
+
},
5060
+
{
5061
+
"type": "null"
5062
+
}
5063
+
],
5064
+
"description": "What the secret is for, as set on the workspace secret. Always null for a personal secret, which has no shared audience."
5065
+
},
5055
5066
"role": {
5056
5067
"type": "string",
5057
5068
"enum": ["admin", "member"],
@@ -5070,7 +5081,7 @@
5070
5081
"description": "ISO 8601 timestamp when the secret was last updated."
"description": "Write-only secret value. It is never returned.",
5162
5175
"writeOnly": true
5176
+
},
5177
+
"description": {
5178
+
"description": "What the secret is for, shown to teammates. Workspace scope only — sending it for a personal secret is rejected. Omit it to leave an existing description untouched; send null or an empty string to clear one.",
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/settings/components/secrets/components/secrets-manager/secrets-manager.tsx
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -419,12 +419,21 @@ export function SecretsManager() {
0 commit comments