Skip to content

Conversation

@wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Sep 17, 2024

Remove unused CSRF options, decouple "new csrf protector" and "prepare" logic, do not redirect to home page if CSRF validation falis (it shouldn't happen in daily usage, if it happens, redirecting to home doesn't help either but just makes the problem more complex for "fetch")

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 17, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/translation labels Sep 17, 2024
@wxiaoguang wxiaoguang force-pushed the refactor-csrf branch 2 times, most recently from 8574918 to fef4ddf Compare September 17, 2024 12:06
@lunny lunny added this to the 1.23.0 milestone Sep 17, 2024
@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 Sep 17, 2024
@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 Sep 18, 2024
@wxiaoguang wxiaoguang merged commit 1fede04 into go-gitea:main Sep 18, 2024
@wxiaoguang wxiaoguang deleted the refactor-csrf branch September 18, 2024 07:17
@GiteaBot
Copy link
Collaborator

I was unable to create a backport for 1.22. @wxiaoguang, please send one manually. 🍵

go run ./contrib/backport 32057
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Sep 18, 2024
wxiaoguang added a commit to wxiaoguang/gitea that referenced this pull request Sep 18, 2024
@wxiaoguang wxiaoguang added the backport/done All backports for this PR have been created label Sep 18, 2024
lunny pushed a commit that referenced this pull request Sep 18, 2024
#32057 improves the CSRF handling and is worth to backport
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 19, 2024
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Fix: database not update release when using `git push --tags --force` (go-gitea#32040)
  Resolve duplicate local string key related to PR comments (go-gitea#32073)
  Refactor CSRF protector (go-gitea#32057)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants