mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Make it possible to block access to environment variables
This commit is contained in:
@@ -424,10 +424,20 @@ export class WorkflowDataProxy {
|
||||
* @memberof WorkflowDataGetter
|
||||
*/
|
||||
private envGetter() {
|
||||
const that = this;
|
||||
return new Proxy(
|
||||
{},
|
||||
{
|
||||
get(target, name, receiver) {
|
||||
if (process.env.N8N_BLOCK_ENV_ACCESS_IN_NODE === 'true') {
|
||||
throw new ExpressionError('Environment variable access got disabled', {
|
||||
causeDetailed:
|
||||
'If you need access please contact the administrator to remove the environment variable ‘N8N_BLOCK_ENV_ACCESS_IN_NODE‘',
|
||||
runIndex: that.runIndex,
|
||||
itemIndex: that.itemIndex,
|
||||
failExecution: true,
|
||||
});
|
||||
}
|
||||
return process.env[name.toString()];
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user