Pluggable authentication #558
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#558
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need to have pluggable authentication. It should be extensible, and it should work for builds, so that it's possible to fetch resources from private registries.
There is an upstream PR that implements this already, but it is a very complex approach. It extends the client<->daemon communication to relegate authentication (and so, the control flow) to the client when needed. It requires a protocol version bump. While it addresses the primary usecase, it also sets us on the part of having to vendor every auth scheme on Earth in the Nix daemon and CLI implementations.
A better approach seems to be client-side building. It seems to play nicely with already existing derivation attributes like
preferLocalBuild = true
andallowSubstitutes = false
. It also seems to be a nicer abstraction for no-daemon/daemon modes of working.Related Issues
#272 - AWS auth is hell. For that reason, we bundle aws-sdk-cpp, which explodes build times and harms LTO. If we can have pluggable authentication - we can nuke all of it, and happily let the user do any kind of auth they want however they want (such as with AWS CLI or
aws-vault
)#254 - netrc is kind of a gross hack. We might be able to pretty much nuke it from code without even breaking compat
CppNix PR #10567 - we don't yet support git remote helpers, because we vendor fetching so heavily. A major usecase for them is specific, sometimes very esoteric, authentication; solving authentication is necessary for this support
impossible without protocol rewrite. postponed until that happens.
Would porting
configurable-impure-env
from Nix 2.19 be a reasonable short-term solution? It would allow passing impure env variables to FOD builders for trusted users, so we'd no longer need secrets in plain text on the filesystem.Obviously passing secrets to all FODs is not ideal and client-side building would be preferable, but I feel like this could be a quick win meanwhile.
Example use:
^ You can then
alias
this and use when necessary.Yes, in principle. It doesn't look too evil, it does not require protocol changes to implement, it contains almost no code, and does not seem like it should have any weird interactions with other features. It is gated behind an experimental feature; I do wonder why that is, and the gh milestone gives no such indication: https://github.com/NixOS/nix/milestone/37.
Yeah, not sure why. I've been using it for a few weeks testing the nixpkgs Nix 2.24 bump and got pretty excited to be able to get rid of all filesystem credentials.
trusted-users
: https://github.com/NixOS/nix/issues/10472It probably wouldn't need
trusted-users
if the daemon had to opt into which variables clients can pass to it. So you can't just override daemon's own impure vars likeHTTP_PROXY
or something.