Inject none secret env variables into front components (#20511)

## Summary
- Inject non-secret application variables (`isSecret: false`) into front
component `process.env` via the existing Web Worker `setWorkerEnv`
mechanism
- Filter secret variables server-side in the resolver so they never
reach the browser
- Set application variables before system variables (`TWENTY_API_URL`,
`TWENTY_APP_ACCESS_TOKEN`) to prevent override
- Wire up environment variable keys in the logic function code editor
for TypeScript autocomplete

  ## Test plan
  - [x] Unit tests for `buildNonSecretEnvVar` (6 passing)
  - [x] Typecheck passes for `twenty-front` and `twenty-server`
- [x] Install an app with both `isSecret: false` and `isSecret: true`
variables, open a front component, verify only non-secret vars appear in
`process.env`
- [x] Open a logic function editor, verify autocomplete suggests
declared variable keys
This commit is contained in:
martmull
2026-05-13 18:27:56 +02:00
committed by GitHub
parent 59b993bdb3
commit dea1f89904
25 changed files with 263 additions and 11 deletions
@@ -110,6 +110,14 @@ export class WorkspaceMigrationRunnerService {
);
}
if (flatMapsKeysSet.has('flatApplicationVariableMaps')) {
asyncOperations.push(
this.workspaceCacheService.invalidateAndRecompute(workspaceId, [
'applicationVariableMaps',
]),
);
}
return asyncOperations;
}