Git HTTP Auth breaks w/1.14
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 408
- 平均合并
- 2 天 57 分钟
- 30 天内合并 PR
- 7
描述
Upgrading to 1.14.0, and cloning via HTTP auth (username + password) gives this stack trace:
File "/opt/conda/lib/python3.10/site-packages/pygit2/remotes.py", line 171, in ls_remotes
self.connect(callbacks=callbacks, proxy=proxy)
File "/opt/conda/lib/python3.10/site-packages/pygit2/remotes.py", line 120, in connect
payload.check_error(err)
File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 93, in check_error
raise self._stored_exception
File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 416, in wrapper
return f(*args)
File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 484, in _credentials_cb
ccred = get_credentials(credentials, url, username, allowed)
File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 569, in get_credentials
creds = fn(url_str, username_str, allowed)
File "/opt/conda/lib/python3.10/site-packages/scmrepo/git/backend/pygit2/callbacks.py", line 51, in credentials
from pygit2.credentials import GIT_CREDENTIAL_USERPASS_PLAINTEXT, UserPass
ImportError: cannot import name 'GIT_CREDENTIAL_USERPASS_PLAINTEXT' from 'pygit2.credentials' (/opt/conda/lib/python3.10/site-packages/pygit2/credentials.py)
Version 1.13.3 works fine though :).
Thanks.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先比较 pygit2 1.13.3 和 1.14.0 的 credentials API,重点关注 scmrepo/git/backend/pygit2/callbacks.py 中的 import。使用用户名和密码复现一次 HTTP clone,然后验证使用 pygit2 1.14.0 时身份验证能够正常工作,且不会出现报告中的 ImportError。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, python
- 领域
- authentication, backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100