From 5e4b8682043b4a07bfb0c704c84e41a968798a1a Mon Sep 17 00:00:00 2001 From: reecerussell Date: Fri, 27 Oct 2023 12:16:52 +0100 Subject: [PATCH 1/3] feat: change key to singleton to avoid call to azure on init --- Rusty.Jwt.Azure/Extensions/JwtServiceBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rusty.Jwt.Azure/Extensions/JwtServiceBuilderExtensions.cs b/Rusty.Jwt.Azure/Extensions/JwtServiceBuilderExtensions.cs index 00feea3..ab5e1d4 100644 --- a/Rusty.Jwt.Azure/Extensions/JwtServiceBuilderExtensions.cs +++ b/Rusty.Jwt.Azure/Extensions/JwtServiceBuilderExtensions.cs @@ -15,7 +15,7 @@ public static IJwtServiceBuilder AddAzureKey(this IJwtServiceBuilder builder, HashAlgorithm hashAlgorithm = HashAlgorithm.SHA256, SigningKeyMode mode = SigningKeyMode.SignAndVerify) { - builder.Services.AddTransient(_ => + builder.Services.AddSingleton(_ => { var credential = credentials ?? new DefaultAzureCredential(); From 2142fd277563b969e5778b1bccc3b191857daa10 Mon Sep 17 00:00:00 2001 From: reecerussell Date: Fri, 27 Oct 2023 12:17:17 +0100 Subject: [PATCH 2/3] chore: increment package version --- Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj b/Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj index a3a2183..2f5cc7a 100644 --- a/Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj +++ b/Rusty.Jwt.Azure/Rusty.Jwt.Azure.csproj @@ -13,6 +13,7 @@ git azure,key vault,jwt 10 + 1.0.1 From cb7e08aa992795a5d31c33f7d751086ef5de5db0 Mon Sep 17 00:00:00 2001 From: reecerussell Date: Fri, 27 Oct 2023 12:21:29 +0100 Subject: [PATCH 3/3] fix: increase delta to handle cpu delay --- Rusty.Jwt.Azure.Tests/AzureEndToEndTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rusty.Jwt.Azure.Tests/AzureEndToEndTests.cs b/Rusty.Jwt.Azure.Tests/AzureEndToEndTests.cs index f606205..5eef0d1 100644 --- a/Rusty.Jwt.Azure.Tests/AzureEndToEndTests.cs +++ b/Rusty.Jwt.Azure.Tests/AzureEndToEndTests.cs @@ -45,7 +45,7 @@ public void ThenTheJwtShouldBeCorrect() _jwt.Should().NotBeNull(); _jwt.Id.Should().NotBeNullOrWhiteSpace(); _jwt.Token.Should().NotBeNullOrWhiteSpace(); - _jwt.ExpiresIn.Should().BeCloseTo(SecondsTtl, 1); + _jwt.ExpiresIn.Should().BeCloseTo(SecondsTtl, 3); } [Fact]