chore(openai): upgrade dependencies

This commit is contained in:
Fu Diwei 2022-02-05 19:08:24 +08:00
parent b9512a863e
commit 64c0bf5bd8
4 changed files with 5 additions and 5 deletions

View File

@ -40,7 +40,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="JWT" Version="8.8.1" />
<PackageReference Include="JWT" Version="8.9.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Common" Version="2.2.0" />
</ItemGroup>

View File

@ -6,7 +6,7 @@ using Newtonsoft.Json;
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities
{
internal static class JWTUtility
internal static class JwtUtility
{
private static readonly Lazy<IJwtEncoder> _encoder = new Lazy<IJwtEncoder>(() =>
{

View File

@ -139,7 +139,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
{
if (data is WechatOpenAIPlatformRequest.Serialization.IEncryptedUrlEncoded)
{
string jwt = Utilities.JWTUtility.EncodeWithHS256(payload: data, secret: Credentials.EncodingAESKey!);
string jwt = Utilities.JwtUtility.EncodeWithHS256(payload: data, secret: Credentials.EncodingAESKey!);
data = new { query = jwt };
}

View File

@ -2,7 +2,7 @@
namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
{
public class TestCase_JWTUtilityTests
public class TestCase_JwtUtilityTests
{
[Fact(DisplayName = "测试用例JWT HS256 编码")]
public void TestJWTEncodeWithHS256()
@ -17,7 +17,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
};
string secret = "jWmYm7qr5nMoAUwZRjGtBxmz3KA1tkAj3ykkR6q2B2C";
string actualJwt = Utilities.JWTUtility.EncodeWithHS256(payload: payload, secret: secret);
string actualJwt = Utilities.JwtUtility.EncodeWithHS256(payload: payload, secret: secret);
string expectedJwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJ4amxzajMzbGFzZmFmIiwiZGF0YSI6eyJxIjoi5Zyo5b6u5L-h5pm66KiA5LiO5b6u5L-h5pm66IGG5Lik5aSn5oqA5pyv55qE5pSv5oyB5LiL77yM5b6u5L-hQUnlm6LpmJ_mjqjlh7rkuobigJzlvq7kv6Hlr7nor53lvIDmlL7lubPlj7DigJ3lkozigJzohb7orq_lsI_lvq7igJ3mmbrog73noazku7bkuKTlpKfmoLjlv4Pkuqflk4HjgILlvq7kv6HmlK_ku5jlm6LpmJ_mnIDmlrDlj5HluIPnmoTigJzlvq7kv6HpnZLom5lQcm_igJ3lnKjnjrDlnLrorr7nva7kuobkvZPpqozljLrvvIzorqnlpKflrrbmhJ_lj5dBSeiupOiEuOeahOacrOS6i-OAgiJ9fQ.8FeSvxKlIrbI6MCAaWGekB4sHGA8DeUxgVXiHa8ulJk";
Assert.Equal(expectedJwt, actualJwt, ignoreCase: true);