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

Deploy key with write access can not push #19009

Closed
wxiaoguang opened this issue Mar 5, 2022 · 0 comments · Fixed by #19010
Closed

Deploy key with write access can not push #19009

wxiaoguang opened this issue Mar 5, 2022 · 0 comments · Fixed by #19010
Labels
Milestone

Comments

@wxiaoguang
Copy link
Contributor

2022/03/06 00:00:42 router: completed GET /api/internal/serv/command/21/org/repo?mode=2&verb=git-receive-pack for 127.0.0.1:34602, 200 OK in 6.2ms @ private/serv.go:81(private.ServCommand)

2022/03/06 00:00:42 router: completed POST /api/internal/hook/pre-receive/org/repo for 127.0.0.1:34604, 403 Forbidden in 5.8ms @ private/hook_pre_receive.go:107(private.HookPreReceive)

2022/03/06 00:00:42 router: completed POST /api/internal/ssh/21/update/42 for 127.0.0.1:34606, 200 OK in 10.4ms @ private/key.go:18(private.UpdatePublicKeyInRepo)

The HookPreReceive calls AssertCanWriteCode, but AssertCanWriteCode only checks user's permission.

@wxiaoguang wxiaoguang added this to the 1.17.0 milestone Mar 5, 2022
@wxiaoguang wxiaoguang linked a pull request Mar 5, 2022 that will close this issue
zeripath pushed a commit to zeripath/gitea that referenced this issue Mar 23, 2022
Backport go-gitea#19010

Use DeployKeyID to replace the IsDeployKey, then CanWriteCode uses the DeployKeyID to check the write permission.

Fix go-gitea#19009

Co-authored-by: wxiaoguang <[email protected]>
zeripath added a commit that referenced this issue Mar 23, 2022
Backport #19010

Use DeployKeyID to replace the IsDeployKey, then CanWriteCode uses the DeployKeyID to check the write permission.

Fix #19009

Co-authored-by: wxiaoguang <[email protected]>
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant