libgit2 / libgit2/libgit2sharp

Credential handling in 0.27.0-preview-0096 fails against VSTS/Azure

未关闭
#1,871 7 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C#
星标
3.5k
派生
925
PR 合并指标
30 天内没有已合并 PR

描述

Between versions preview-0034 and preview-0096 the credential handling changed and no longer works with VSTS/Azure

Include="LibGit2Sharp" Version="0.27.0-preview-0034" - works correctly

Include="LibGit2Sharp" Version="0.27.0-preview-0096" - authentication fails

Reproduction steps

string surl = "https://testsite.visualstudio.com/testsite/_git/Test";
string un = "pat";
string pwd = "";

var credentialsProvider = new CredentialsHandler((_url, _user, _cred) =>
new UsernamePasswordCredentials
{
Username = un,
Password = pwd
}
);

var references = Repository.ListRemoteReferences(surl, credentialsProvider);

Expected behavior

Should return references

Actual behavior

preview-0096 throws "this remote has never connected" error when authentication fails.

Version of LibGit2Sharp (release number or SHA1)

0.27.0-preview-0096

Operating system(s) tested; .NET runtime tested

OSx, .net core 5.0

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用 Repository.ListRemoteReferences、VSTS/Azure URL 和提供的 CredentialsHandler,在 LibGit2Sharp 0.27.0-preview-0034 和 preview-0096 中重现该问题。比较两个版本之间的凭据处理方式;当 preview-0096 的情况能够成功进行身份验证并返回引用,而不是抛出 "this remote has never connected" 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
authentication
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。