aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/fetchers.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/libfetchers/fetchers.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/libfetchers/fetchers.hh')
-rw-r--r--src/libfetchers/fetchers.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh
index 89b1e6e7d..62807e53b 100644
--- a/src/libfetchers/fetchers.hh
+++ b/src/libfetchers/fetchers.hh
@@ -118,12 +118,14 @@ struct DownloadFileResult
DownloadFileResult downloadFile(
ref<Store> store,
const std::string & url,
+ const Headers & headers,
const std::string & name,
bool immutable);
std::pair<Tree, time_t> downloadTarball(
ref<Store> store,
const std::string & url,
+ const Headers & headers,
const std::string & name,
bool immutable);