Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hardcoded URL to advisory with a URL from audit response #110

Closed
wants to merge 1 commit into from

Conversation

melkikh
Copy link

@melkikh melkikh commented Dec 6, 2018

By this PR, we can see a correct advisory URL in the "More info" field.

@melkikh melkikh requested a review from a team as a code owner December 6, 2018 08:31
@@ -117,7 +117,7 @@ const report = function (data, options) {
{'Package': advisory.module_name},
{'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`},
{'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`},
{'More info': `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical, but shorter and avoids repetition:

Suggested change
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`}

@@ -160,7 +160,7 @@ const report = function (data, options) {
{'Patched in': patchedIn},
{'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`},
{'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`},
{'More info': `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{'More info': advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`}
{'More info': advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`}

@@ -30,7 +30,7 @@ const report = function (data, options) {
l.sevLevel = advisory.severity
l.severity = advisory.title
l.package = advisory.module_name
l.moreInfo = `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`

@@ -44,7 +44,7 @@ const report = function (data, options) {
l.sevLevel = advisory.severity
l.severity = advisory.title
l.package = advisory.module_name
l.moreInfo = `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
l.moreInfo = advisory.url ? advisory.url : `https://nodesecurity.io/advisories/${advisory.id}`
l.moreInfo = advisory.url || `https://nodesecurity.io/advisories/${advisory.id}`

@zkat
Copy link
Contributor

zkat commented Dec 6, 2018

Please PR this against npm-audit-report, and include the changes suggested by @ljharb.

@zkat zkat closed this Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants