aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.hh
diff options
context:
space:
mode:
authorGreg Hale <imalsogreg@gmail.com>2020-06-17 15:08:59 -0400
committerGreg Hale <imalsogreg@gmail.com>2020-09-16 13:46:48 -0400
commita303c0b6dc71b1e0d6a57986c3f7a9b61361cd92 (patch)
tree1fe085d5c3d809b69600a4c883fb5ddcbfb09418 /src/libstore/globals.hh
parent5080d4e7b2525d1656282c65a217a22ff8381df3 (diff)
Fetch commits from github/gitlab using Auth header
`nix flake info` calls the github 'commits' API, which requires authorization when the repository is private. Currently this request fails with a 404. This commit adds an authorization header when calling the 'commits' API. It also changes the way that the 'tarball' API authenticates, moving the user's token from a query parameter into the Authorization header. The query parameter method is recently deprecated and will be disallowed in November 2020. Using them today triggers a warning email.
Diffstat (limited to 'src/libstore/globals.hh')
-rw-r--r--src/libstore/globals.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 02721285a..b2e7610ee 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -863,6 +863,9 @@ public:
Setting<std::string> githubAccessToken{this, "", "github-access-token",
"GitHub access token to get access to GitHub data through the GitHub API for `github:<..>` flakes."};
+ Setting<std::string> gitlabAccessToken{this, "", "gitlab-access-token",
+ "GitLab access token to get access to GitLab data through the GitLab API for gitlab:<..> flakes."};
+
Setting<Strings> experimentalFeatures{this, {}, "experimental-features",
"Experimental Nix features to enable."};