From 2b7da400b89a9dd3a34caa6387044efd42390fa7 Mon Sep 17 00:00:00 2001 From: Duende Bot Date: Fri, 22 May 2026 13:27:41 +0000 Subject: [PATCH] Publish - 2026-05-22 13:27:37 UTC --- .editorconfig | 2 + bff/bff.slnf | 39 ------------ bff/bff.slnx | 61 +++++++++++++++++++ bff/hosts/Directory.Build.props | 2 + .../Hosts.Bff.Performance.csproj | 2 +- .../Hosts.ServiceDefaults.csproj | 2 +- bff/performance/Directory.Build.props | 5 +- .../BffClientAuthenticationStateProvider.cs | 10 +-- bff/src/Bff.Blazor/ServerSideTokenStore.cs | 12 ++-- bff/src/Directory.Build.props | 5 +- bff/src/Directory.Build.targets | 2 +- bff/test/Directory.Build.props | 2 +- bff/test/Hosts.Tests/Hosts.Tests.csproj | 2 +- products.slnx | 55 ----------------- 14 files changed, 89 insertions(+), 112 deletions(-) delete mode 100644 bff/bff.slnf create mode 100644 bff/bff.slnx diff --git a/.editorconfig b/.editorconfig index ab68ac41e..e63a05959 100644 --- a/.editorconfig +++ b/.editorconfig @@ -88,3 +88,5 @@ dotnet_naming_rule.async_methods_must_end_with_async.severity = none [platform/src/AdminStudio.Web/Services/*GrpcService.cs] dotnet_naming_rule.async_methods_must_end_with_async.severity = none + + diff --git a/bff/bff.slnf b/bff/bff.slnf deleted file mode 100644 index ff4ee240d..000000000 --- a/bff/bff.slnf +++ /dev/null @@ -1,39 +0,0 @@ -{ - "solution": { - "path": "..\\products.slnx", - "projects": [ - "bff\\hosts\\Blazor\\PerComponent\\Hosts.Bff.Blazor.PerComponent.Client\\Hosts.Bff.Blazor.PerComponent.Client.csproj", - "bff\\hosts\\Blazor\\PerComponent\\Hosts.Bff.Blazor.PerComponent\\Hosts.Bff.Blazor.PerComponent.csproj", - "bff\\hosts\\Blazor\\WebAssembly\\Hosts.Bff.Blazor.WebAssembly.Client\\Hosts.Bff.Blazor.WebAssembly.Client.csproj", - "bff\\hosts\\Blazor\\WebAssembly\\Hosts.Bff.Blazor.WebAssembly\\Hosts.Bff.Blazor.WebAssembly.csproj", - "bff\\hosts\\Hosts.AppHost\\Hosts.AppHost.csproj", - "bff\\hosts\\Hosts.Bff.DPoP\\Hosts.Bff.DPoP.csproj", - "bff\\hosts\\Hosts.Bff.EF\\Hosts.Bff.EF.csproj", - "bff\\hosts\\Hosts.Bff.InMemory\\Hosts.Bff.InMemory.csproj", - "bff\\hosts\\Hosts.Bff.MultiFrontend\\Hosts.Bff.MultiFrontend.csproj", - "bff\\hosts\\Hosts.Bff.Performance\\Hosts.Bff.Performance.csproj", - "bff\\hosts\\Hosts.IdentityServer\\Hosts.IdentityServer.csproj", - "bff\\hosts\\Hosts.ServiceDefaults\\Hosts.ServiceDefaults.csproj", - "bff\\hosts\\RemoteApis\\Hosts.RemoteApi.DPoP\\Hosts.RemoteApi.DPoP.csproj", - "bff\\hosts\\RemoteApis\\Hosts.RemoteApi.Isolated\\Hosts.RemoteApi.Isolated.csproj", - "bff\\hosts\\RemoteApis\\Hosts.RemoteApi\\Hosts.RemoteApi.csproj", - "bff\\migrations\\UserSessionDb\\UserSessionDb.csproj", - "bff\\performance\\Bff.Benchmarks\\Bff.Benchmarks.csproj", - "bff\\performance\\Bff.Performance\\Bff.Performance.csproj", - "bff\\src\\Bff.Blazor.Client\\Bff.Blazor.Client.csproj", - "bff\\src\\Bff.Blazor\\Bff.Blazor.csproj", - "bff\\src\\Bff.EntityFramework\\Bff.EntityFramework.csproj", - "bff\\src\\Bff.Yarp\\Bff.Yarp.csproj", - "bff\\src\\Bff\\Bff.csproj", - "bff\\templates\\src\\BffBlazorAutoRenderMode\\BffBlazorAutoRenderMode.Client\\BffBlazorAutoRenderMode.Client.csproj", - "bff\\templates\\src\\BffBlazorAutoRenderMode\\BffBlazorAutoRenderMode\\BffBlazorAutoRenderMode.csproj", - "bff\\templates\\src\\BffLocalApi\\BffLocalApi.csproj", - "bff\\templates\\src\\BffRemoteApi\\BffRemoteApi.csproj", - "bff\\test\\Bff.Tests\\Bff.Tests.csproj", - "bff\\test\\Hosts.Tests\\Hosts.Tests.csproj", - "shared\\AppHost.Abstractions\\AppHost.Abstractions.csproj", - "shared\\ShouldlyExtensions\\ShouldlyExtensions.csproj", - "shared\\Xunit.Playwright\\Xunit.Playwright.csproj" - ] - } -} \ No newline at end of file diff --git a/bff/bff.slnx b/bff/bff.slnx new file mode 100644 index 000000000..6adfc61a6 --- /dev/null +++ b/bff/bff.slnx @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bff/hosts/Directory.Build.props b/bff/hosts/Directory.Build.props index 9bcc652e2..5de8764f4 100644 --- a/bff/hosts/Directory.Build.props +++ b/bff/hosts/Directory.Build.props @@ -21,5 +21,7 @@ None net10.0 false + + $(NoWarn);IDE1006 diff --git a/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj b/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj index 4fb9628d6..32975590d 100644 --- a/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj +++ b/bff/hosts/Hosts.Bff.Performance/Hosts.Bff.Performance.csproj @@ -8,7 +8,7 @@ - + diff --git a/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj b/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj index 8b9bc846d..bd1766e73 100644 --- a/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj +++ b/bff/hosts/Hosts.ServiceDefaults/Hosts.ServiceDefaults.csproj @@ -18,7 +18,7 @@ - + diff --git a/bff/performance/Directory.Build.props b/bff/performance/Directory.Build.props index ed36ab0c7..1d78934a4 100644 --- a/bff/performance/Directory.Build.props +++ b/bff/performance/Directory.Build.props @@ -2,7 +2,7 @@ - + None @@ -12,6 +12,9 @@ $(NoWarn);RS0027 + + + $(NoWarn);IDE1006 diff --git a/bff/src/Bff.Blazor.Client/Internals/BffClientAuthenticationStateProvider.cs b/bff/src/Bff.Blazor.Client/Internals/BffClientAuthenticationStateProvider.cs index e4584fa3e..d0be77a73 100644 --- a/bff/src/Bff.Blazor.Client/Internals/BffClientAuthenticationStateProvider.cs +++ b/bff/src/Bff.Blazor.Client/Internals/BffClientAuthenticationStateProvider.cs @@ -32,19 +32,19 @@ internal class BffClientAuthenticationStateProvider : AuthenticationStateProvide _fetchUserService = fetchUserService; _ = persistentUserService.GetPersistedUser(out var user); _user = user; - _timer = timeProvider.CreateTimer(TimerCallback, + _timer = timeProvider.CreateTimer(TimerCallbackAsync, null, TimeSpan.FromMilliseconds(options.Value.WebAssemblyStateProviderPollingDelay), TimeSpan.FromMilliseconds(options.Value.WebAssemblyStateProviderPollingInterval)); _logger = logger; } - private async void TimerCallback(object? _) + private async void TimerCallbackAsync(object? _) { await _semaphore.WaitAsync(); try { - _user = await RefreshUser(); + _user = await RefreshUserAsync(); } finally { @@ -52,7 +52,7 @@ internal class BffClientAuthenticationStateProvider : AuthenticationStateProvide } } - private async Task RefreshUser() + private async Task RefreshUserAsync() { // We don't want to do any polling if we already know that the user is anonymous. // There's no way for us to become authenticated without the server issuing a cookie @@ -94,7 +94,7 @@ internal class BffClientAuthenticationStateProvider : AuthenticationStateProvide if (_user == null) #pragma warning restore CA1508 { - _user = await RefreshUser(); + _user = await RefreshUserAsync(); } } finally diff --git a/bff/src/Bff.Blazor/ServerSideTokenStore.cs b/bff/src/Bff.Blazor/ServerSideTokenStore.cs index 172331fbc..a3ed8fe05 100644 --- a/bff/src/Bff.Blazor/ServerSideTokenStore.cs +++ b/bff/src/Bff.Blazor/ServerSideTokenStore.cs @@ -35,7 +35,7 @@ internal class ServerSideTokenStore( Ct ct = default) { logger.RetrievingTokenForUser(LogLevel.Debug, user.Identity?.Name); - var session = await GetSession(user); + var session = await GetSessionAsync(user); if (session == null) { var anonymous = new ClaimsPrincipal(new ClaimsIdentity()); @@ -50,7 +50,7 @@ internal class ServerSideTokenStore( return tokensInAuthProperties.GetUserToken(ticket.Properties, parameters); } - private async Task GetSession(ClaimsPrincipal user) + private async Task GetSessionAsync(ClaimsPrincipal user) { if (user.Identity?.IsAuthenticated == false) { @@ -86,7 +86,7 @@ internal class ServerSideTokenStore( UserTokenRequestParameters? parameters = null, Ct ct = default) { logger.StoringTokenForUser(LogLevel.Debug, user.Identity?.Name); - await UpdateTicket(user, + await UpdateTicketAsync(user, async ticket => { await tokensInAuthProperties.SetUserTokenAsync(token, ticket.Properties, parameters, ct); }); } @@ -94,16 +94,16 @@ internal class ServerSideTokenStore( public async Task ClearTokenAsync(ClaimsPrincipal user, UserTokenRequestParameters? parameters = null, Ct ct = default) { logger.RemovingTokenForUser(LogLevel.Debug, user.Identity?.Name); - await UpdateTicket(user, ticket => + await UpdateTicketAsync(user, ticket => { tokensInAuthProperties.RemoveUserToken(ticket.Properties, parameters); return Task.CompletedTask; }); } - protected async Task UpdateTicket(ClaimsPrincipal user, Func updateAction) + protected async Task UpdateTicketAsync(ClaimsPrincipal user, Func updateAction) { - var session = await GetSession(user); + var session = await GetSessionAsync(user); if (session == null) { logger.FailedToFindSessionToUpdate(LogLevel.Debug); diff --git a/bff/src/Directory.Build.props b/bff/src/Directory.Build.props index 5ffff4a4f..24b6f07ce 100644 --- a/bff/src/Directory.Build.props +++ b/bff/src/Directory.Build.props @@ -2,7 +2,7 @@ - + OAuth 2.0;OpenID Connect;Security;BFF;IdentityServer;ASP.NET Core;SPA;Blazor @@ -17,6 +17,9 @@ $(NoWarn);RS0027 + + + $(NoWarn);IDE1006 diff --git a/bff/src/Directory.Build.targets b/bff/src/Directory.Build.targets index acbac1881..bbe49ed2b 100644 --- a/bff/src/Directory.Build.targets +++ b/bff/src/Directory.Build.targets @@ -1,4 +1,4 @@ - + diff --git a/bff/test/Directory.Build.props b/bff/test/Directory.Build.props index 66f181f48..203c9cb9b 100644 --- a/bff/test/Directory.Build.props +++ b/bff/test/Directory.Build.props @@ -33,5 +33,5 @@ $(NoWarn);CA2201 $(NoWarn);CA2254 - + diff --git a/bff/test/Hosts.Tests/Hosts.Tests.csproj b/bff/test/Hosts.Tests/Hosts.Tests.csproj index 9ac513081..a5a2b7881 100644 --- a/bff/test/Hosts.Tests/Hosts.Tests.csproj +++ b/bff/test/Hosts.Tests/Hosts.Tests.csproj @@ -28,6 +28,6 @@ - + diff --git a/products.slnx b/products.slnx index 8f03cf59c..63f7391fa 100644 --- a/products.slnx +++ b/products.slnx @@ -30,61 +30,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -