prefix-dev / rip

Solve and install Python packages quickly with rip (pip in Rust)

Home Page:https://prefix.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support authentication for `rip::index::PackageDb`

vlad-ivanov-name opened this issue · comments

To support custom/private pip registries (prefix-dev/pixi#588), PackageDb needs to support authentication.

I would propose the following API:

  1. create a trait that lives somewhere near PackageDb, e. g. ProvidesAuth
  2. the trait would include an authorize method (does it need to accept request body and headers? at least in case with google cloud it doesn't need to)
  3. let clients like pixi implement the trait and pass an instance of an object via Option<Box<dyn ProvidesAuth>>

I'm open to other suggestions and feedback on this

Im not sure what the authentication scheme looks like for pypi registries but we might be able to reuse AuthenticatedClient in rattler_networking for this.

Added "reqwest with middleware" client so this is now supported in API