-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Bug] CLI allows creation of access tokens with existing name #26044
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
Labels
Comments
GiteaBot
pushed a commit
to GiteaBot/gitea
that referenced
this issue
Jul 25, 2023
…ea#26071) We are now: - Making sure there is no existing access token with the same name - Making sure the given scopes are valid (we already did this before but now we have a message) The logic is mostly taken from https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123 Closes go-gitea#26044 Signed-off-by: Yarden Shoham <[email protected]>
silverwind
pushed a commit
that referenced
this issue
Jul 25, 2023
We are now: - Making sure there is no existing access token with the same name - Making sure the given scopes are valid (we already did this before but now we have a message) The logic is mostly taken from https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123 Closes #26044 Signed-off-by: Yarden Shoham <[email protected]>
lunny
pushed a commit
that referenced
this issue
Jul 26, 2023
#26144) Backport #26071 by @yardenshoham We are now: - Making sure there is no existing access token with the same name - Making sure the given scopes are valid (we already did this before but now we have a message) The logic is mostly taken from https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123 Closes #26044 Signed-off-by: Yarden Shoham <[email protected]>
project-mirrors-bot-tu bot
pushed a commit
to project-mirrors/forgejo-as-gitea-fork
that referenced
this issue
Jan 23, 2025
…ea#26071) (go-gitea#26144) Backport go-gitea#26071 by @yardenshoham We are now: - Making sure there is no existing access token with the same name - Making sure the given scopes are valid (we already did this before but now we have a message) The logic is mostly taken from https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123 Closes go-gitea#26044 Signed-off-by: Yarden Shoham <[email protected]> (cherry picked from commit 43213b8)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Suppose I try to create an access token with a name that already exists.
Using API endpoint
users/NAME/tokens
, response correctly shows:Using the UI will correctly show:
But using the CLI
gitea admin user generate-access-token
will create a new token with the same name.So the CLI allows multiple duplicate tokens.
Gitea Version
1.20.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
I'm using gitea in docker. Host has git 2.39.2
Operating System
linux
How are you running Gitea?
docker
Database
SQLite
The text was updated successfully, but these errors were encountered: