()
| 226 | * dangerous environment variables such as LD_PRELOAD, PATH, etc. |
| 227 | */ |
| 228 | export function applyConfigEnvironmentVariables(): void { |
| 229 | Object.assign(process.env, filterSettingsEnv(getGlobalConfig().env)) |
| 230 | |
| 231 | for (const source of SETTINGS_ENV_APPLICATION_ORDER) { |
| 232 | if (source !== 'flagSettings' && source !== 'policySettings') { |
| 233 | if (!isSettingSourceEnabled(source)) continue |
| 234 | } |
| 235 | Object.assign( |
| 236 | process.env, |
| 237 | filterSettingsEnv(getSettingsForSource(source)?.env, source), |
| 238 | ) |
| 239 | } |
| 240 | |
| 241 | // Clear caches so agents are rebuilt with the new env vars |
| 242 | clearCACertsCache() |
| 243 | clearMTLSCache() |
| 244 | clearProxyCache() |
| 245 | |
| 246 | // Reconfigure proxy/mTLS agents to pick up any proxy env vars from settings |
| 247 | configureGlobalAgents() |
| 248 | } |
no test coverage detected