Skip to content
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

Add a "admin user generate-access-token" subcommand #17722

Merged
merged 6 commits into from
Mar 4, 2022

Conversation

mscherer
Copy link
Contributor

Fixes #17721

cmd/admin.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 22, 2021
cmd/admin.go Outdated Show resolved Hide resolved
cmd/admin.go Outdated Show resolved Hide resolved
mscherer and others added 3 commits November 22, 2021 16:09
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 22, 2021
@zeripath
Copy link
Contributor

OK, so one last thing before we put this in:

  • Are we sure that it's OK for the administrator to create tokens for users?

I guess if the admin has access the command line and database they can do what they like so ...

Also it appears that if the admin logs in with BasicAuth and sets Sudo they can create tokens for any user from the API.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 4, 2022
@singuliere
Copy link
Contributor

@mscherer could you please answer @zeripath question?

@mscherer
Copy link
Contributor Author

mscherer commented Mar 4, 2022

@singuliere I think one of us misunderstood the question. I do not think that's being asked to me. I proposed the feature and exposed my rationale on the linked bug, so yes I am ok.

The way I understand it, it is asked to others devs (I mean, the "we" part kinda indicate to be aimed at the committers group to me).

So maybe it should be rephrased as "can you (singuliere) answer to @zeripath question ?" :p

I assume that you still have the same need as I have wrt ansible automation for a gitea installation, and I guess you are still using what was discussed before. I added that feature because i want to automate woodpecker deployment (which is I think also on the table for you), and that would requires a token to use the API. Hence this PR.

@zeripath zeripath added the type/enhancement An improvement of existing functionality label Mar 4, 2022
@zeripath
Copy link
Contributor

zeripath commented Mar 4, 2022

I think the question was: Are we sure that we want to do this?

I guess as the admin user can already do this through Sudo it's not a new thing so we can merge.

@zeripath zeripath added this to the 1.17.0 milestone Mar 4, 2022
@zeripath
Copy link
Contributor

zeripath commented Mar 4, 2022

make lgtm work

@zeripath zeripath merged commit 95c8d53 into go-gitea:main Mar 4, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 6, 2022
* giteaofficial/main:
  Fix EasyMDE error when input Enter (go-gitea#19004)
  Fix update hint bug (go-gitea#18996)
  Fix the editor height in review box (go-gitea#19003)
  Add a "admin user generate-access-token" subcommand (go-gitea#17722)
  Fix potential assignee query for repo (go-gitea#18994)
  Add config option to disable "Update branch by rebase" (go-gitea#18745)
  Update `go-enry` to v2.8.0 (go-gitea#18993)
  homebrew updates via cron
  ignore missing comment for user notifications (go-gitea#18954)
  allow overwrite artifacts for github releases (go-gitea#18987)
  fix & refactor (go-gitea#18973)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* Add a "admin user generate-access-token" subcommand

Fixes go-gitea#17721

* Update cmd/admin.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

* Update cmd/admin.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

* Fix code to match new interfaces

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to generate access token from the CLI for automation purpose
5 participants