mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 07:59:44 +08:00
chore(openai): upgrade dependencies
This commit is contained in:
parent
b9512a863e
commit
64c0bf5bd8
@ -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>
|
||||
|
||||
|
@ -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>(() =>
|
||||
{
|
||||
|
@ -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 };
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user