rattler icon indicating copy to clipboard operation
rattler copied to clipboard

Per-host headers in py-rattler Client

Open calebzulawski opened this issue 3 months ago • 3 comments

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

calebzulawski avatar Sep 18 '25 17:09 calebzulawski

That sounds essentially like what our authenication code on the rust side does. Maybe we should just expose that? Would that suffice?

baszalmstra avatar Sep 18 '25 17:09 baszalmstra

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.

calebzulawski avatar Sep 18 '25 17:09 calebzulawski

Instead of netrc you can also use "pixi auth" and the recently added "rattler auth" subcommand. They all modify the default authentication storage.

baszalmstra avatar Sep 18 '25 18:09 baszalmstra