mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
feat(core): Make it possible to block access to environment variables
This commit is contained in:
parent
a18081d749
commit
ddb3baa4ed
|
@ -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()];
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue