Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/check/auditChecker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { getResolution, RESOLUTIONS } = require('audit-resolve-core');

// TODO: get rules from the file via core (I'd have to check if they're properly exposed now)

module.exports = {
/**
Expand All @@ -13,6 +13,7 @@ module.exports = {
let unresolved = false;
item.resolutions = item.paths.map(path => {
const resolution = getResolution({ id: item.id, path })
// TODO: add a check: if the item is ignored and its severity is too high, return as unresolved anyway
if (resolution) {
if (resolution === RESOLUTIONS.FIX) {
// should have been fixed!
Expand Down
5 changes: 5 additions & 0 deletions src/resolve/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const pkgFacade = require('../pkgFacade')
// const investigate = require('../investigate');
const view = require('../views/decisions')
const { RESOLUTIONS, saveResolution } = require('audit-resolve-core')
// TODO: get rules from the file via core (I'd have to check if they're properly exposed now)

const ONE_WEEK_LATER = Date.now() + 7 * 24 * 60 * 60 * 1000
const TWO_WEEKS_LATER = Date.now() + 14 * 24 * 60 * 60 * 1000
const MONTH_LATER = Date.now() + 30 * 24 * 60 * 60 * 1000
Expand Down Expand Up @@ -30,12 +32,15 @@ const strategies = {
]
},
W: function ignoreWeek({ vuln }) {
// TODO: call a function verifying severity agains the rule, print a warning.
return saveResolution(getIdentifiers(vuln), { resolution: RESOLUTIONS.IGNORE, expiresAt: ONE_WEEK_LATER });
},
M: function ignoreMonth({ vuln }) {
// TODO: call a function verifying severity agains the rule, print a warning.
return saveResolution(getIdentifiers(vuln), { resolution: RESOLUTIONS.IGNORE, expiresAt: MONTH_LATER });
},
'!': function ignoreForever({ vuln }) {
// TODO: call a function verifying severity agains the rule, print a warning.
return saveResolution(getIdentifiers(vuln), { resolution: RESOLUTIONS.IGNORE, expiresAt: NEVER });
},
r: function remindLater({ vuln }) {
Expand Down