-
-
Notifications
You must be signed in to change notification settings - Fork 61
Description
What is the current behavior?
Currently, authentication for external python packages discovered by uv is not supported.
Describe the feature
We should allow users to depend on packages that require authentication. These packages live on private registries, typically behind some kind of HTTP authentication - either using Basic auth or a Bearer token.
There are two main operations to authenticate: resolution, and archive fetching. Because resolution is entirely delegated to uv, and it contains a pretty robust credential management and authentication system, I propose we let the rules_py rely on the user configuring uv correctly, and then extracting necessary credentials from it at analysis time.
This would allow us to support not only static, long-lived credentials, but also passwords & tokens managed in the user's keyring, as well as short-lived JWTs used in services like pyx and Artifactory.
The way this could work at a high level is by:
- assuming the user has uv configured as normal according to the uv docs
- having the user declare their authenticated services via a new
authenticatemodule tag - at analysis time
rules_pywould runuv auth token $servicefor each configured service to extract (potentially short-lived) credentials - these credentials would get passed down to the relevant
http_filetargets
If that all sounds good, I can take a stab at the implementation.