snyk-policy
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -27,3 +27,4 @@ module.exports = filter; | ||
vulns.vulnerabilities, | ||
root | ||
root, | ||
policy.skipVerifyPatch ? true : false | ||
); | ||
@@ -30,0 +31,0 @@ |
@@ -10,3 +10,3 @@ module.exports = filterPatched; | ||
// cwd is used for testing | ||
function filterPatched(patched, vuln, cwd) { | ||
function filterPatched(patched, vuln, cwd, skipVerifyPatch) { | ||
if (!patched) { | ||
@@ -47,2 +47,6 @@ return vuln; | ||
// the target directory where our module name will live | ||
if (skipVerifyPatch) { | ||
return true; | ||
} | ||
var source = getVulnSource(vuln, cwd, true); | ||
@@ -49,0 +53,0 @@ |
@@ -30,2 +30,3 @@ var fs = require('then-fs'); | ||
policy.save = save.bind(null, policy); | ||
policy.toString = parse.export.bind(null, policy); | ||
policy.demunge = parse.demunge.bind(null, policy); | ||
@@ -32,0 +33,0 @@ return policy; |
module.exports = { | ||
import: imports, | ||
export: exports, | ||
demunge: demunge, | ||
demunge: require('./demunge'), | ||
}; | ||
@@ -52,35 +52,2 @@ | ||
return yaml.safeDump(data); | ||
} | ||
function demunge(policy, apiRoot) { | ||
if (!apiRoot) { | ||
apiRoot = ''; | ||
} | ||
var res = ['ignore', 'patch'].reduce(function (acc, type) { | ||
acc[type] = policy[type] ? Object.keys(policy[type]).map(function (id) { | ||
var paths = policy[type][id].map(function (pathObj) { | ||
var path = Object.keys(pathObj).pop(); | ||
var res = { | ||
path: path, | ||
}; | ||
if (type === 'ignore') { | ||
res.reason = pathObj[path].reason; | ||
res.expires = new Date(pathObj[path].expires); | ||
} | ||
return res; | ||
}); | ||
return { | ||
id: id, | ||
url: apiRoot + '/vuln/' + id, | ||
paths: paths, | ||
}; | ||
}) : []; | ||
return acc; | ||
}, {}); | ||
res.version = policy.version; | ||
return res; | ||
} |
@@ -42,3 +42,3 @@ { | ||
}, | ||
"version": "1.1.2" | ||
"version": "1.2.0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
609180
31
599