Closed
Description
Description
Reproduction:
- I created an access token at the
/api/v1/users/bob/tokens
endpoint, using basic auth with myadmin
account. - I expected the access token to be created for
bob
, but it was actually created foradmin
. - the same is true for other related endpoints
This was very surprising and took a while to debug. Is it a bug or by design?
If it's a bug (I think it is), then this issue will track it.
If it's by design:
- It's common to use an admin account to interact with an app, even when managing other users' accounts. So this behaviour is very surprising.
- I specified that I wanted to act on the
bob
account, not theadmin
account. - If this cannot be fixed/changed, then at least those API endpoints should return errors. If it will ignore the account that I specified and use the authenticating account instead, it must return an error rather than perform an action I didn't request.
- The docs should reflect this weird behaviour (I looked but couldn't find anything).
Thanks!
Gitea Version
1.20.2
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
n/a
Screenshots
n/a
Git Version
n/a
Operating System
n/a
How are you running Gitea?
docker
Database
None