mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Updated Git Data Tag With Signature Verification
This commit is contained in:
@@ -107,6 +107,26 @@ namespace Octokit.Tests.Integration.Clients
|
||||
Assert.Equal(gitTag.Message, "Hello");
|
||||
Assert.Equal(gitTag.Object.Sha, sha);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task DeserializeTagSignatureVerification()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var newTag = new NewTag { Message = "Hello", Type = TaggedType.Blob, Object = sha, Tag = "tag" };
|
||||
|
||||
var tag = await github.Git.Tag.Create(context.Repository.Id, newTag);
|
||||
|
||||
var gitTag = await github.Git.Tag.Get(context.Repository.Id, tag.Sha);
|
||||
|
||||
Assert.NotNull(gitTag);
|
||||
|
||||
Assert.False(gitTag.Verification.Verified);
|
||||
Assert.Equal(gitTag.Verification.Reason, VerificationReason.Unsigned);
|
||||
Assert.Null(gitTag.Verification.Signature);
|
||||
Assert.Null(gitTag.Verification.Payload);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Tests;
|
||||
using Xunit;
|
||||
|
||||
public class TagsClientTests
|
||||
@@ -17,7 +18,7 @@ public class TagsClientTests
|
||||
|
||||
await client.Get("owner", "repo", "reference");
|
||||
|
||||
connection.Received().Get<GitTag>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/repo/git/tags/reference"));
|
||||
connection.Received().Get<GitTag>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/repo/git/tags/reference"), Args.EmptyDictionary, "application/vnd.github.cryptographer-preview+sha");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
|
||||
|
||||
return ApiConnection.Get<GitTag>(ApiUrls.Tag(owner, name, reference));
|
||||
return ApiConnection.Get<GitTag>(ApiUrls.Tag(owner, name, reference), null, AcceptHeaders.SignatureVerificationPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -49,7 +49,7 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
|
||||
|
||||
return ApiConnection.Get<GitTag>(ApiUrls.Tag(repositoryId, reference));
|
||||
return ApiConnection.Get<GitTag>(ApiUrls.Tag(repositoryId, reference), null, AcceptHeaders.SignatureVerificationPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -23,5 +23,7 @@ namespace Octokit
|
||||
public Committer Tagger { get; protected set; }
|
||||
|
||||
public TagObject Object { get; protected set; }
|
||||
|
||||
public Verification Verification { get; protected set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user