From 618c114077b8a6e11fee7589025fd0ec5c38ed88 Mon Sep 17 00:00:00 2001 From: Martin Altenstedt Date: Tue, 25 Oct 2022 02:08:24 -0400 Subject: [PATCH 1/4] Verify refresh token creation and lifetime in test This commit will update the unit tests for refresh token to ensure that CreationTime and Lifetime properties do not change when renewed (TokenUsage.OneTimeOnly). --- .../Services/Default/DefaultRefreshTokenServiceTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs b/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs index bfdce8708..53e401404 100644 --- a/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs +++ b/test/IdentityServer.UnitTests/Services/Default/DefaultRefreshTokenServiceTests.cs @@ -287,6 +287,9 @@ public class DefaultRefreshTokenServiceTests oldToken.ConsumedTime.Should().Be(now); newToken.ConsumedTime.Should().BeNull(); + + newToken.CreationTime.Should().Be(oldToken.CreationTime); + newToken.Lifetime.Should().Be(oldToken.Lifetime); } [Fact] @@ -471,4 +474,4 @@ public class DefaultRefreshTokenServiceTests result.IsError.Should().BeFalse(); } -} \ No newline at end of file +} From a7c29be8cb6abb17a2f0108c1620e29ed782c974 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Tue, 1 Nov 2022 14:48:09 -0400 Subject: [PATCH 2/4] format JSON response in sample clients --- .../Controllers/HomeController.cs | 7 +++++-- clients/src/MvcJarJwt/Controllers/HomeController.cs | 4 ++-- clients/src/MvcJarUriJwt/Controllers/HomeController.cs | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/clients/src/MvcAutomaticTokenManagement/Controllers/HomeController.cs b/clients/src/MvcAutomaticTokenManagement/Controllers/HomeController.cs index a2d5d5b52..adb3fae66 100644 --- a/clients/src/MvcAutomaticTokenManagement/Controllers/HomeController.cs +++ b/clients/src/MvcAutomaticTokenManagement/Controllers/HomeController.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; using System.Text.Json; using System.Net.Http; using System.Threading.Tasks; +using Clients; namespace MvcCode.Controllers { @@ -27,9 +28,11 @@ namespace MvcCode.Controllers var client = _httpClientFactory.CreateClient("client"); var response = await client.GetStringAsync("identity"); - ViewBag.Json = JsonDocument.Parse(response).ToString(); - + ViewBag.Json = response.PrettyPrintJson(); + return View(); } + + } } \ No newline at end of file diff --git a/clients/src/MvcJarJwt/Controllers/HomeController.cs b/clients/src/MvcJarJwt/Controllers/HomeController.cs index 1e78a705e..639c742fa 100644 --- a/clients/src/MvcJarJwt/Controllers/HomeController.cs +++ b/clients/src/MvcJarJwt/Controllers/HomeController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using System.Text.Json; +using Clients; using System.Net.Http; using System.Threading.Tasks; @@ -27,7 +27,7 @@ namespace MvcCode.Controllers var client = _httpClientFactory.CreateClient("client"); var response = await client.GetStringAsync("identity"); - ViewBag.Json = response; + ViewBag.Json = response.PrettyPrintJson(); return View(); } diff --git a/clients/src/MvcJarUriJwt/Controllers/HomeController.cs b/clients/src/MvcJarUriJwt/Controllers/HomeController.cs index 1e78a705e..639c742fa 100644 --- a/clients/src/MvcJarUriJwt/Controllers/HomeController.cs +++ b/clients/src/MvcJarUriJwt/Controllers/HomeController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using System.Text.Json; +using Clients; using System.Net.Http; using System.Threading.Tasks; @@ -27,7 +27,7 @@ namespace MvcCode.Controllers var client = _httpClientFactory.CreateClient("client"); var response = await client.GetStringAsync("identity"); - ViewBag.Json = response; + ViewBag.Json = response.PrettyPrintJson(); return View(); } From 2a919c17f85a71a965a4997a3a195ba36cc63eba Mon Sep 17 00:00:00 2001 From: Dominick Baier Date: Wed, 9 Nov 2022 13:42:41 +0100 Subject: [PATCH 3/4] first cut --- .github/workflows/ci.yml | 2 +- Directory.Build.targets | 6 +++--- global.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae43b7f67..8a9b54542 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.100-rc.2.22477.23 + 7.0.x - run: dotnet --info diff --git a/Directory.Build.targets b/Directory.Build.targets index 5059c60fd..de3a5f776 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -8,9 +8,9 @@ - 7.0.0-rc.2.* - 7.0.0-rc.2.* - 7.0.0-rc.2.* + 7.0.0 + 7.0.0 + 7.0.0 6.15.1 diff --git a/global.json b/global.json index d7a1f7cff..30e2afcae 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "7.0.100-rc.1.22431.12", + "version": "7.0.100", "rollForward": "latestMajor", - "allowPrerelease": true + "allowPrerelease": false } } \ No newline at end of file From 5a63a72026889882644c6db7448a651f2335ec0d Mon Sep 17 00:00:00 2001 From: Dominick Baier Date: Wed, 9 Nov 2022 13:46:32 +0100 Subject: [PATCH 4/4] update CodeQL --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1641c3a1d..998b06c00 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.100-rc.2.22477.23 + 7.0.x - run: dotnet --info