refs: #2 nodesecurity.io redirect and mozilla/fxa-profile-server#353 and related discussion on #fxa on IRC (job https://travis-ci.org/mozilla/fxa-profile-server/jobs/457024645).
Exit codes and filter matching would be unchanged, but when similar looking URLs show up in the audit JSON output we write to stderr something like:
"found the url 'https://www.npmjs.com/advisories/598' on .nsmprc line X did you mean 'https://npmjs.com/advisories/598' to match line Y from the audit JSON output?"
and suggest that they check both URLs resolve to the same advisory.
We can define "similar looking URLs" to 1) contain the same advisory ID and 2) have one of more of the following be true:
- domain differs between
nodesecurity.io and npmjs.com
- protocol differs between
http and https (also probably want to warn for http)
- an optional
www subdomain e.g. from npmjs.com/advisories/ and www.npmjs.com/advisories/
Unit tests would check that we make suggestions for:
https://nodesecurity.io/advisories/598 and https://npmjs.com/advisories/598
http://nodesecurity.io/advisories/598 vs https://nodesecurity.io/advisories/598
https://npmjs.com/advisories/598 and https://www.npmjs.com/advisories/598
and no suggestion for other URLs.
refs: #2 nodesecurity.io redirect and mozilla/fxa-profile-server#353 and related discussion on #fxa on IRC (job https://travis-ci.org/mozilla/fxa-profile-server/jobs/457024645).
Exit codes and filter matching would be unchanged, but when similar looking URLs show up in the audit JSON output we write to stderr something like:
and suggest that they check both URLs resolve to the same advisory.
We can define "similar looking URLs" to 1) contain the same advisory ID and 2) have one of more of the following be true:
nodesecurity.ioandnpmjs.comhttpandhttps(also probably want to warn for http)wwwsubdomain e.g. fromnpmjs.com/advisories/andwww.npmjs.com/advisories/Unit tests would check that we make suggestions for:
https://nodesecurity.io/advisories/598andhttps://npmjs.com/advisories/598http://nodesecurity.io/advisories/598vshttps://nodesecurity.io/advisories/598https://npmjs.com/advisories/598andhttps://www.npmjs.com/advisories/598and no suggestion for other URLs.