Per-host headers in py-rattler Client
Checklist
- [x] I added a descriptive title
- [x] I searched open requests and couldn't find a duplicate
What is the idea?
Middleware isn't fully exposed in the Python API, so using the default authentication middleware is your only option (netrc etc). If default headers were per-host, I think it would be a pretty easy way to do most basic custom authentication use cases without needing to build out the middleware API.
Why is this needed?
No response
What should happen?
No response
Additional Context
No response
That sounds essentially like what our authenication code on the rust side does. Maybe we should just expose that? Would that suffice?
I think so! I think I see which part you mean now--you can assign basic auth or a bearer token to a particular URL. That's all I would personally need.
Instead of netrc you can also use "pixi auth" and the recently added "rattler auth" subcommand. They all modify the default authentication storage.