checkUserPushPermission is checking the wrong user's permission to push
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #1713 来自 @sankalpsthakur —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- git, typescript
调研方向
阅读 src/proxy/processors/push-action/parsePush.ts 第 93-96 行附近的代码,并追踪 action 的 user 和 userEmail 是如何填充的。确认这些值表示的是执行 proxy push 的用户,而不是最后一次提交的 committer,且不使用 action.commitData。复现所描述的 push 场景,并验证 checkUserPushPermission 评估的是执行 push 的用户的详细信息。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
checkUserPushPermission is intended to check whether the user performing the push is allowed to do so. However, it is currently checking the permission of the committer of the last commit in the push in its current location, rather than the user pushing it into git proxy.
Commits in git are tagged with two users' details: the author (who created the commit and originally pushed it to a repo) and the committer (initially the same as the author, but changes whenever the commit is pushed to a different repository or branch but changes whenever a commit is created or modified (e.g., via git commit, git commit --amend, git rebase, git merge) - git push does NOT change the committer. When we process a push in git proxy, we do so using the original committer of the last commit rather than the user performing the push - which is not the intent of the check.
parsePush is extracting the committer and committerEmail from the last commit in the push and setting them as the user and userEmail in the action object:
This is not the correct user information and needs to be corrected in parsePush, without using action.commitData.
To Reproduce
- Setup a project in Git proxy where you are allowed to contribute but no other user is
- Have a different user push a commit to a branch of the respository.
- Clone that branch yourself.
- While that different user's commit is the last one on that branch, push the branch to git proxy.
checkUserPushPermissionwill reject the push as it will use the other user's information as the committer,
Expected behavior
parsePush should use the details of the user trying to push through the proxy as the user and userEmail values of the action (rather than the user that original pushed the last commit), ensuring that checkUserPushPermission checks the correct user's details.
- 主要语言
- TypeScript
- 星标
- 263
- 派生
- 185
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 39
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
finos/git-proxy 的其他 Issue
-
Update the Git Proxy website homepage using flyer content可能已有人在做 @Orcus01 于 3 天前认领。 未关闭documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 68/100
finos/git-proxy#1878 · 2 条评论 ·
维护者通常 1 天内回复
-
scanDiff ignores commitConfig.diff.block rules from the --config file可能已有人在做 @goldensyntax 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
finos/git-proxy#1874 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
meeting
难度 1/5 1 小时以内 新手友好度 35/100
维护者通常 1 天内回复
-
meeting
难度 1/5 1 小时以内 新手友好度 25/100
finos/git-proxy#1848 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
Recording drops clicks on links, filters and checkboxes that share a form with a search field可能已有人在做 @columbia11 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
Tencent/BrowserSkill#657 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 2 天内回复
-
Choosing a folder while continuing an Antigravity session submits a history fork the runtime rejects未关闭
难度 2/5 1-3 小时 新手友好度 87/100
-
ai-handle
难度 2/5 1-3 小时 新手友好度 78/100
nextlevelbuilder/dewee-web-v2#138 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
NEARBuilders/citynode.app#512 ·
维护者通常 1 天内回复