Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

proposal: ability to provide credentials to download releases #190

Open
stuart-warren opened this issue Oct 7, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@stuart-warren
Copy link

gofish can install private rigs as it uses the hosts git configuration

however to download the release itself it just does a simple http get request

could we support netrc files or similar?

gitlab needs an authorization header like the following

curl --header "Authorization: Bearer ${GITLAB_TOKEN}" 
"https://somegitlab.com/stuart.warren/some-tool/-/releases/0.3.0/downloads/some-tool_0.3.0_darwin_amd64.tar.gz"

github needs something similar "Authorization: token ${GITHUB_API_TOKEN}"

perhaps we could set both?

@bacongobbler
Copy link
Contributor

I don't see why not. Feel free to contribute a patch.

@stuart-warren
Copy link
Author

Hmm, gitlab apparently only lets you download release source artifacts rather than uploaded binary artifacts, but credentials will still be useful.

I'm was originally thinking: make the request, if response is 401, use www-authenticate header to work out how to format the credentials from netrc, basic auth or just the password as a token

but github gives a 404 instead and gitlab (not that it works yet) 302s you to the login page so might be a bit messy...

so i guess try first request with basic auth if credentials exist with an 'accept: application/octet-stream' header, potentially handle things differently based on hostname patterns later

stuart-warren added a commit to stuart-warren/gofish that referenced this issue Oct 8, 2021
add basic auth credentials to request for food packages if
present in users netrc file

ref: fishworks#190
stuart-warren added a commit to stuart-warren/gofish that referenced this issue Oct 8, 2021
add basic auth credentials to request for food packages if present in users
netrc file

add 'Accept: application/octet-stream' header to permit working through [github
api](https://docs.github.com/en/rest/reference/repos#get-a-release-asset)

ref: fishworks#190
stuart-warren added a commit to stuart-warren/gofish that referenced this issue Oct 20, 2021
add basic auth credentials to request for food packages if present in users
netrc file

add 'Accept: application/octet-stream' header to permit working through [github
api](https://docs.github.com/en/rest/reference/repos#get-a-release-asset)

ref: fishworks#190
@bacongobbler bacongobbler added the enhancement New feature or request label Oct 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants