-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download release asset using api key no longer working #26165
Comments
Even more interestingly:
|
The download route was changed in #23891, but according to Lines 868 to 869 in 79995a8
the new route should also be available without sign in |
Thanks for your quick reply. Our repositories are private anyway, so we need some kind of signin to download the files. |
The Release Assets are technkijcaly Attachments. YOu can still download the Asset using the The I guess the easiest solution here is to add a new |
The uuid is given in the api response, so if I understand you correctly I should be able to get
Also note the error I get:
|
Okay, now this was interesing - the attachment road does actually work with the token, the "error"( So: downloading using the attachment path works with token and basic auth. For the newly nicer path basic auth works but token does not. I think the latter is inconsistent, but in the mean time, we can update our script to use the uuid method for a while. |
FYI: This bug was already discussed in #25257 |
Description
We are using the api to find out which releases exist for a specific repository. Until 1.19.3 we were able to download those assets as well when passing the api key in the header to the
browser_download_url
which is part of the listing athttps://git.fluves.net/api/swagger#/repository/repoGetReleaseByTag
This no longer works in 1.20.1 (not checked versions between 1.19.3 and 1.20.1).
The headers we pass are:
this works for the api, but no longer for the download. The URL given works if I use it from a browser where I logged in manually.
Gitea Version
1.20.1
Can you reproduce the bug on the Gitea demo site?
Yes:
Building an example at try.gitea.org
I generated a new token with read:package and read:repository rights.
c44ec64232370bc06c9f4aa8c2c67e0121ccc72b
(nothing valuable is in the repo, it is safe to share this).
eg if I go to:
https://try.gitea.io/api/v1/repos/johanvdw/bug26165/releases/
and then try to open
https://try.gitea.io/johanvdw/bug26165/releases/download/0.1/README.txt
response:
will give me a browser_download_url in assets, but I'm not able to use that to download the file.
similar results when specifying a token (the first variant was definitely working in 1.19).
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
docker.
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: