Skip to content

Comments

Refactor Actions Token Access#35688

Merged
wxiaoguang merged 24 commits intogo-gitea:mainfrom
ChristopherHX:refactor-action-token-permissions
Oct 22, 2025
Merged

Refactor Actions Token Access#35688
wxiaoguang merged 24 commits intogo-gitea:mainfrom
ChristopherHX:refactor-action-token-permissions

Conversation

@ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Oct 17, 2025

  • use a single function to do Action Tokens Permission checks
  • allows easier customization
  • add basic tests
  • lfs file locks should work now

* allow public repositories
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 17, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Oct 17, 2025
@ChristopherHX ChristopherHX added type/refactoring Existing code has been cleaned up. There should be no new functionality. topic/gitea-actions related to the actions of Gitea labels Oct 17, 2025
@lunny
Copy link
Member

lunny commented Oct 19, 2025

I think this might be related to #24635 — perhaps both issues should be reviewed together.

@ChristopherHX
Copy link
Contributor Author

I think yes, this is necessary cleanup for both #24635 and #35693

@ChristopherHX ChristopherHX marked this pull request as ready for review October 20, 2025 08:19
@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 Oct 20, 2025
@lunny lunny added this to the 1.26.0 milestone Oct 20, 2025
@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 Oct 20, 2025
ChristopherHX and others added 2 commits October 21, 2025 17:40
Signed-off-by: ChristopherHX <christopher.homberger@web.de>
@wxiaoguang wxiaoguang marked this pull request as draft October 21, 2025 16:45
@ChristopherHX
Copy link
Contributor Author

Should the gitea.token be able to create lfs locks? AFAIK It was never able to do this.

if not I need to fork the lfs test method

Copy link
Contributor Author

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lfs should be ready now as well.

@wxiaoguang wxiaoguang marked this pull request as ready for review October 21, 2025 23:02
@wxiaoguang
Copy link
Contributor

Made some new changes:

  • Remove unused code like ErrLFSUnauthorizedAction
  • Add more comments in LFS authenticate
  • Fix the 500 status code caused by "create repo" API, it should return 403, and update the tests

Do the changes look good to you?

@ChristopherHX
Copy link
Contributor Author

Looks good to me

@wxiaoguang wxiaoguang enabled auto-merge (squash) October 22, 2025 10:43
@wxiaoguang wxiaoguang merged commit 08b9776 into go-gitea:main Oct 22, 2025
26 checks passed
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 23, 2025
* giteaofficial/main:
  Fix external render (go-gitea#35727)
  Refactor Actions Token Access (go-gitea#35688)
  Honor delete branch on merge repo setting when using merge API (go-gitea#35488)
  Don't block site admin's operation if SECRET_KEY is lost (go-gitea#35721)
  [skip ci] Updated translations via Crowdin
  fix attachment file size limit in server backend (go-gitea#35519)
  Make restricted users can access public repositories (go-gitea#35693)
  Fix various trivial problems (go-gitea#35714)
  Refactor legacy code (go-gitea#35708)
  Add quick approve button on PR page (go-gitea#35678)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 20, 2026
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. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code topic/gitea-actions related to the actions of Gitea type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants