prefix-dev / rip

Solve and install Python packages quickly with rip (pip in Rust)
https://prefix.dev
BSD 3-Clause "New" or "Revised" License
655 stars 23 forks source link

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

Closed vlad-ivanov-name closed 8 months ago

vlad-ivanov-name commented 10 months ago

To support custom/private pip registries (https://github.com/prefix-dev/pixi/issues/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

baszalmstra commented 10 months ago

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.

vlad-ivanov-name commented 8 months ago

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