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

Refactor npm audit producer #55

Open
ptzianos opened this issue Jan 18, 2024 · 1 comment
Open

Refactor npm audit producer #55

ptzianos opened this issue Jan 18, 2024 · 1 comment
Assignees
Labels
priority: need Something that needs to be done. type: fix Iterations on existing features or infrastructure.

Comments

@ptzianos
Copy link
Contributor

Issue

When the npm audit producer was written, advisories would be hosted by NPM itself. The reports produced by the npm audit command would include links that would point to an NPM page with the advisory. However, that is no longer the case. The reports now include links that point to Github hosted advisories and the Github API is quite different than the NPM one. The NPM links can still be used, but they will immediately redirect to the Github Advisory page. Furthermore, the response generated by NPM to a request for the JSON document of the advisory isn't, some 301 response, but instead it's a 200 page with the text Redirecting in the body, a header saying that the response is JSON and the location header set to the Github advisory page. The npm audit producer needs to be refactored to be able to fetch the Github Advisories.

Expected behaviour

The npm audit report should be parsed correctly and advisories should be fetched without issues from Github

Actual behaviour

Advisory fetching fails

Steps to reproduce

Run the producer for any report

@ptzianos ptzianos self-assigned this Jan 18, 2024
@ptzianos ptzianos added priority: need Something that needs to be done. type: fix Iterations on existing features or infrastructure. Bug labels Feb 5, 2024
Copy link

linear bot commented Feb 5, 2024

@ptzianos ptzianos added the Improvement label Feb 5, 2024 — with Linear
@settings settings bot removed Bug labels Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: need Something that needs to be done. type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant