Skip to content

Commit

Permalink
Emit login token in netrc file even though it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
centromere committed Jul 13, 2022
1 parent 63c2b24 commit 1b115e3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion cachix/src/Cachix/Client/NetRc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ add cachixAuthToken binarycaches filename = do
mkHost bc =
NetRcHost
{ nrhName = toS $ stripPrefix "http://" $ stripPrefix "https://" (BinaryCache.uri bc),
nrhLogin = "",
-- Workaround for bug in libcurl where netrc is not respected
-- in the absence of the login token.
nrhLogin = "\"\"",
nrhPassword = getToken cachixAuthToken,
nrhAccount = "",
nrhMacros = []
Expand Down
2 changes: 1 addition & 1 deletion cachix/test/data/add.input
Original file line number Diff line number Diff line change
@@ -1 +1 @@
machine name.cachix.org password token123
machine name.cachix.org login "" password token123
4 changes: 2 additions & 2 deletions cachix/test/data/add.output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
machine name2.cachix.org password token123
machine name2.cachix.org login "" password token123

machine name.cachix.org password token123
machine name.cachix.org login "" password token123
4 changes: 2 additions & 2 deletions cachix/test/data/empty.output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
machine name.cachix.org password token123
machine name.cachix.org login "" password token123

machine name2.cachix.org password token123
machine name2.cachix.org login "" password token123
4 changes: 2 additions & 2 deletions cachix/test/data/override.input
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
machine name.cachix.org password token123
machine name.cachix.org login "" password token123

machine name2.cachix.org password abc123
machine name2.cachix.org login "" password abc123
4 changes: 2 additions & 2 deletions cachix/test/data/override.output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
machine name2.cachix.org password token123
machine name2.cachix.org login "" password token123

machine name.cachix.org password token123
machine name.cachix.org login "" password token123

0 comments on commit 1b115e3

Please sign in to comment.