Git HTTP Auth breaks w/1.14
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the pygit2 1.13.3 and 1.14.0 credentials APIs, focusing on the import in scmrepo/git/backend/pygit2/callbacks.py. Reproduce an HTTP clone with username and password, then verify that authentication works with pygit2 1.14.0 without the reported ImportError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100