invalid credential type for any passed RemoteCallback
まだ誰も着手していません。
評価
調査の方向性
pygit2/remotes.py と callbacks.py の失敗しているエントリポイントから始め、特に RemoteCallbacks、_credentials_cb、get_credentials を確認してください。示されている Keypair、UserPass、KeypairFromAgent の例でエラーを再現してください。connect または fetch 中に認証情報がどのように渡されるかを追跡し、有効な認証情報プロバイダーで TypeError: invalid credential type が発生しなくなったら Issue は完了とみなします。
索引モデルが issue の本文から書いたものです。
説明
pygit2 version: 1.14.1
Python version: 3.10.12
I'm trying to connect to the git server with via a ssh url.
e.g. remote.url is ssh://example.com:22/path/to/repo
When I'm trying to remote.fetch(callbacks=callbacks) (or any other operation like push or connect) I'm getting TypeError: invalid credential type
It doesn't matter which credential provider I pass into the RemoteCallbacks object.
For example:
keypair = pygit2.Keypair("git", "/home/myuser/.ssh/id_rsa.pub", "/home/myuser/.ssh/id_rsa", "")
callbacks = pygit2.RemoteCallbacks(keypair)
or
keypair = pygit2.UserPass("eeee", "xxx")
callbacks = pygit2.RemoteCallbacks(keypair)
or
keypair = pygit2.KeypairFromAgent("git")
callbacks = pygit2.RemoteCallbacks(keypair)
I'm getting always the following stack trace:
File "..../site-packages/pygit2/remotes.py", line 120, in connect
payload.check_error(err)
File "..../site-packages/pygit2/callbacks.py", line 93, in check_error
raise self._stored_exception
File "..../site-packages/pygit2/callbacks.py", line 416, in wrapper
return f(*args)
File "..../site-packages/pygit2/callbacks.py", line 484, in _credentials_cb
ccred = get_credentials(credentials, url, username, allowed)
File "..../site-packages/pygit2/callbacks.py", line 579, in get_credentials
raise TypeError("invalid credential type")
The repository is initialized with repo = Repository(discover_repository("/root/path/of/my/repo"))
With git itself I can do all the operations. So I guess that the settings are correct.
Do you have any idea which does let this operation fail?
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libgit2/pygit2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
似ている issue
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100