1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Remove credential props after diffing flow to prevent future false positives

Fixes #1359
This commit is contained in:
Nick O'Leary 2018-04-16 15:36:23 +01:00
parent 52d9578a19
commit 27fdc9e56e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -127,6 +127,15 @@ function setFlows(_config,type,muteLog,forceStart) {
config = clone(_config);
newFlowConfig = flowUtil.parseConfig(clone(config));
diff = flowUtil.diffConfigs(activeFlowConfig,newFlowConfig);
// Now the flows have been compared, remove any credentials from newFlowConfig
// so they don't cause false-positive diffs the next time a flow is deployed
for (var id in newFlowConfig.allNodes) {
if (newFlowConfig.allNodes.hasOwnProperty(id)) {
delete newFlowConfig.allNodes[id].credentials;
}
}
credentials.clean(config);
var credsDirty = credentials.dirty();
configSavePromise = credentials.export().then(function(creds) {