mirror of
https://github.com/node-red/node-red
synced 2024-11-23 17:23:56 +00:00
Apply envVarExcludes
setting to RED.util.getSetting
into the function node
This commit is contained in:
parent
c363f375b6
commit
7555e0644f
@ -111,8 +111,6 @@ module.exports = function(RED) {
|
||||
throw new Error(RED._("function.error.externalModuleNotAllowed"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
var functionText = "var results = null;"+
|
||||
"results = (async function(msg,__send__,__done__){ "+
|
||||
"var __msgid__ = msg._msgid;"+
|
||||
@ -160,13 +158,26 @@ module.exports = function(RED) {
|
||||
node.outstandingIntervals = [];
|
||||
node.clearStatus = false;
|
||||
|
||||
const envVarExcludes = {};
|
||||
if (RED.settings.envVarExcludes && Array.isArray(RED.settings.envVarExcludes)) {
|
||||
RED.settings.envVarExcludes.forEach((e) => envVarExcludes[e] = true);
|
||||
}
|
||||
|
||||
var sandbox = {
|
||||
console:console,
|
||||
util:util,
|
||||
Buffer:Buffer,
|
||||
Date: Date,
|
||||
RED: {
|
||||
util: RED.util
|
||||
util: {
|
||||
...RED.util,
|
||||
getSetting: function (node, name, flow) {
|
||||
if (envVarExcludes[name]) {
|
||||
return undefined;
|
||||
}
|
||||
return RED.util.getSetting(node, name, flow);
|
||||
}
|
||||
}
|
||||
},
|
||||
__node__: {
|
||||
id: node.id,
|
||||
|
Loading…
Reference in New Issue
Block a user