-
-
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
Subscription API Routes Broken #28756
Comments
It looks like the curl -X 'GET' \
'https://try.gitea.io/api/v1/repos/kdumontnu/template/subscription' \
-H 'accept: application/json' \
-H 'Authorization: token ---' Edit: requiring a token for the |
I just used the swagger UI for the API. If that doesn't work then maybe there's another bug. |
So, once I fix the token header (thanks!), and I try to watch/unwatch a repo that I have access to, but I don't own, I get a 404. The problem, as I see it, is that this route is a repo route when it should be a user route.
|
Fixes #28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
Fixes go-gitea#28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
Backport #28765 by @jackHay22 Fixes #28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`. Co-authored-by: Jack Hay <jack@allspice.io>
@kdumontnu I haven't been able to recreate this 404 with a public or private repo; watch/unwatch works for a user other than the owner (the user that the token belongs to).
Is the idea to create a route by which a user other than |
You're able to subscribe + unsubscribe from public repos? If I run
I get a 404 response (this is just a random public repository I found). That implied to me that the API isn't using the right permissions. |
@kdumontnu Perhaps the space (encoded as Request:
Response (200): {
"subscribed": true,
"ignored": false,
"reason": null,
"created_at": "2022-01-20T07:30:35Z",
"url": "https://try.gitea.io/api/v1/repos/sdweiyu/test/subscription",
"repository_url": "https://try.gitea.io/api/v1/repos/sdweiyu/test"
} |
Fixes go-gitea#28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
Fixes go-gitea#28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
Automatically locked because of our CONTRIBUTING guidelines |
Description
We're trying to write a script to unsubscribe (unwatch) users from all repos, but running into some issues. It looks like these API routes are broken in a couple of ways.
Then, using that token on a repo I own:
returns a 500 error
Next, when I try "PUT" or "DELETE", I get a 401 error.
"token is required"
. I should have access to this repo and I've provided all of the token routes.Gitea Version
1.22-dev
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
try.gitea.io
Database
None
The text was updated successfully, but these errors were encountered: