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

Switch to Accept: application/json when downloading crates #6639

Open
alexcrichton opened this issue Feb 6, 2019 · 5 comments
Open

Switch to Accept: application/json when downloading crates #6639

alexcrichton opened this issue Feb 6, 2019 · 5 comments
Labels
A-interacts-with-crates.io Area: interaction with registries A-registries Area: registries S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

Comments

@alexcrichton
Copy link
Member

Currently we fetch a url on crates.io which redirects us to S3, but crates.io has a feature where if you specify Accept: application/json we'll get a JSON blob with the url instead. We should switch Cargo to this interface so we can learn auxiliary information in the future if necessary, and we still know how to get the final crate!

@alexcrichton alexcrichton added the A-interacts-with-crates.io Area: interaction with registries label Feb 6, 2019
@ehuss
Copy link
Contributor

ehuss commented Feb 6, 2019

What extra information might it learn or display?

@alexcrichton
Copy link
Member Author

We discussed this with some crates.io folks briefly today and @sgrif mentioned that one possible use is to send auxiliary information about things like yank reasons, although this'd largely be future proofing moreso than anything else I think. @sgrif or other crates.io folks may have more to fill in though!

@sgrif
Copy link
Contributor

sgrif commented Feb 6, 2019

Can confirm this is mostly future proofing. The way we'd be most likely to use this in the near future is to provide information about insecure dependencies

@epage epage added A-registries Area: registries S-triage Status: This issue is waiting on initial triage. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. and removed S-triage Status: This issue is waiting on initial triage. labels Oct 31, 2023
@epage
Copy link
Contributor

epage commented Oct 31, 2023

Would there be any compatibility issues with alternative registries?

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 31, 2023

For backwards compatibility cargo would have to be robust to receiving any of:

  • the actual crate
  • the json data with a url
  • a redirect to either of the previous

As long as cargo accepts whatever response it gets for the request, and we document the JSON structures it should work. Although whether it's still the best way to get this data into cargo 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interacts-with-crates.io Area: interaction with registries A-registries Area: registries S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
Projects
None yet
Development

No branches or pull requests

5 participants