mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +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
|
* @memberof WorkflowDataGetter
|
||||||
*/
|
*/
|
||||||
private envGetter() {
|
private envGetter() {
|
||||||
|
const that = this;
|
||||||
return new Proxy(
|
return new Proxy(
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
get(target, name, receiver) {
|
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()];
|
return process.env[name.toString()];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user