Skip to content

Commit a8ec4a7

Browse files
waleedlatif1claude
andcommitted
chore: condense env route security comments
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 18e88aa commit a8ec4a7

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

apps/sim/app/api/workspaces/[id]/environment/route.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ describe('GET /api/workspaces/[id]/environment', () => {
7171

7272
const body = await res.json()
7373
expect(body.data.workspace).toEqual({ OPENAI_API_KEY: '', DATABASE_URL: '' })
74-
// Plaintext workspace secrets must never reach non-admins.
7574
expect(JSON.stringify(body.data.workspace)).not.toContain('sk-live-secret-value')
7675
expect(JSON.stringify(body.data.workspace)).not.toContain('postgres://')
77-
// The caller's own personal values are still returned.
7876
expect(body.data.personal).toEqual(ENV_RESULT.personalDecrypted)
7977
}
8078
)

apps/sim/app/api/workspaces/[id]/environment/route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ export const GET = withRouteHandler(
5656
const { workspaceEncrypted, workspaceDecrypted, personalDecrypted, conflicts } =
5757
await getPersonalAndWorkspaceEnv(userId, workspaceId)
5858

59-
// Plaintext workspace secrets are restricted to workspace admins. Non-admins receive only
60-
// the variable names (with empty values) so env references can still be validated and
61-
// highlighted in the editor without exposing the decrypted secret values.
59+
// Only workspace admins may read plaintext secrets; others get variable names with empty values.
6260
const workspace =
6361
permission === 'admin'
6462
? workspaceDecrypted

0 commit comments

Comments
 (0)