-
Notifications
You must be signed in to change notification settings - Fork 200
Description
Use case
We're working on support for private packages with igniter (not external repos, that will come later), and part of the workflow includes looking up package information using the API. The user might issue this command:
mix igniter.install my_org/package
We would then want to read the package information via the API, and find out what the latest, non-revoked, non-release-candidate version is (or just latest non-revoked if nothing meets that criteria), and provide a "good" pin for it, i.e "~> 3.5" in the users mix.exs.
Current Work
Our first attempt was to use Mix.State.fetch!(:repos), but after discussion with @ericmj it became clear that the auth_key we get from that is not correct/sufficient for reading packages via the API. This code is in main of igniter presently. It works, in fact, for explicitly provided versions like mix igniter.install org/[email protected], so all that is left for us to solve is:
- have them run
mix local.hexto update and get this new API. - get an api key for looking this info up (or tell the user to run
mix hex.user authand confirm they have access to the org