-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libstore: Add the ability to use different auth methods with Http Binary Caches #10584
base: master
Are you sure you want to change the base?
Conversation
@roberth Do you have any thoughts on this version of the PR? |
src/libstore/filetransfer.hh
Outdated
@@ -56,6 +56,8 @@ struct FileTransferRequest | |||
std::string expectedETag; | |||
bool verifyTLS = true; | |||
bool head = false; | |||
std::string authmethod; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an enum struct
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uploaded my attempt at this, however I don't write much C/C++ code.
I tried several different ways to make this a Setting<HttpAuthMethod>
using the templates for BaseSetting
, but I could not get this to work for a URL type parameters, and indeed none of the other url parameters are using enums.
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
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.