libstore: Add the ability to use different auth methods with Http Binary Caches#10584
libstore: Add the ability to use different auth methods with Http Binary Caches#10584georgyo wants to merge 2 commits intoNixOS:masterfrom
Conversation
|
@roberth Do you have any thoughts on this version of the PR? |
9943f90 to
8c2b15c
Compare
|
Discussed in Nix maintainer meeting:
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-06-24-nix-team-meeting-minutes-155/47739/1 |
|
An alternative approach to choosing the exact curl auth method would be to set to This is how Git behaves when talking to an HTTP repo and allows it to handle both Basic Auth and things like Negotiate. The downside to that approach is if the server advertise negotiation there is no way to force git to use basic. Setting |
1e5d8f0 to
41fd519
Compare
roberth
left a comment
There was a problem hiding this comment.
Exposing existing curl functionality seems sensible to me, without the added complexity of #9857
I've taken the liberty to push a commit with a partial test. iirc @georgyo had some suggestions to make it cover more of their use case. Something WebDAV related, and maybe more (didn't manage to write that down, sorry)
| curl_easy_setopt(req, CURLOPT_USERNAME, ""); | ||
| curl_easy_setopt(req, CURLOPT_PASSWORD, ""); |
There was a problem hiding this comment.
| curl_easy_setopt(req, CURLOPT_USERNAME, ""); | |
| curl_easy_setopt(req, CURLOPT_PASSWORD, ""); | |
| // Initialize the auth stack. It needs to have a username, password to trigger that. Otherwise kerberos isn't going to work. | |
| curl_easy_setopt(req, CURLOPT_USERNAME, ""); | |
| curl_easy_setopt(req, CURLOPT_PASSWORD, ""); |
| // Our writeCallbackWrapper does not support rewinding which breaks | ||
| // negotiate/kerberos auth over http/2. |
There was a problem hiding this comment.
| // Our writeCallbackWrapper does not support rewinding which breaks | |
| // negotiate/kerberos auth over http/2. | |
| // Our writeCallbackWrapper does not support rewinding which breaks | |
| // negotiate/kerberos auth over http/2. | |
| // Curl would need to retry a request, after consuming part of our stream, and we currently don't have | |
| // a way to recover that initial already consumed part. |
Motivation
Right now the only auth methods allowed with http caches was the default basic auth method. This meant if you wanted to have any other mechanism for authentication you requiring patching the code.
My personal motivation is enabling
?authmethod=negotiate.Context
This PR is very similar to #10568 but made to be generic and support as many methods from libcurl as we can reasonably support.
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.