Repository navigation
feat(auth): Add netrc support for upstream authentication - #310
Conversation
06d5a1c to
65d9794
Compare
|
nice @aciceri it looks good! We should provide a command line flag |
|
Oh right, I didn't think about it. I'll add a After having done this I just update the README and the PR is ready? I saw that the NixOS module lives in nixpkgs (I may open a PR there too). Do we want to add a test? However the CI is failing for some reasons not due to my commit, perhaps missing secrets on external forks. |
It's not really necessary. None of my upstream caches needs a
That's correct, at that point make it ready for review and I will test it/review it before I merge it.
That's also correct but know that I won't merge the PR upstream until I release a new version of ncps, so make it a draft pr upstream and tag me. You don't need to add a test for this case as it's going to probably be difficult to do so.
Yes that's correct. You're the first PR to ncps from a fork and it seems to be failing. I will use your PR to fix it :) Thanks again for working on this @aciceri |
6c1c500 to
4b5cf3a
Compare
4b5cf3a to
b41a6ac
Compare
|
At the end I came up with this message: To me it's clear enough, honestly I would prefer knowing if the netrc is being used or not, it would help me a lot if for some reason I see that one of my authenticated cached doesn't seem to work. Otherwise the message is something like: The netrc file is parsed only once and then the credentials are injected into the various cache objects, I hope it's good as approach. |
kalbasit
left a comment
There was a problem hiding this comment.
Looking great so far, few comments to address. In the meantime I will work on fixing the tests!
|
@aciceri also no need to maintain a good commit history or force push since I will squash commit anyways so the commit history (although preserved in this PR) is lost on the main branch. |
|
@aciceri alright I fixed the tests in #316 and I merged main into your pr to test it. Although, fyi you have a legitimate failing test to fix, just a missed New() change |
|
As soon as you'll merge #315 I'll rebase onto |
|
Thank you, @aciceri this looks amazing! I pushed a nitpick to keep the flags ordered alphabetically but otherwise it's ready to merge. I will let GH do the honors. |
|
Thank you for this great piece of software! |
* origin/main: chore: Update nixpkgs and Go dependencies (#320) fix: Fix another flaky test (#319) feat(auth): Add netrc support for upstream authentication (#310) fix(CI): Do not run the docker-manifest if push is disabled (#318) fix(pkg/cache): Increase the wait time around asynchronous logic (#315) fix(CI): Do not attempt to access secrets for PRs from forks (#316) feat(Docker): Add /storage as Volume in the Docker image (#313) fix(Docker): Create /tmp in the Docker image (#312) feat(run): Accept extra arguments to ncps serve (#311) fix(GitHub): The Docker build on aarch64-linux (#308) chore(deps): update determinatesystems/nix-installer-action action to v20 (#306) fix(deps): update module golang.org/x/term to v0.35.0 (#304) fix(deps): update module github.com/xsam/otelsql to v0.40.0 (#303) fix(deps): update module golang.org/x/sync to v0.17.0 (#302) fix(deps): update module github.com/prometheus/client_golang to v1.23.2 (#300)
@kalbasit this is a proof of concept (the netrc path is still hardcoded) but seems to work. What do you think?
It works even if the netrc entry is without the
username, exactly as nix does.Since I'm not a go developer I got help form an LLM but I've double checked everything and it makes sense to me.
Assuming that you like what I did: how do you think that we should retrieve the netrc path? I see the following solutions:
nix show-config --json(or do we parse/etc/nix/nix.conf?) and use the netrc file specified thereCloses #307