diff options
author | Greg Hale <imalsogreg@gmail.com> | 2020-06-17 15:08:59 -0400 |
---|---|---|
committer | Greg Hale <imalsogreg@gmail.com> | 2020-09-16 13:46:48 -0400 |
commit | a303c0b6dc71b1e0d6a57986c3f7a9b61361cd92 (patch) | |
tree | 1fe085d5c3d809b69600a4c883fb5ddcbfb09418 /src/libutil/types.hh | |
parent | 5080d4e7b2525d1656282c65a217a22ff8381df3 (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/libutil/types.hh')
-rw-r--r-- | src/libutil/types.hh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libutil/types.hh b/src/libutil/types.hh index 3af485fa0..55d02bcf9 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -24,6 +24,8 @@ typedef string Path; typedef list<Path> Paths; typedef set<Path> PathSet; +typedef vector<std::pair<string, string>> Headers; + /* Helper class to run code at startup. */ template<typename T> struct OnStartup |