Cli admin create user --access-token option should also require a --scopes option #10880

Open
opened 2025-11-02 09:21:02 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @akarasulu on GitHub (May 20, 2023).

Feature Description

The token created via gitea admin create user --access-token is effectively useless without providing some minimal scope options. The generated scopeless access token, as expected, always results in a 403 with "token does not have required scope" messages via REST API. There's no way to change the scope afterward either.

Without the ability to provide scopes the --access-token features is completely useless.

Screenshots

This shows the current token scopes (none) as the feature stands without having the option to specify scopes. Another option is from my comment below where all powers are granted to the access token generated for admins from the CLI.

image

Originally created by @akarasulu on GitHub (May 20, 2023). ### Feature Description The token created via `gitea admin create user --access-token` is effectively useless without providing some minimal scope options. The generated scopeless access token, as expected, always results in a 403 with "token does not have required scope" messages via REST API. There's no way to change the scope afterward either. Without the ability to provide scopes the --access-token features is completely useless. ### Screenshots This shows the current token scopes (none) as the feature stands without having the option to specify scopes. Another option is from my comment below where all powers are granted to the access token generated for admins from the CLI. ![image](https://github.com/go-gitea/gitea/assets/10051386/79ce2bd0-a670-47a5-86f7-14eee378091c)
GiteaMirror added the type/enhancementtype/proposal labels 2025-11-02 09:21:02 -06:00
Author
Owner

@delvh commented on GitHub (May 20, 2023):

That strongly depends on #24767 first…

@delvh commented on GitHub (May 20, 2023): That strongly depends on #24767 first…
Author
Owner

@akarasulu commented on GitHub (May 20, 2023):

That strongly depends on #24767 first…

From a DevOps point of view, the token created with an admin user (via CLI) should have all scopes automatically set when creating the token, including the ability to delete this "all-powers" token after the automated configuration completes.

@akarasulu commented on GitHub (May 20, 2023): > That strongly depends on #24767 first… From a DevOps point of view, the token created with an admin user (via CLI) should have all scopes automatically set when creating the token, including the ability to delete this "all-powers" token after the automated configuration completes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10880