diff --git a/bff/src/Bff.Blazor/BffServerAuthenticationStateProvider.cs b/bff/src/Bff.Blazor/BffServerAuthenticationStateProvider.cs index 1a3fc92a5..a3084be75 100644 --- a/bff/src/Bff.Blazor/BffServerAuthenticationStateProvider.cs +++ b/bff/src/Bff.Blazor/BffServerAuthenticationStateProvider.cs @@ -28,7 +28,7 @@ namespace Duende.Bff.Blazor; /// /// This is a server-side AuthenticationStateProvider that uses /// PersistentComponentState to flow the authentication state to the client which -/// is then used to initialize the authentication state in the WASM application. +/// is then used to initialize the authentication state in the WASM application. /// internal sealed class BffServerAuthenticationStateProvider : RevalidatingServerAuthenticationStateProvider, IDisposable { @@ -68,16 +68,7 @@ internal sealed class BffServerAuthenticationStateProvider : RevalidatingServerA AuthenticationStateChanged += OnAuthenticationStateChanged; _subscription = _state.RegisterOnPersisting(OnPersistingAsync, RenderMode.InteractiveWebAssembly); - CheckLicense(licenseValidator); - } - - - internal static void CheckLicense(LicenseValidator validator) - { - if (!validator.IsValid()) - { - // todo: license enforcement - } + licenseValidator.CheckLicense(); } private void OnAuthenticationStateChanged(Task task) => _authenticationStateTask = task; diff --git a/bff/src/Bff/Bff.csproj b/bff/src/Bff/Bff.csproj index 59e65085f..256c921a3 100644 --- a/bff/src/Bff/Bff.csproj +++ b/bff/src/Bff/Bff.csproj @@ -5,8 +5,8 @@ Duende.BFF Backend for frontend (BFF) host for ASP.NET Core - - + + @@ -25,8 +25,4 @@ - - - - diff --git a/bff/src/Bff/BffBuilderExtensions.cs b/bff/src/Bff/BffBuilderExtensions.cs index 5a061deb7..1f0263944 100644 --- a/bff/src/Bff/BffBuilderExtensions.cs +++ b/bff/src/Bff/BffBuilderExtensions.cs @@ -5,6 +5,8 @@ using Duende.AccessTokenManagement.OpenIdConnect; using Duende.Bff.AccessTokenManagement; using Duende.Bff.Builder; using Duende.Bff.Configuration; +using Duende.Bff.Diagnostics; +using Duende.Bff.Diagnostics.DiagnosticEntries; using Duende.Bff.DynamicFrontends; using Duende.Bff.DynamicFrontends.Internal; using Duende.Bff.Endpoints; @@ -16,7 +18,6 @@ using Duende.Bff.SessionManagement.Configuration; using Duende.Bff.SessionManagement.Revocation; using Duende.Bff.SessionManagement.SessionStore; using Duende.Bff.SessionManagement.TicketStore; -using Duende.Private.Licensing; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; @@ -46,9 +47,14 @@ public static class BffBuilderExtensions internal static T AddBaseBffServices(this T builder) where T : IBffServicesBuilder { - builder.Services.AddSingleton(sp => () => sp.GetRequiredService>().Value.LicenseKey); - builder.Services.AddSingleton>(); - builder.Services.AddSingleton(sp => sp.GetRequiredService>().Current); + builder.Services.AddSingleton(sp => + () => sp.GetRequiredService>().Value.LicenseKey); + builder.Services.AddSingleton(sp => + { + var accessor = sp.GetRequiredService(); + return accessor.Current; + }); + builder.Services.AddSingleton(); builder.Services.TryAddSingleton(); builder.Services.AddDistributedMemoryCache(); @@ -59,7 +65,8 @@ public static class BffBuilderExtensions builder.Services.AddSingleton, BffConfigureOpenIdConnectOptions>(); builder.Services.AddOpenIdConnectAccessTokenManagement(); - builder.Services.AddSingleton, ConfigureUserTokenManagementOptions>(); + builder.Services + .AddSingleton, ConfigureUserTokenManagementOptions>(); builder.Services.AddTransient(); builder.Services.TryAddSingleton(); @@ -79,12 +86,16 @@ public static class BffBuilderExtensions builder.Services.TryAddTransient(); // cookie configuration - builder.Services.AddSingleton, PostConfigureSlidingExpirationCheck>(); - builder.Services.AddSingleton, PostConfigureApplicationCookieRevokeRefreshToken>(); + builder.Services + .AddSingleton, PostConfigureSlidingExpirationCheck>(); + builder.Services + .AddSingleton, + PostConfigureApplicationCookieRevokeRefreshToken>(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); - builder.Services.AddSingleton, PostConfigureOidcOptionsForSilentLogin>(); + builder.Services + .AddSingleton, PostConfigureOidcOptionsForSilentLogin>(); AddBffMetrics(builder); @@ -94,14 +105,30 @@ public static class BffBuilderExtensions // Make sure the session partitioning is registered. There are a few codepaths that require this injected // even if you are not using session management. - builder.Services.AddSingleton(sp => sp.GetRequiredService().BuildPartitionKey); + builder.Services.AddSingleton(sp => + sp.GetRequiredService().BuildPartitionKey); builder.Services.AddSingleton(); return builder; } - internal static void AddBffMetrics(T builder) where T : IBffBuilder => builder.Services.AddSingleton(); + internal static void AddBffMetrics(T builder) where T : IBffBuilder => + builder.Services.AddSingleton(); + internal static T AddDiagnostics(this T builder) + where T : IBffServicesBuilder + { + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(serviceProvider => new DiagnosticDataService( + serviceProvider.GetRequiredService().GetUtcNow().UtcDateTime, + serviceProvider.GetServices())); + builder.Services.AddHostedService(); + + return builder; + } internal static T AddDynamicFrontends(this T builder) where T : IBffServicesBuilder @@ -125,7 +152,8 @@ public static class BffBuilderExtensions // Configure the AspNet Core Authentication settings if no // .AddAuthentication().AddCookie().AddOpenIdConnect() was added - builder.Services.AddSingleton, BffConfigureAuthenticationOptions>(); + builder.Services + .AddSingleton, BffConfigureAuthenticationOptions>(); builder.Services.AddSingleton, BffConfigureCookieOptions>(); @@ -133,8 +161,10 @@ public static class BffBuilderExtensions // Add 'default' configure methods that would have been added by // .AddAuthentication().AddCookie().AddOpenIdConnect() - builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, OpenIdConnectPostConfigureOptions>()); - builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, PostConfigureCookieAuthenticationOptions>()); + builder.Services.TryAddEnumerable(ServiceDescriptor + .Singleton, OpenIdConnectPostConfigureOptions>()); + builder.Services.TryAddEnumerable(ServiceDescriptor + .Singleton, PostConfigureCookieAuthenticationOptions>()); builder.Services.TryAddSingleton(); @@ -180,11 +210,14 @@ public static class BffBuilderExtensions internal static void AddServerSideSessionsSupportingServices(this IServiceCollection services) { - services.AddSingleton(sp => sp.GetRequiredService().BuildPartitionKey); + services.AddSingleton(sp => + sp.GetRequiredService().BuildPartitionKey); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton, PostConfigureApplicationCookieTicketStore>(); + services + .AddSingleton, + PostConfigureApplicationCookieTicketStore>(); services.AddTransient(); services.AddTransient(); // only add if not already in DI diff --git a/bff/src/Bff/BffEndpointRouteBuilderExtensions.cs b/bff/src/Bff/BffEndpointRouteBuilderExtensions.cs index d814be164..feab6dd34 100644 --- a/bff/src/Bff/BffEndpointRouteBuilderExtensions.cs +++ b/bff/src/Bff/BffEndpointRouteBuilderExtensions.cs @@ -191,22 +191,16 @@ public static class BffEndpointRouteBuilderExtensions internal static bool AlreadyMappedManagementEndpoint( this IEndpointRouteBuilder endpoints, PathString route) => endpoints.DataSources.Any(ds => - ds.Endpoints - .OfType() - .Any(e => - e.RoutePattern.RawText == route.Value)); + ds.Endpoints + .OfType() + .Any(e => + e.RoutePattern.RawText == route.Value)); internal static void CheckLicense(this IEndpointRouteBuilder endpoints) => endpoints.ServiceProvider.CheckLicense(); internal static void CheckLicense(this IServiceProvider serviceProvider) { - var loggerFactory = serviceProvider.GetRequiredService(); - var options = serviceProvider.GetRequiredService>().Value; - var license = serviceProvider.GetRequiredService(); - if (!license.IsValid()) - { - // Todo, enforce license validation - } + license.CheckLicense(); } } diff --git a/bff/src/Bff/Configuration/BffOptions.cs b/bff/src/Bff/Configuration/BffOptions.cs index a605b79b3..3778706ce 100644 --- a/bff/src/Bff/Configuration/BffOptions.cs +++ b/bff/src/Bff/Configuration/BffOptions.cs @@ -179,4 +179,9 @@ public sealed class BffOptions /// public Collection AllowedSilentLoginReferers { get; } = new(); + /// + /// Options for diagnostics logging + /// + public DiagnosticsOptions Diagnostics { get; set; } = new(); + } diff --git a/bff/src/Bff/Configuration/DiagnosticsOptions.cs b/bff/src/Bff/Configuration/DiagnosticsOptions.cs new file mode 100644 index 000000000..657930edb --- /dev/null +++ b/bff/src/Bff/Configuration/DiagnosticsOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +namespace Duende.Bff.Configuration; + +/// +/// Options that control the way that diagnostic data is logged. +/// +public sealed class DiagnosticsOptions +{ + /// + /// Frequency at which diagnostic summaries are logged. + /// Defaults to 1 hour. + /// + public TimeSpan LogFrequency { get; set; } = TimeSpan.FromHours(1); + + /// + /// Max size of diagnostic data log message chunks in kilobytes. + /// Defaults to 8160 bytes. 8 KB is a conservative limit for the max size of a log message that is imposed by + /// some logging tools. We take 32 bytes less than that to allow for additional formatting of the log message. + /// + public int ChunkSize { get; set; } = 1024 * 8 - 32; +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticContext.cs b/bff/src/Bff/Diagnostics/DiagnosticContext.cs new file mode 100644 index 000000000..70d84f557 --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticContext.cs @@ -0,0 +1,6 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +namespace Duende.Bff.Diagnostics; + +internal record DiagnosticContext(DateTime ServerStartTime, DateTime CurrentServerTime); diff --git a/bff/src/Bff/Diagnostics/DiagnosticDataService.cs b/bff/src/Bff/Diagnostics/DiagnosticDataService.cs new file mode 100644 index 000000000..6c2f58848 --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticDataService.cs @@ -0,0 +1,30 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Buffers; +using System.Text.Json; + +namespace Duende.Bff.Diagnostics; + +internal class DiagnosticDataService(DateTime serverStartTime, IEnumerable entries) +{ + public async Task> GetJsonBytesAsync(CancellationToken cancellationToken = default) + { + var bufferWriter = new ArrayBufferWriter(); + await using var writer = new Utf8JsonWriter(bufferWriter, new JsonWriterOptions { Indented = false }); + + writer.WriteStartObject(); + + var diagnosticContext = new DiagnosticContext(serverStartTime, DateTime.UtcNow); + foreach (var diagnosticEntry in entries) + { + diagnosticEntry.Write(diagnosticContext, writer); + } + + writer.WriteEndObject(); + + await writer.FlushAsync(cancellationToken); + + return bufferWriter.WrittenMemory; + } +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticEntries/AssemblyInfoDiagnosticEntry.cs b/bff/src/Bff/Diagnostics/DiagnosticEntries/AssemblyInfoDiagnosticEntry.cs new file mode 100644 index 000000000..d13b054f3 --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticEntries/AssemblyInfoDiagnosticEntry.cs @@ -0,0 +1,63 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Reflection; +using System.Runtime.InteropServices; +using System.Runtime.Loader; +using System.Text.Json; + +namespace Duende.Bff.Diagnostics.DiagnosticEntries; + +internal class AssemblyInfoDiagnosticEntry : IDiagnosticEntry +{ + private readonly IReadOnlyList _exactMatches = + [ + "Microsoft.AspNetCore" + ]; + + private readonly IReadOnlyList _startsWithMatches = + [ + "Duende.", + "Microsoft.AspNetCore.Components.", + "Microsoft.AspNetCore.Authentication.", + "Microsoft.IdentityModel.", + "System.IdentityModel.", + "System.IdentityModel", + "Microsoft.EntityFrameworkCore", + ]; + + public void Write(DiagnosticContext _, Utf8JsonWriter writer) + { + var assemblies = GetAssemblyInfo(); + writer.WriteStartObject("AssemblyInfo"); + writer.WriteString("DotNetVersion", RuntimeInformation.FrameworkDescription); + writer.WriteString("BFF", + typeof(DiagnosticHostedService).Assembly.GetCustomAttribute()! + .InformationalVersion); + + writer.WriteStartArray("Assemblies"); + foreach (var assembly in assemblies.Where(assembly => assembly.GetName().Name != null && + (_exactMatches.Contains(assembly.GetName().Name) || + _startsWithMatches.Any(prefix => + assembly.GetName().Name!.StartsWith(prefix, + StringComparison.Ordinal))))) + { + writer.WriteStartObject(); + writer.WriteString("Name", assembly.GetName().Name); + writer.WriteString("Version", assembly.GetName().Version?.ToString() ?? "Unknown"); + writer.WriteEndObject(); + } + + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + private static List GetAssemblyInfo() + { + var assemblies = AssemblyLoadContext.Default.Assemblies + .OrderBy(a => a.FullName) + .ToList(); + + return assemblies; + } +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticEntries/BasicServerInfoDiagnosticEntry.cs b/bff/src/Bff/Diagnostics/DiagnosticEntries/BasicServerInfoDiagnosticEntry.cs new file mode 100644 index 000000000..ad09134df --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticEntries/BasicServerInfoDiagnosticEntry.cs @@ -0,0 +1,22 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Net; +using System.Text.Json; + +namespace Duende.Bff.Diagnostics.DiagnosticEntries; + +internal class BasicServerInfoDiagnosticEntry(TimeProvider timeProvider) + : IDiagnosticEntry +{ + public void Write(DiagnosticContext context, Utf8JsonWriter writer) + { + writer.WriteStartObject("BasicServerInfo"); + + writer.WriteString("HostName", Dns.GetHostName()); + writer.WriteString("ServerStartTime", context.ServerStartTime.ToString("o")); + writer.WriteString("CurrentServerTime", timeProvider.GetUtcNow().UtcDateTime.ToString("o")); + + writer.WriteEndObject(); + } +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticEntries/FrontendCountDiagnosticEntry.cs b/bff/src/Bff/Diagnostics/DiagnosticEntries/FrontendCountDiagnosticEntry.cs new file mode 100644 index 000000000..b05348442 --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticEntries/FrontendCountDiagnosticEntry.cs @@ -0,0 +1,14 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Text.Json; +using Duende.Bff.DynamicFrontends; + +namespace Duende.Bff.Diagnostics.DiagnosticEntries; + +internal class FrontendCountDiagnosticEntry(IFrontendCollection frontendCollection) + : IDiagnosticEntry +{ + public void Write(DiagnosticContext context, Utf8JsonWriter writer) => + writer.WriteNumber("FrontendCount", frontendCollection.Count); +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticHostedService.cs b/bff/src/Bff/Diagnostics/DiagnosticHostedService.cs new file mode 100644 index 000000000..5caf88634 --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticHostedService.cs @@ -0,0 +1,49 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using Duende.Bff.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace Duende.Bff.Diagnostics; + +internal class DiagnosticHostedService( + IOptions options, + DiagnosticSummary diagnosticsSummary, + ILogger logger, + TimeProvider timeProvider) : BackgroundService +{ + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + using var timer = new PeriodicTimer(options.Value.Diagnostics.LogFrequency, timeProvider); + try + { + while (!stoppingToken.IsCancellationRequested && await timer.WaitForNextTickAsync(stoppingToken)) + { + try + { + await diagnosticsSummary.PrintSummaryAsync(stoppingToken); + } +#pragma warning disable CA1031 + // Catching general exceptions here to prevent the host from crashing. + catch (Exception ex) +#pragma warning restore CA1031 + { + logger.FailedToLogDiagnosticsSummary(ex.Message); + } + } + } + catch (OperationCanceledException) + { + // When stopping this hosted service, "await timer.WaitForNextTickAsync(stoppingToken)" can throw an OperationCanceledException. + } + } + + public override async Task StopAsync(CancellationToken cancellationToken) + { + await diagnosticsSummary.PrintSummaryAsync(cancellationToken); + + await base.StopAsync(cancellationToken); + } +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticSummary.cs b/bff/src/Bff/Diagnostics/DiagnosticSummary.cs new file mode 100644 index 000000000..6ef3d55a4 --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticSummary.cs @@ -0,0 +1,41 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Text; +using Duende.Bff.Configuration; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace Duende.Bff.Diagnostics; + +internal class DiagnosticSummary( + DiagnosticDataService diagnosticDataService, + IOptions options, + ILoggerFactory loggerFactory) +{ + private readonly ILogger _logger = loggerFactory.CreateLogger("Duende.BFF.Diagnostics.Summary"); + + public async Task PrintSummaryAsync(CancellationToken cancellationToken = default) + { + var bffOptions = options.Value; + var jsonMemory = await diagnosticDataService.GetJsonBytesAsync(cancellationToken); + var span = jsonMemory.Span; + + var chunkSize = bffOptions.Diagnostics.ChunkSize; + if (span.Length > chunkSize) + { + var totalChunks = (span.Length + bffOptions.Diagnostics.ChunkSize - 1) / chunkSize; + for (var i = 0; i < totalChunks; i++) + { + var offset = i * chunkSize; + var length = Math.Min(chunkSize, span.Length - offset); + var chunk = span.Slice(offset, length); + _logger.DiagnosticSummaryLogged(i + 1, totalChunks, Encoding.UTF8.GetString(chunk)); + } + } + else + { + _logger.DiagnosticSummaryLogged(1, 1, Encoding.UTF8.GetString(span)); + } + } +} diff --git a/bff/src/Bff/Diagnostics/DiagnosticsLog.cs b/bff/src/Bff/Diagnostics/DiagnosticsLog.cs new file mode 100644 index 000000000..c410c508a --- /dev/null +++ b/bff/src/Bff/Diagnostics/DiagnosticsLog.cs @@ -0,0 +1,16 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +// using Microsoft.Extensions.Logging; +// +// namespace Duende.Bff.Diagnostics; +// +// internal static partial class DiagnosticsLog +// { +// [LoggerMessage(1, LogLevel.Information, "Diagnostic summary ({current}/{total}): {diagnosticData}")] +// internal static partial void DiagnosticSummaryLogged(this ILogger logger, int current, int total, +// string diagnosticData); +// +// [LoggerMessage(2, LogLevel.Warning, "An error occurred while logging the diagnostic summary: {Message}")] +// internal static partial void FailedToLogDiagnosticsSummary(this ILogger logger, string message); +// } diff --git a/bff/src/Bff/Diagnostics/IDiagnosticEntry.cs b/bff/src/Bff/Diagnostics/IDiagnosticEntry.cs new file mode 100644 index 000000000..17907a344 --- /dev/null +++ b/bff/src/Bff/Diagnostics/IDiagnosticEntry.cs @@ -0,0 +1,11 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Text.Json; + +namespace Duende.Bff.Diagnostics; + +internal interface IDiagnosticEntry +{ + public void Write(DiagnosticContext context, Utf8JsonWriter writer); +} diff --git a/bff/src/Bff/DynamicFrontends/Internal/FrontendCollection.cs b/bff/src/Bff/DynamicFrontends/Internal/FrontendCollection.cs index 0829ba3f2..abc43cd46 100644 --- a/bff/src/Bff/DynamicFrontends/Internal/FrontendCollection.cs +++ b/bff/src/Bff/DynamicFrontends/Internal/FrontendCollection.cs @@ -61,13 +61,6 @@ internal class FrontendCollection : IDisposable, IFrontendCollection .Where(frontend => oldFrontends.All(x => x.Name != frontend.Name)) .ToArray(); - var totalFrontends = oldFrontends.Length - removedFrontends.Length; - - foreach (var frontend in addedFrontends) - { - _licenseValidator.LogFrontendAdded(frontend.Name, ++totalFrontends); - } - Interlocked.Exchange(ref _frontends, newFrontends); } @@ -160,7 +153,7 @@ internal class FrontendCollection : IDisposable, IFrontendCollection public void AddOrUpdate(BffFrontend frontend) { var existingUpdated = false; - // Lock to avoid dirty writes from multiple threads. + // Lock to avoid dirty writes from multiple threads. lock (_syncRoot) { var existing = _frontends.FirstOrDefault(x => x.Name == frontend.Name); @@ -188,7 +181,6 @@ internal class FrontendCollection : IDisposable, IFrontendCollection } else { - _licenseValidator.LogFrontendAdded(frontend.Name, _frontends.Length); OnFrontendAdded(frontend); } diff --git a/bff/src/Bff/Licensing/GetLicenseKey.cs b/bff/src/Bff/Licensing/GetLicenseKey.cs new file mode 100644 index 000000000..bd64b1a67 --- /dev/null +++ b/bff/src/Bff/Licensing/GetLicenseKey.cs @@ -0,0 +1,6 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +namespace Duende.Bff.Licensing; + +internal delegate string? GetLicenseKey(); diff --git a/bff/src/Bff/Licensing/License.cs b/bff/src/Bff/Licensing/License.cs new file mode 100644 index 000000000..44c91c092 --- /dev/null +++ b/bff/src/Bff/Licensing/License.cs @@ -0,0 +1,72 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Diagnostics.CodeAnalysis; +using System.Security.Claims; + +namespace Duende.Bff.Licensing; + +/// +/// Models a Duende commercial license. +/// +internal class License +{ + /// + /// Initializes the license from the claims in a key. + /// + internal License(ClaimsPrincipal claims) + { + if (int.TryParse(claims.FindFirst(LicenseClaimTypes.Id)?.Value, out var id)) + { + SerialNumber = id; + } + + CompanyName = claims.FindFirst(LicenseClaimTypes.CompanyName)?.Value; + ContactInfo = claims.FindFirst(LicenseClaimTypes.ContactInfo)?.Value; + + if (long.TryParse(claims.FindFirst(LicenseClaimTypes.Expiration)?.Value, out var exp)) + { + Expiration = DateTimeOffset.FromUnixTimeSeconds(exp); + } + + // IsConfigured needs to be set prior to checking for clients and issuers claims or the Redistribution check will not return an appropriate value + IsConfigured = true; + } + + /// + /// The serial number + /// + public int? SerialNumber { get; init; } + + /// + /// The company name + /// + public string? CompanyName { get; init; } + + /// + /// The company contact info + /// + public string? ContactInfo { get; init; } + + /// + /// The license expiration + /// + public DateTimeOffset? Expiration { get; init; } + + /// + /// Extras + /// + public string? Extras { get; init; } + + /// + /// True if the license was configured in options or from a file, and false otherwise. + /// + [MemberNotNullWhen(true, + nameof(SerialNumber), + nameof(CompanyName), + nameof(ContactInfo), + nameof(Expiration), + nameof(Extras)) + ] + public bool IsConfigured { get; init; } +} diff --git a/bff/src/Bff/Licensing/LicenseAccessor.cs b/bff/src/Bff/Licensing/LicenseAccessor.cs new file mode 100644 index 000000000..cfd4cfa79 --- /dev/null +++ b/bff/src/Bff/Licensing/LicenseAccessor.cs @@ -0,0 +1,101 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using System.Security.Claims; +using System.Security.Cryptography; +using Microsoft.Extensions.Logging; +using Microsoft.IdentityModel.JsonWebTokens; +using Microsoft.IdentityModel.Tokens; + +namespace Duende.Bff.Licensing; + +/// +/// Loads the license from configuration or a file, and validates its contents. +/// +internal class LicenseAccessor(GetLicenseKey getLicenseKey, ILogger logger) +{ + private static readonly string[] LicenseFileNames = + [ + "Duende_License.key", + "Duende_IdentityServer_License.key", + ]; + + private License? _license; + private readonly object _lock = new(); + + public License Current => _license ??= Initialize(); + + private License Initialize() + { + lock (_lock) + { + if (_license != null) + { + return _license; + } + + var key = getLicenseKey() ?? LoadLicenseKeyFromFile(); + if (key == null) + { + return new License(new ClaimsPrincipal(new ClaimsIdentity())) + { + IsConfigured = false + }; + } + + var licenseClaims = ValidateKey(key); + return new License(new ClaimsPrincipal(new ClaimsIdentity(licenseClaims))); + } + } + + private static string? LoadLicenseKeyFromFile() + { + foreach (var name in LicenseFileNames) + { + var path = Path.Combine(Directory.GetCurrentDirectory(), name); + if (File.Exists(path)) + { + return File.ReadAllText(path).Trim(); + } + } + + return null; + } + + private Claim[] ValidateKey(string licenseKey) + { + var handler = new JsonWebTokenHandler(); + + var rsa = new RSAParameters + { + Exponent = Convert.FromBase64String("AQAB"), + Modulus = Convert.FromBase64String( + "tAHAfvtmGBng322TqUXF/Aar7726jFELj73lywuCvpGsh3JTpImuoSYsJxy5GZCRF7ppIIbsJBmWwSiesYfxWxBsfnpOmAHU3OTMDt383mf0USdqq/F0yFxBL9IQuDdvhlPfFcTrWEL0U2JsAzUjt9AfsPHNQbiEkOXlIwtNkqMP2naynW8y4WbaGG1n2NohyN6nfNb42KoNSR83nlbBJSwcc3heE3muTt3ZvbpguanyfFXeoP6yyqatnymWp/C0aQBEI5kDahOU641aDiSagG7zX1WaF9+hwfWCbkMDKYxeSWUkQOUOdfUQ89CQS5wrLpcU0D0xf7/SrRdY2TRHvQ=="), + }; + + var key = new RsaSecurityKey(rsa) + { + KeyId = "IdentityServerLicensekey/7ceadbb78130469e8806891025414f16" + }; + + var parms = new TokenValidationParameters + { + ValidIssuer = "https://duendesoftware.com", + ValidAudience = "IdentityServer", + IssuerSigningKey = key, + +#pragma warning disable CA5404 // CA5404: Do not use ValidateLifetime in TokenValidationParameters + // We're validating the lifetime somewhere else. + ValidateLifetime = false +#pragma warning restore CA5404 + }; + + var validateResult = handler.ValidateTokenAsync(licenseKey, parms).Result; + if (!validateResult.IsValid) + { + logger.ErrorValidatingLicenseKey(LogLevel.Error, validateResult.Exception); + } + + return validateResult.ClaimsIdentity?.Claims.ToArray() ?? []; + } +} diff --git a/bff/src/Bff/Licensing/LicenseClaimTypes.cs b/bff/src/Bff/Licensing/LicenseClaimTypes.cs new file mode 100644 index 000000000..d02c986a0 --- /dev/null +++ b/bff/src/Bff/Licensing/LicenseClaimTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +namespace Duende.Bff.Licensing; + +internal static class LicenseClaimTypes +{ + public const string Id = "id"; + public const string CompanyName = "company_name"; + public const string ContactInfo = "contact_info"; + public const string Expiration = "exp"; +} diff --git a/bff/src/Bff/Licensing/LicenseValidator.cs b/bff/src/Bff/Licensing/LicenseValidator.cs index ba01629d8..695cf739e 100644 --- a/bff/src/Bff/Licensing/LicenseValidator.cs +++ b/bff/src/Bff/Licensing/LicenseValidator.cs @@ -1,38 +1,33 @@ // Copyright (c) Duende Software. All rights reserved. // See LICENSE in the project root for license information. -using System.Globalization; using System.Security.Claims; -using Duende.Bff.DynamicFrontends; -using Duende.Private.Licensing; using Microsoft.Extensions.Logging; namespace Duende.Bff.Licensing; -internal class LicenseValidator(ILogger logger, BffLicense license, TimeProvider timeProvider) +internal class LicenseValidator(ILogger logger, License license, TimeProvider timeProvider) { internal LicenseValidator(ILogger logger, ClaimsPrincipal claims, TimeProvider timeProvider) - : this(logger, new BffLicense(claims), timeProvider) + : this(logger, new License(claims), timeProvider) { - } private bool? _licenseCheckResult; - public bool IsValid() + public bool CheckLicense() { if (_licenseCheckResult != null) { return _licenseCheckResult.Value; } - _licenseCheckResult = CheckLicense(); - return _licenseCheckResult.Value; + _licenseCheckResult = CheckLicenseValidity(); + return _licenseCheckResult.Value; } - private bool CheckLicense() + private bool CheckLicenseValidity() { - if (!license.IsConfigured) { logger.NoValidLicense(LogLevel.Error); @@ -41,55 +36,11 @@ internal class LicenseValidator(ILogger logger, BffLicense lic if (license.Expiration <= timeProvider.GetUtcNow()) { - logger.LicenseHasExpired(LogLevel.Error, license.Expiration, license.ContactInfo, license.CompanyName); + logger.LicenseHasExpired(LogLevel.Error, license.Expiration, license.ContactInfo ?? "", + license.CompanyName ?? ""); return false; } - if (!license.BffFeature) - { - logger.NotLicensedForBff(LogLevel.Error, license.ContactInfo, license.CompanyName); - return false; - } - - logger.LicenseDetails( - LogLevel.Debug, - license.Edition.ToString(), - license.Expiration, - license.ContactInfo, - license.CompanyName, - license.FrontendLimit switch - { - null => "not licensed for multi-frontend feature", - 0 => "not licensed for multi-frontend feature", - -1 => "unlimited", - > 0 => license.FrontendLimit.Value.ToString(CultureInfo.InvariantCulture), - // Should't happen, but just in case - _ => "not licensed for multi-frontend feature" - }); - return true; } - - public void LogFrontendAdded(BffFrontendName frontendName, int frontendCount) - { - if (license?.FrontendLimit == null) - { - logger.NotLicensedForMultiFrontend(LogLevel.Error, frontendName); - return; - } - if (license.FrontendLimit == -1) - { - // unlimited frontends - logger.UnlimitedFrontends(LogLevel.Debug, frontendName, frontendCount); - return; - } - - if (license.FrontendLimit < frontendCount) - { - logger.FrontendLimitExceeded(LogLevel.Error, frontendName, frontendCount, license.FrontendLimit.Value); - return; - } - - logger.FrontendAdded(LogLevel.Debug, frontendName, frontendCount, license.FrontendLimit.Value); - } } diff --git a/bff/src/Bff/Licensing/LicensingLogMessages.cs b/bff/src/Bff/Licensing/LicensingLogMessages.cs index ca487ecbe..cbb91f96a 100644 --- a/bff/src/Bff/Licensing/LicensingLogMessages.cs +++ b/bff/src/Bff/Licensing/LicensingLogMessages.cs @@ -2,9 +2,9 @@ // See LICENSE in the project root for license information. // using Microsoft.Extensions.Logging; - +// // namespace Duende.Bff.Licensing; - +// // internal static partial class LicensingLogMessages // { // [LoggerMessage( @@ -19,9 +19,9 @@ // public static partial void LicenseDetails(this ILogger logger, LogLevel level, string? edition, DateTimeOffset? expirationDate, string licenseContact, string licenseCompany, string? numberOfFrontends); // // [LoggerMessage( -// Message = """ -// Your license for Duende BFF Security Framework has expired on {ExpirationDate}. -// Please contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software, +// Message = $$""" +// Your license for the Duende Software has expired on {ExpirationDate}. +// Please contact {licenseContact} from {licenseCompany} to obtain a valid license for Duende software, // or start a conversation with us: https://duende.link/l/bff/contact // // See https://duende.link/l/bff/expired for more information. @@ -31,12 +31,10 @@ // // [LoggerMessage( // message: """ -// You do not have a valid license key for the Duende BFF Security Framework. -// When unlicensed, BFF will run in trial mode. It will limit the number of active sessions to 5. +// You do not have a valid license key for the Duende software. +// This is allowed for development and testing scenarios. // If you are running in production you are required to have a licensed version. -// Please start a conversation with us: https://duende.link/l/bff/contact -// -// See https://duende.link/l/bff/trial for more information. +// Please start a conversation with us: https://duende.link/l/contact" // """)] // public static partial void NoValidLicense(this ILogger logger, LogLevel logLevel); // diff --git a/bff/src/Bff/Otel/Generated/Microsoft.Gen.Logging/Microsoft.Gen.Logging.LoggingGenerator/Logging.g.cs b/bff/src/Bff/Otel/Generated/Microsoft.Gen.Logging/Microsoft.Gen.Logging.LoggingGenerator/Logging.g.cs index 5b6adf2ad..74aa4e6c2 100644 --- a/bff/src/Bff/Otel/Generated/Microsoft.Gen.Logging/Microsoft.Gen.Logging.LoggingGenerator/Logging.g.cs +++ b/bff/src/Bff/Otel/Generated/Microsoft.Gen.Logging/Microsoft.Gen.Logging.LoggingGenerator/Logging.g.cs @@ -5,14 +5,94 @@ using Microsoft.AspNetCore.Http; #pragma warning disable CS1591 // Compensate for https://github.com/dotnet/roslyn/issues/54103 +namespace Duende.Bff.Diagnostics +{ + internal static class DiagnosticsLog + { + /// + /// Logs "Diagnostic summary ({current}/{total}): {diagnosticData}" at "Information" level. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] + internal static void DiagnosticSummaryLogged(this global::Microsoft.Extensions.Logging.ILogger logger, int current, int total, string diagnosticData) + { + if (!logger.IsEnabled(global::Microsoft.Extensions.Logging.LogLevel.Information)) + { + return; + } + + var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; + + _ = state.ReserveTagSpace(4); + state.TagArray[3] = new("{OriginalFormat}", "Diagnostic summary ({current}/{total}): {diagnosticData}"); + state.TagArray[2] = new("current", current); + state.TagArray[1] = new("total", total); + state.TagArray[0] = new("diagnosticData", diagnosticData); + + logger.Log( + global::Microsoft.Extensions.Logging.LogLevel.Information, + new(1, nameof(DiagnosticSummaryLogged)), + state, + null, + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => + { + var current = s.TagArray[2].Value; + var total = s.TagArray[1].Value; + var diagnosticData = s.TagArray[0].Value ?? "(null)"; + #if NET + return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Diagnostic summary ({current}/{total}): {diagnosticData}"); + #else + return global::System.FormattableString.Invariant($"Diagnostic summary ({current}/{total}): {diagnosticData}"); + #endif + }); + + state.Clear(); + } + + /// + /// Logs "An error occurred while logging the diagnostic summary: {Message}" at "Warning" level. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] + internal static void FailedToLogDiagnosticsSummary(this global::Microsoft.Extensions.Logging.ILogger logger, string message) + { + if (!logger.IsEnabled(global::Microsoft.Extensions.Logging.LogLevel.Warning)) + { + return; + } + + var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; + + _ = state.ReserveTagSpace(2); + state.TagArray[1] = new("{OriginalFormat}", "An error occurred while logging the diagnostic summary: {Message}"); + state.TagArray[0] = new("Message", message); + + logger.Log( + global::Microsoft.Extensions.Logging.LogLevel.Warning, + new(2, nameof(FailedToLogDiagnosticsSummary)), + state, + null, + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => + { + var message = s.TagArray[0].Value ?? "(null)"; + #if NET + return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"An error occurred while logging the diagnostic summary: {message}"); + #else + return global::System.FormattableString.Invariant($"An error occurred while logging the diagnostic summary: {message}"); + #endif + }); + + state.Clear(); + } + } +} + namespace Duende.Bff.Licensing { internal static class LicensingLogMessages { /// - /// Logs "Duende BFF Security Framework License information:\r\n - Edition: {Edition}\r\n - Expiration: {ExpirationDate}\r\n - LicenseContact: {LicenseContact}\r\n - LicenseCompany: {licenseCompany} \r\n - Number of frontends licensed: {NumberOfFrontends}". + /// Logs "Duende BFF Security Framework License information:\r\n - Edition: {Edition}\r\n - Expiration: {ExpirationDate}\r\n - LicenseContact: {LicenseContact}\r\n - LicenseCompany: {licenseCompany}\r\n - Number of frontends licensed: {NumberOfFrontends}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LicenseDetails(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, string? edition, global::System.DateTimeOffset? expirationDate, string licenseContact, string licenseCompany, string? numberOfFrontends) { if (!logger.IsEnabled(level)) @@ -23,29 +103,29 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(6); - state.TagArray[5] = new("Edition", edition); - state.TagArray[4] = new("ExpirationDate", expirationDate); - state.TagArray[3] = new("LicenseContact", licenseContact); - state.TagArray[2] = new("licenseCompany", licenseCompany); - state.TagArray[1] = new("NumberOfFrontends", numberOfFrontends); - state.TagArray[0] = new("{OriginalFormat}", "Duende BFF Security Framework License information:\r\n - Edition: {Edition}\r\n - Expiration: {ExpirationDate}\r\n - LicenseContact: {LicenseContact}\r\n - LicenseCompany: {licenseCompany} \r\n - Number of frontends licensed: {NumberOfFrontends}"); + state.TagArray[5] = new("{OriginalFormat}", "Duende BFF Security Framework License information:\r\n - Edition: {Edition}\r\n - Expiration: {ExpirationDate}\r\n - LicenseContact: {LicenseContact}\r\n - LicenseCompany: {licenseCompany}\r\n - Number of frontends licensed: {NumberOfFrontends}"); + state.TagArray[4] = new("Edition", edition); + state.TagArray[3] = new("ExpirationDate", expirationDate); + state.TagArray[2] = new("LicenseContact", licenseContact); + state.TagArray[1] = new("licenseCompany", licenseCompany); + state.TagArray[0] = new("NumberOfFrontends", numberOfFrontends); logger.Log( level, - new(1205910631, nameof(LicenseDetails)), + new(1878989586, nameof(LicenseDetails)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var edition = s.TagArray[5].Value ?? "(null)"; - var expirationDate = s.TagArray[4].Value ?? "(null)"; - var licenseContact = s.TagArray[3].Value ?? "(null)"; - var licenseCompany = s.TagArray[2].Value ?? "(null)"; - var numberOfFrontends = s.TagArray[1].Value ?? "(null)"; + var edition = s.TagArray[4].Value ?? "(null)"; + var expirationDate = s.TagArray[3].Value ?? "(null)"; + var licenseContact = s.TagArray[2].Value ?? "(null)"; + var licenseCompany = s.TagArray[1].Value ?? "(null)"; + var numberOfFrontends = s.TagArray[0].Value ?? "(null)"; #if NET - return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Duende BFF Security Framework License information:\r\n - Edition: {edition}\r\n - Expiration: {expirationDate}\r\n - LicenseContact: {licenseContact}\r\n - LicenseCompany: {licenseCompany} \r\n - Number of frontends licensed: {numberOfFrontends}"); + return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Duende BFF Security Framework License information:\r\n - Edition: {edition}\r\n - Expiration: {expirationDate}\r\n - LicenseContact: {licenseContact}\r\n - LicenseCompany: {licenseCompany}\r\n - Number of frontends licensed: {numberOfFrontends}"); #else - return global::System.FormattableString.Invariant($"Duende BFF Security Framework License information:\r\n - Edition: {edition}\r\n - Expiration: {expirationDate}\r\n - LicenseContact: {licenseContact}\r\n - LicenseCompany: {licenseCompany} \r\n - Number of frontends licensed: {numberOfFrontends}"); + return global::System.FormattableString.Invariant($"Duende BFF Security Framework License information:\r\n - Edition: {edition}\r\n - Expiration: {expirationDate}\r\n - LicenseContact: {licenseContact}\r\n - LicenseCompany: {licenseCompany}\r\n - Number of frontends licensed: {numberOfFrontends}"); #endif }); @@ -53,9 +133,9 @@ namespace Duende.Bff.Licensing } /// - /// Logs "Your license for Duende BFF Security Framework has expired on {ExpirationDate}. \r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information.". + /// Logs "Your license for the Duende Software has expired on {ExpirationDate}.\r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LicenseHasExpired(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, global::System.DateTimeOffset? expirationDate, string licenseContact, string licenseCompany) { if (!logger.IsEnabled(level)) @@ -66,25 +146,25 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(4); - state.TagArray[3] = new("ExpirationDate", expirationDate); - state.TagArray[2] = new("licenseContact", licenseContact); - state.TagArray[1] = new("licenseCompany", licenseCompany); - state.TagArray[0] = new("{OriginalFormat}", "Your license for Duende BFF Security Framework has expired on {ExpirationDate}. \r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information."); + state.TagArray[3] = new("{OriginalFormat}", "Your license for the Duende Software has expired on {ExpirationDate}.\r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information."); + state.TagArray[2] = new("ExpirationDate", expirationDate); + state.TagArray[1] = new("licenseContact", licenseContact); + state.TagArray[0] = new("licenseCompany", licenseCompany); logger.Log( level, - new(1620871452, nameof(LicenseHasExpired)), + new(770251973, nameof(LicenseHasExpired)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var expirationDate = s.TagArray[3].Value ?? "(null)"; - var licenseContact = s.TagArray[2].Value ?? "(null)"; - var licenseCompany = s.TagArray[1].Value ?? "(null)"; + var expirationDate = s.TagArray[2].Value ?? "(null)"; + var licenseContact = s.TagArray[1].Value ?? "(null)"; + var licenseCompany = s.TagArray[0].Value ?? "(null)"; #if NET - return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Your license for Duende BFF Security Framework has expired on {expirationDate}. \r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information."); + return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Your license for the Duende Software has expired on {expirationDate}.\r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information."); #else - return global::System.FormattableString.Invariant($"Your license for Duende BFF Security Framework has expired on {expirationDate}. \r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information."); + return global::System.FormattableString.Invariant($"Your license for the Duende Software has expired on {expirationDate}.\r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/expired for more information."); #endif }); @@ -92,9 +172,9 @@ namespace Duende.Bff.Licensing } /// - /// Logs "You do not have a valid license key for the Duende BFF Security Framework.\r\nWhen unlicensed, BFF will run in trial mode. It will limit the number of active sessions to 5.\r\nIf you are running in production you are required to have a licensed version.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information.". + /// Logs "You do not have a valid license key for the Duende software.\r\nThis is allowed for development and testing scenarios.\r\nIf you are running in production you are required to have a licensed version.\r\nPlease start a conversation with us: https://duende.link/l/contact"". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoValidLicense(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -105,25 +185,25 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(1); - state.TagArray[0] = new("{OriginalFormat}", "You do not have a valid license key for the Duende BFF Security Framework.\r\nWhen unlicensed, BFF will run in trial mode. It will limit the number of active sessions to 5.\r\nIf you are running in production you are required to have a licensed version.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); + state.TagArray[0] = new("{OriginalFormat}", "You do not have a valid license key for the Duende software.\r\nThis is allowed for development and testing scenarios.\r\nIf you are running in production you are required to have a licensed version.\r\nPlease start a conversation with us: https://duende.link/l/contact\""); logger.Log( logLevel, - new(2083751822, nameof(NoValidLicense)), + new(767400809, nameof(NoValidLicense)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - return "You do not have a valid license key for the Duende BFF Security Framework.\r\nWhen unlicensed, BFF will run in trial mode. It will limit the number of active sessions to 5.\r\nIf you are running in production you are required to have a licensed version.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."; + return "You do not have a valid license key for the Duende software.\r\nThis is allowed for development and testing scenarios.\r\nIf you are running in production you are required to have a licensed version.\r\nPlease start a conversation with us: https://duende.link/l/contact\""; }); state.Clear(); } /// - /// Logs "Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5. \r\nPlease contact {LicenseContact} from {LicenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information.". + /// Logs "Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5.\r\nPlease contact {LicenseContact} from {LicenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NotLicensedForBff(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string licenseContact, string licenseCompany) { if (!logger.IsEnabled(logLevel)) @@ -134,23 +214,23 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("LicenseContact", licenseContact); - state.TagArray[1] = new("LicenseCompany", licenseCompany); - state.TagArray[0] = new("{OriginalFormat}", "Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5. \r\nPlease contact {LicenseContact} from {LicenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); + state.TagArray[2] = new("{OriginalFormat}", "Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5.\r\nPlease contact {LicenseContact} from {LicenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); + state.TagArray[1] = new("LicenseContact", licenseContact); + state.TagArray[0] = new("LicenseCompany", licenseCompany); logger.Log( logLevel, - new(616438795, nameof(NotLicensedForBff)), + new(792057768, nameof(NotLicensedForBff)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var licenseContact = s.TagArray[2].Value ?? "(null)"; - var licenseCompany = s.TagArray[1].Value ?? "(null)"; + var licenseContact = s.TagArray[1].Value ?? "(null)"; + var licenseCompany = s.TagArray[0].Value ?? "(null)"; #if NET - return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5. \r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); + return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5.\r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); #else - return global::System.FormattableString.Invariant($"Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5. \r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); + return global::System.FormattableString.Invariant($"Your license key does not include the BFF feature.\r\nBFF will run in trial mode. It will limit the number of active sessions to 5.\r\nPlease contact {licenseContact} from {licenseCompany} to obtain a valid license for the Duende software,\r\nor start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/trial for more information."); #endif }); @@ -160,7 +240,7 @@ namespace Duende.Bff.Licensing /// /// Logs "Error validating the license key.If you are running in production you are required to have a licensed version. Please start a conversation with us: https://duende.link/l/bff/contact". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ErrorValidatingLicenseKey(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -175,10 +255,10 @@ namespace Duende.Bff.Licensing logger.Log( logLevel, - new(1152327271, nameof(ErrorValidatingLicenseKey)), + new(197645874, nameof(ErrorValidatingLicenseKey)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Error validating the license key.If you are running in production you are required to have a licensed version. Please start a conversation with us: https://duende.link/l/bff/contact"; }); @@ -189,7 +269,7 @@ namespace Duende.Bff.Licensing /// /// Logs "Frontend #{FrontendsUsed} with name {FrontendName} was added. The license allows for unlimited frontends.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void UnlimitedFrontends(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string frontendName, int frontendsUsed) { if (!logger.IsEnabled(logLevel)) @@ -200,19 +280,19 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("FrontendName", frontendName); - state.TagArray[1] = new("FrontendsUsed", frontendsUsed); - state.TagArray[0] = new("{OriginalFormat}", "Frontend #{FrontendsUsed} with name {FrontendName} was added. The license allows for unlimited frontends."); + state.TagArray[2] = new("{OriginalFormat}", "Frontend #{FrontendsUsed} with name {FrontendName} was added. The license allows for unlimited frontends."); + state.TagArray[1] = new("FrontendName", frontendName); + state.TagArray[0] = new("FrontendsUsed", frontendsUsed); logger.Log( logLevel, - new(602507404, nameof(UnlimitedFrontends)), + new(1958275515, nameof(UnlimitedFrontends)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontendName = s.TagArray[2].Value ?? "(null)"; - var frontendsUsed = s.TagArray[1].Value; + var frontendName = s.TagArray[1].Value ?? "(null)"; + var frontendsUsed = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Frontend #{frontendsUsed} with name {frontendName} was added. The license allows for unlimited frontends."); #else @@ -226,7 +306,7 @@ namespace Duende.Bff.Licensing /// /// Logs "Frontend {FrontendName} was added. Currently using {frontendsUsed} of {frontendLimit} in the BFF License.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FrontendAdded(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string frontendName, int frontendsUsed, int frontendLimit) { if (!logger.IsEnabled(logLevel)) @@ -237,21 +317,21 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(4); - state.TagArray[3] = new("FrontendName", frontendName); - state.TagArray[2] = new("frontendsUsed", frontendsUsed); - state.TagArray[1] = new("frontendLimit", frontendLimit); - state.TagArray[0] = new("{OriginalFormat}", "Frontend {FrontendName} was added. Currently using {frontendsUsed} of {frontendLimit} in the BFF License."); + state.TagArray[3] = new("{OriginalFormat}", "Frontend {FrontendName} was added. Currently using {frontendsUsed} of {frontendLimit} in the BFF License."); + state.TagArray[2] = new("FrontendName", frontendName); + state.TagArray[1] = new("frontendsUsed", frontendsUsed); + state.TagArray[0] = new("frontendLimit", frontendLimit); logger.Log( logLevel, - new(429719596, nameof(FrontendAdded)), + new(231888333, nameof(FrontendAdded)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontendName = s.TagArray[3].Value ?? "(null)"; - var frontendsUsed = s.TagArray[2].Value; - var frontendLimit = s.TagArray[1].Value; + var frontendName = s.TagArray[2].Value ?? "(null)"; + var frontendsUsed = s.TagArray[1].Value; + var frontendLimit = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Frontend {frontendName} was added. Currently using {frontendsUsed} of {frontendLimit} in the BFF License."); #else @@ -265,7 +345,7 @@ namespace Duende.Bff.Licensing /// /// Logs "Frontend {FrontendName} was added. This exceeds the maximum number of frontends allowed by your license.\r\nCurrently using {frontendsUsed} of {frontendLimit} in the BFF License.\r\n\r\nSee https://duende.link/l/bff/threshold for more information.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FrontendLimitExceeded(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string frontendName, int frontendsUsed, int frontendLimit) { if (!logger.IsEnabled(logLevel)) @@ -276,21 +356,21 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(4); - state.TagArray[3] = new("FrontendName", frontendName); - state.TagArray[2] = new("frontendsUsed", frontendsUsed); - state.TagArray[1] = new("frontendLimit", frontendLimit); - state.TagArray[0] = new("{OriginalFormat}", "Frontend {FrontendName} was added. This exceeds the maximum number of frontends allowed by your license.\r\nCurrently using {frontendsUsed} of {frontendLimit} in the BFF License.\r\n\r\nSee https://duende.link/l/bff/threshold for more information."); + state.TagArray[3] = new("{OriginalFormat}", "Frontend {FrontendName} was added. This exceeds the maximum number of frontends allowed by your license.\r\nCurrently using {frontendsUsed} of {frontendLimit} in the BFF License.\r\n\r\nSee https://duende.link/l/bff/threshold for more information."); + state.TagArray[2] = new("FrontendName", frontendName); + state.TagArray[1] = new("frontendsUsed", frontendsUsed); + state.TagArray[0] = new("frontendLimit", frontendLimit); logger.Log( logLevel, - new(1163398776, nameof(FrontendLimitExceeded)), + new(438656937, nameof(FrontendLimitExceeded)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontendName = s.TagArray[3].Value ?? "(null)"; - var frontendsUsed = s.TagArray[2].Value; - var frontendLimit = s.TagArray[1].Value; + var frontendName = s.TagArray[2].Value ?? "(null)"; + var frontendsUsed = s.TagArray[1].Value; + var frontendLimit = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Frontend {frontendName} was added. This exceeds the maximum number of frontends allowed by your license.\r\nCurrently using {frontendsUsed} of {frontendLimit} in the BFF License.\r\n\r\nSee https://duende.link/l/bff/threshold for more information."); #else @@ -304,7 +384,7 @@ namespace Duende.Bff.Licensing /// /// Logs "Frontend {FrontendName} was added. However, your current license does not support multiple frontends.\r\nIf you are running in production you are required to have a license for each frontend.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/threshold for more information.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NotLicensedForMultiFrontend(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string frontendName) { if (!logger.IsEnabled(logLevel)) @@ -315,17 +395,17 @@ namespace Duende.Bff.Licensing var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("FrontendName", frontendName); - state.TagArray[0] = new("{OriginalFormat}", "Frontend {FrontendName} was added. However, your current license does not support multiple frontends.\r\nIf you are running in production you are required to have a license for each frontend.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/threshold for more information."); + state.TagArray[1] = new("{OriginalFormat}", "Frontend {FrontendName} was added. However, your current license does not support multiple frontends.\r\nIf you are running in production you are required to have a license for each frontend.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/threshold for more information."); + state.TagArray[0] = new("FrontendName", frontendName); logger.Log( logLevel, - new(483064138, nameof(NotLicensedForMultiFrontend)), + new(289456605, nameof(NotLicensedForMultiFrontend)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontendName = s.TagArray[1].Value ?? "(null)"; + var frontendName = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Frontend {frontendName} was added. However, your current license does not support multiple frontends.\r\nIf you are running in production you are required to have a license for each frontend.\r\nPlease start a conversation with us: https://duende.link/l/bff/contact\r\n\r\nSee https://duende.link/l/bff/threshold for more information."); #else @@ -345,7 +425,7 @@ namespace Duende.Bff.Otel /// /// Logs "Management URL request {Path} blocked with 404 response, because the implicit frontend is disabled.\r\n\r\nWhen you add multiple frontends, the implicit frontend is disabled. If you wish to create an implicit frontend,\r\nAdd one without Host or Path mapping.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ImplicitFrontendDisabled(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, global::Microsoft.AspNetCore.Http.PathString path) { if (!logger.IsEnabled(level)) @@ -356,17 +436,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Path", path.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Management URL request {Path} blocked with 404 response, because the implicit frontend is disabled.\r\n\r\nWhen you add multiple frontends, the implicit frontend is disabled. If you wish to create an implicit frontend,\r\nAdd one without Host or Path mapping."); + state.TagArray[1] = new("{OriginalFormat}", "Management URL request {Path} blocked with 404 response, because the implicit frontend is disabled.\r\n\r\nWhen you add multiple frontends, the implicit frontend is disabled. If you wish to create an implicit frontend,\r\nAdd one without Host or Path mapping."); + state.TagArray[0] = new("Path", path.ToString()); logger.Log( level, - new(469382589, nameof(ImplicitFrontendDisabled)), + new(646064610, nameof(ImplicitFrontendDisabled)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var path = s.TagArray[1].Value; + var path = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Management URL request {path} blocked with 404 response, because the implicit frontend is disabled.\r\n\r\nWhen you add multiple frontends, the implicit frontend is disabled. If you wish to create an implicit frontend,\r\nAdd one without Host or Path mapping."); #else @@ -380,7 +460,7 @@ namespace Duende.Bff.Otel /// /// Logs "Retrieved IndexHTML for {Frontend}. Statuscode was {StatusCode}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RetrievedIndexHTML(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend, global::System.Net.HttpStatusCode statusCode) { if (!logger.IsEnabled(level)) @@ -391,19 +471,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Frontend", frontend.ToString()); - state.TagArray[1] = new("StatusCode", statusCode); - state.TagArray[0] = new("{OriginalFormat}", "Retrieved IndexHTML for {Frontend}. Statuscode was {StatusCode}"); + state.TagArray[2] = new("{OriginalFormat}", "Retrieved IndexHTML for {Frontend}. Statuscode was {StatusCode}"); + state.TagArray[1] = new("Frontend", frontend.ToString()); + state.TagArray[0] = new("StatusCode", statusCode); logger.Log( level, - new(127338875, nameof(RetrievedIndexHTML)), + new(1828340680, nameof(RetrievedIndexHTML)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[2].Value; - var statusCode = s.TagArray[1].Value; + var frontend = s.TagArray[1].Value; + var statusCode = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Retrieved IndexHTML for {frontend}. Statuscode was {statusCode}"); #else @@ -417,7 +497,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to retrieve IndexHTML for {Frontend}. Statuscode was {StatusCode}. This result will not be cached.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void IndexHtmlRetrievalFailed(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend, global::System.Net.HttpStatusCode statusCode) { if (!logger.IsEnabled(level)) @@ -428,19 +508,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Frontend", frontend.ToString()); - state.TagArray[1] = new("StatusCode", statusCode); - state.TagArray[0] = new("{OriginalFormat}", "Failed to retrieve IndexHTML for {Frontend}. Statuscode was {StatusCode}. This result will not be cached."); + state.TagArray[2] = new("{OriginalFormat}", "Failed to retrieve IndexHTML for {Frontend}. Statuscode was {StatusCode}. This result will not be cached."); + state.TagArray[1] = new("Frontend", frontend.ToString()); + state.TagArray[0] = new("StatusCode", statusCode); logger.Log( level, - new(971421598, nameof(IndexHtmlRetrievalFailed)), + new(2144924891, nameof(IndexHtmlRetrievalFailed)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[2].Value; - var statusCode = s.TagArray[1].Value; + var frontend = s.TagArray[1].Value; + var statusCode = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to retrieve IndexHTML for {frontend}. Statuscode was {statusCode}. This result will not be cached."); #else @@ -454,7 +534,7 @@ namespace Duende.Bff.Otel /// /// Logs "Duplicate 'default' frontend configured. This is a frontend without an origin and path. The first one is used. ". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void DuplicateDefaultRouteConfigured(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level) { if (!logger.IsEnabled(level)) @@ -469,10 +549,10 @@ namespace Duende.Bff.Otel logger.Log( level, - new(1759121909, nameof(DuplicateDefaultRouteConfigured)), + new(177674312, nameof(DuplicateDefaultRouteConfigured)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Duplicate 'default' frontend configured. This is a frontend without an origin and path. The first one is used. "; }); @@ -483,7 +563,7 @@ namespace Duende.Bff.Otel /// /// Logs "Duplicate Frontend matching criteria registered. Frontend '{Frontend}' will be ignored because it collides with frontend '{duplicate}'.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FrontendWithSimilarMatchingCriteriaAlreadyRegistered(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend, global::Duende.Bff.DynamicFrontends.BffFrontendName duplicate) { if (!logger.IsEnabled(level)) @@ -494,19 +574,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Frontend", frontend.ToString()); - state.TagArray[1] = new("duplicate", duplicate.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Duplicate Frontend matching criteria registered. Frontend '{Frontend}' will be ignored because it collides with frontend '{duplicate}'."); + state.TagArray[2] = new("{OriginalFormat}", "Duplicate Frontend matching criteria registered. Frontend '{Frontend}' will be ignored because it collides with frontend '{duplicate}'."); + state.TagArray[1] = new("Frontend", frontend.ToString()); + state.TagArray[0] = new("duplicate", duplicate.ToString()); logger.Log( level, - new(875495101, nameof(FrontendWithSimilarMatchingCriteriaAlreadyRegistered)), + new(444679312, nameof(FrontendWithSimilarMatchingCriteriaAlreadyRegistered)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[2].Value; - var duplicate = s.TagArray[1].Value; + var frontend = s.TagArray[1].Value; + var duplicate = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Duplicate Frontend matching criteria registered. Frontend '{frontend}' will be ignored because it collides with frontend '{duplicate}'."); #else @@ -520,7 +600,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to apply yarp access token request transform.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToApplyYarpAccessTokenRequestTransform(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception ex, global::Microsoft.Extensions.Logging.LogLevel level) { if (!logger.IsEnabled(level)) @@ -535,10 +615,10 @@ namespace Duende.Bff.Otel logger.Log( level, - new(507886080, nameof(FailedToApplyYarpAccessTokenRequestTransform)), + new(575124767, nameof(FailedToApplyYarpAccessTokenRequestTransform)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Failed to apply yarp access token request transform."; }); @@ -549,7 +629,7 @@ namespace Duende.Bff.Otel /// /// Logs "AllowedSilentLoginReferrers have been configured but no referer header was found on silent login callback. Returning bad request. ". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SilentLoginEndpointRefererHeaderMissing(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level) { if (!logger.IsEnabled(level)) @@ -564,10 +644,10 @@ namespace Duende.Bff.Otel logger.Log( level, - new(1038547159, nameof(SilentLoginEndpointRefererHeaderMissing)), + new(1316852332, nameof(SilentLoginEndpointRefererHeaderMissing)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "AllowedSilentLoginReferrers have been configured but no referer header was found on silent login callback. Returning bad request. "; }); @@ -578,7 +658,7 @@ namespace Duende.Bff.Otel /// /// Logs "Referer {Referer} not in allowed referers: {AllowedReferers}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SilentLoginEndpointRefererNotAllowed(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, string referer, string allowedReferers) { if (!logger.IsEnabled(level)) @@ -589,19 +669,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Referer", referer); - state.TagArray[1] = new("AllowedReferers", allowedReferers); - state.TagArray[0] = new("{OriginalFormat}", "Referer {Referer} not in allowed referers: {AllowedReferers}"); + state.TagArray[2] = new("{OriginalFormat}", "Referer {Referer} not in allowed referers: {AllowedReferers}"); + state.TagArray[1] = new("Referer", referer); + state.TagArray[0] = new("AllowedReferers", allowedReferers); logger.Log( level, - new(91029881, nameof(SilentLoginEndpointRefererNotAllowed)), + new(21879938, nameof(SilentLoginEndpointRefererNotAllowed)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var referer = s.TagArray[2].Value ?? "(null)"; - var allowedReferers = s.TagArray[1].Value ?? "(null)"; + var referer = s.TagArray[1].Value ?? "(null)"; + var allowedReferers = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Referer {referer} not in allowed referers: {allowedReferers}"); #else @@ -615,7 +695,7 @@ namespace Duende.Bff.Otel /// /// Logs "Proxy response error. Path: '{Path}', error: '{Error}'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProxyResponseError(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel level, string path, string error) { if (!logger.IsEnabled(level)) @@ -626,19 +706,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Path", path); - state.TagArray[1] = new("Error", error); - state.TagArray[0] = new("{OriginalFormat}", "Proxy response error. Path: '{Path}', error: '{Error}'"); + state.TagArray[2] = new("{OriginalFormat}", "Proxy response error. Path: '{Path}', error: '{Error}'"); + state.TagArray[1] = new("Path", path); + state.TagArray[0] = new("Error", error); logger.Log( level, - new(387163085, nameof(ProxyResponseError)), + new(1910499378, nameof(ProxyResponseError)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var path = s.TagArray[2].Value ?? "(null)"; - var error = s.TagArray[1].Value ?? "(null)"; + var path = s.TagArray[1].Value ?? "(null)"; + var error = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Proxy response error. Path: '{path}', error: '{error}'"); #else @@ -652,8 +732,8 @@ namespace Duende.Bff.Otel /// /// Logs "Deserializing AuthenticationTicket envelope failed or found incorrect version for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] - internal static void AuthenticationTicketEnvelopeVersionInvalid(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.SessionManagement.SessionStore.UserSessionKey key) + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] + public static void AuthenticationTicketEnvelopeVersionInvalid(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.SessionManagement.SessionStore.UserSessionKey key) { if (!logger.IsEnabled(logLevel)) { @@ -663,17 +743,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Deserializing AuthenticationTicket envelope failed or found incorrect version for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "Deserializing AuthenticationTicket envelope failed or found incorrect version for key {Key}"); + state.TagArray[0] = new("Key", key.ToString()); logger.Log( logLevel, - new(354836767, nameof(AuthenticationTicketEnvelopeVersionInvalid)), + new(958878518, nameof(AuthenticationTicketEnvelopeVersionInvalid)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value; + var key = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Deserializing AuthenticationTicket envelope failed or found incorrect version for key {key}"); #else @@ -687,7 +767,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to unprotect AuthenticationTicket payload for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void AuthenticationTicketPayloadInvalid(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception? ex, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.SessionManagement.SessionStore.UserSessionKey key) { if (!logger.IsEnabled(logLevel)) @@ -698,17 +778,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Failed to unprotect AuthenticationTicket payload for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "Failed to unprotect AuthenticationTicket payload for key {Key}"); + state.TagArray[0] = new("Key", key.ToString()); logger.Log( logLevel, - new(863664585, nameof(AuthenticationTicketPayloadInvalid)), + new(234891412, nameof(AuthenticationTicketPayloadInvalid)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value; + var key = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to unprotect AuthenticationTicket payload for key {key}"); #else @@ -722,7 +802,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to deserialize AuthenticationTicket payload for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void AuthenticationTicketFailedToDeserialize(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.Exception? ex, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.SessionManagement.SessionStore.UserSessionKey key) { if (!logger.IsEnabled(logLevel)) @@ -733,17 +813,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Failed to deserialize AuthenticationTicket payload for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "Failed to deserialize AuthenticationTicket payload for key {Key}"); + state.TagArray[0] = new("Key", key.ToString()); logger.Log( logLevel, - new(245709081, nameof(AuthenticationTicketFailedToDeserialize)), + new(1204051220, nameof(AuthenticationTicketFailedToDeserialize)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value; + var key = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to deserialize AuthenticationTicket payload for key {key}"); #else @@ -757,7 +837,7 @@ namespace Duende.Bff.Otel /// /// Logs "FrontendSelection: No frontends registered in the store.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoFrontendsRegistered(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -772,10 +852,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1060368318, nameof(NoFrontendsRegistered)), + new(815977895, nameof(NoFrontendsRegistered)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "FrontendSelection: No frontends registered in the store."; }); @@ -786,7 +866,7 @@ namespace Duende.Bff.Otel /// /// Logs "Invalid prompt value {Prompt}.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void InvalidPromptValue(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string prompt) { if (!logger.IsEnabled(logLevel)) @@ -797,17 +877,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Prompt", prompt); - state.TagArray[0] = new("{OriginalFormat}", "Invalid prompt value {Prompt}."); + state.TagArray[1] = new("{OriginalFormat}", "Invalid prompt value {Prompt}."); + state.TagArray[0] = new("Prompt", prompt); logger.Log( logLevel, - new(1772992930, nameof(InvalidPromptValue)), + new(633713241, nameof(InvalidPromptValue)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var prompt = s.TagArray[1].Value ?? "(null)"; + var prompt = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Invalid prompt value {prompt}."); #else @@ -821,7 +901,7 @@ namespace Duende.Bff.Otel /// /// Logs "Invalid return url {Url}.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void InvalidReturnUrl(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string url) { if (!logger.IsEnabled(logLevel)) @@ -832,17 +912,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Url", url); - state.TagArray[0] = new("{OriginalFormat}", "Invalid return url {Url}."); + state.TagArray[1] = new("{OriginalFormat}", "Invalid return url {Url}."); + state.TagArray[0] = new("Url", url); logger.Log( logLevel, - new(1864635278, nameof(InvalidReturnUrl)), + new(458705031, nameof(InvalidReturnUrl)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var url = s.TagArray[1].Value ?? "(null)"; + var url = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Invalid return url {url}."); #else @@ -856,7 +936,7 @@ namespace Duende.Bff.Otel /// /// Logs "Invalid sid {Sid}.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void InvalidSid(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sid) { if (!logger.IsEnabled(logLevel)) @@ -867,17 +947,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Invalid sid {Sid}."); + state.TagArray[1] = new("{OriginalFormat}", "Invalid sid {Sid}."); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(1519240679, nameof(InvalidSid)), + new(569388796, nameof(InvalidSid)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sid = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Invalid sid {sid}."); #else @@ -891,7 +971,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed To clear IndexHtmlCache for BFF Frontend {Frontend}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToClearIndexHtmlCacheForFrontend(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend) { if (!logger.IsEnabled(logLevel)) @@ -902,17 +982,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Frontend", frontend.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Failed To clear IndexHtmlCache for BFF Frontend {Frontend}"); + state.TagArray[1] = new("{OriginalFormat}", "Failed To clear IndexHtmlCache for BFF Frontend {Frontend}"); + state.TagArray[0] = new("Frontend", frontend.ToString()); logger.Log( logLevel, - new(711926561, nameof(FailedToClearIndexHtmlCacheForFrontend)), + new(1535143738, nameof(FailedToClearIndexHtmlCacheForFrontend)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[1].Value; + var frontend = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed To clear IndexHtmlCache for BFF Frontend {frontend}"); #else @@ -926,7 +1006,7 @@ namespace Duende.Bff.Otel /// /// Logs "No OpenID Configuration found for scheme {Scheme}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoOpenIdConfigurationFoundForScheme(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.AccessTokenManagement.Scheme scheme) { if (!logger.IsEnabled(logLevel)) @@ -937,17 +1017,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Scheme", scheme.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "No OpenID Configuration found for scheme {Scheme}"); + state.TagArray[1] = new("{OriginalFormat}", "No OpenID Configuration found for scheme {Scheme}"); + state.TagArray[0] = new("Scheme", scheme.ToString()); logger.Log( logLevel, - new(422555722, nameof(NoOpenIdConfigurationFoundForScheme)), + new(946850851, nameof(NoOpenIdConfigurationFoundForScheme)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var scheme = s.TagArray[1].Value; + var scheme = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"No OpenID Configuration found for scheme {scheme}"); #else @@ -961,7 +1041,7 @@ namespace Duende.Bff.Otel /// /// Logs "No frontend selected: None of the configured frontends matched the matching criteria.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoFrontendSelected(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -976,10 +1056,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1087834562, nameof(NoFrontendSelected)), + new(101163333, nameof(NoFrontendSelected)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "No frontend selected: None of the configured frontends matched the matching criteria."; }); @@ -990,7 +1070,7 @@ namespace Duende.Bff.Otel /// /// Logs "BFF is not configured to work with multiple frontends. No frontend is currently selected. ". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void MultiFrontendDisabled(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -1005,10 +1085,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1555283577, nameof(MultiFrontendDisabled)), + new(356331886, nameof(MultiFrontendDisabled)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "BFF is not configured to work with multiple frontends. No frontend is currently selected. "; }); @@ -1019,7 +1099,7 @@ namespace Duende.Bff.Otel /// /// Logs "Selected frontend '{Frontend}'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SelectedFrontend(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend) { if (!logger.IsEnabled(logLevel)) @@ -1030,17 +1110,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Frontend", frontend.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Selected frontend '{Frontend}'"); + state.TagArray[1] = new("{OriginalFormat}", "Selected frontend '{Frontend}'"); + state.TagArray[0] = new("Frontend", frontend.ToString()); logger.Log( logLevel, - new(1602197389, nameof(SelectedFrontend)), + new(1069185056, nameof(SelectedFrontend)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[1].Value; + var frontend = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Selected frontend '{frontend}'"); #else @@ -1054,7 +1134,7 @@ namespace Duende.Bff.Otel /// /// Logs "Anti-forgery validation failed. Path: '{Path}'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void AntiForgeryValidationFailed(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string path) { if (!logger.IsEnabled(logLevel)) @@ -1065,17 +1145,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Path", path); - state.TagArray[0] = new("{OriginalFormat}", "Anti-forgery validation failed. Path: '{Path}'"); + state.TagArray[1] = new("{OriginalFormat}", "Anti-forgery validation failed. Path: '{Path}'"); + state.TagArray[0] = new("Path", path); logger.Log( logLevel, - new(146559854, nameof(AntiForgeryValidationFailed)), + new(16433013, nameof(AntiForgeryValidationFailed)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var path = s.TagArray[1].Value ?? "(null)"; + var path = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Anti-forgery validation failed. Path: '{path}'"); #else @@ -1089,7 +1169,7 @@ namespace Duende.Bff.Otel /// /// Logs "Back-channel logout. sub: '{Sub}', sid: '{Sid}'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void BackChannelLogout(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sub, string sid) { if (!logger.IsEnabled(logLevel)) @@ -1100,19 +1180,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Back-channel logout. sub: '{Sub}', sid: '{Sid}'"); + state.TagArray[2] = new("{OriginalFormat}", "Back-channel logout. sub: '{Sub}', sid: '{Sid}'"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(920465342, nameof(BackChannelLogout)), + new(530582699, nameof(BackChannelLogout)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Back-channel logout. sub: '{sub}', sid: '{sid}'"); #else @@ -1126,7 +1206,7 @@ namespace Duende.Bff.Otel /// /// Logs "Access token is missing. token type: '{TokenType}', Path: '{Path}', detail: '{Detail}'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void AccessTokenMissing(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string tokenType, string path, string detail) { if (!logger.IsEnabled(logLevel)) @@ -1137,21 +1217,21 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(4); - state.TagArray[3] = new("TokenType", tokenType); - state.TagArray[2] = new("Path", path); - state.TagArray[1] = new("Detail", detail); - state.TagArray[0] = new("{OriginalFormat}", "Access token is missing. token type: '{TokenType}', Path: '{Path}', detail: '{Detail}'"); + state.TagArray[3] = new("{OriginalFormat}", "Access token is missing. token type: '{TokenType}', Path: '{Path}', detail: '{Detail}'"); + state.TagArray[2] = new("TokenType", tokenType); + state.TagArray[1] = new("Path", path); + state.TagArray[0] = new("Detail", detail); logger.Log( logLevel, - new(687218971, nameof(AccessTokenMissing)), + new(1607445224, nameof(AccessTokenMissing)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var tokenType = s.TagArray[3].Value ?? "(null)"; - var path = s.TagArray[2].Value ?? "(null)"; - var detail = s.TagArray[1].Value ?? "(null)"; + var tokenType = s.TagArray[2].Value ?? "(null)"; + var path = s.TagArray[1].Value ?? "(null)"; + var detail = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Access token is missing. token type: '{tokenType}', Path: '{path}', detail: '{detail}'"); #else @@ -1165,7 +1245,7 @@ namespace Duende.Bff.Otel /// /// Logs "Invalid route configuration. Cannot combine a required access token (a call to WithAccessToken) and an optional access token (a call to WithOptionalUserAccessToken). clusterId: '{ClusterId}', routeId: '{RouteId}'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void InvalidRouteConfiguration(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? clusterId, string routeId) { if (!logger.IsEnabled(logLevel)) @@ -1176,19 +1256,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("ClusterId", clusterId); - state.TagArray[1] = new("RouteId", routeId); - state.TagArray[0] = new("{OriginalFormat}", "Invalid route configuration. Cannot combine a required access token (a call to WithAccessToken) and an optional access token (a call to WithOptionalUserAccessToken). clusterId: '{ClusterId}', routeId: '{RouteId}'"); + state.TagArray[2] = new("{OriginalFormat}", "Invalid route configuration. Cannot combine a required access token (a call to WithAccessToken) and an optional access token (a call to WithOptionalUserAccessToken). clusterId: '{ClusterId}', routeId: '{RouteId}'"); + state.TagArray[1] = new("ClusterId", clusterId); + state.TagArray[0] = new("RouteId", routeId); logger.Log( logLevel, - new(1891888800, nameof(InvalidRouteConfiguration)), + new(245007841, nameof(InvalidRouteConfiguration)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var clusterId = s.TagArray[2].Value ?? "(null)"; - var routeId = s.TagArray[1].Value ?? "(null)"; + var clusterId = s.TagArray[1].Value ?? "(null)"; + var routeId = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Invalid route configuration. Cannot combine a required access token (a call to WithAccessToken) and an optional access token (a call to WithOptionalUserAccessToken). clusterId: '{clusterId}', routeId: '{routeId}'"); #else @@ -1202,7 +1282,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to request new User Access Token due to: {Error}. This can mean that the refresh token is expired or revoked but the cookie session is still active. If the session was not revoked, ensure that the session cookie lifetime is smaller than the refresh token lifetime.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToRequestNewUserAccessToken(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string error) { if (!logger.IsEnabled(logLevel)) @@ -1213,17 +1293,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Error", error); - state.TagArray[0] = new("{OriginalFormat}", "Failed to request new User Access Token due to: {Error}. This can mean that the refresh token is expired or revoked but the cookie session is still active. If the session was not revoked, ensure that the session cookie lifetime is smaller than the refresh token lifetime."); + state.TagArray[1] = new("{OriginalFormat}", "Failed to request new User Access Token due to: {Error}. This can mean that the refresh token is expired or revoked but the cookie session is still active. If the session was not revoked, ensure that the session cookie lifetime is smaller than the refresh token lifetime."); + state.TagArray[0] = new("Error", error); logger.Log( logLevel, - new(39149415, nameof(FailedToRequestNewUserAccessToken)), + new(2131134334, nameof(FailedToRequestNewUserAccessToken)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var error = s.TagArray[1].Value ?? "(null)"; + var error = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to request new User Access Token due to: {error}. This can mean that the refresh token is expired or revoked but the cookie session is still active. If the session was not revoked, ensure that the session cookie lifetime is smaller than the refresh token lifetime."); #else @@ -1237,7 +1317,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to request new User Access Token due to: {Error}. This likely means that the user's refresh token is expired or revoked. The user's session will be ended, which will force the user to log in.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void UserSessionRevoked(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string error) { if (!logger.IsEnabled(logLevel)) @@ -1248,17 +1328,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Error", error); - state.TagArray[0] = new("{OriginalFormat}", "Failed to request new User Access Token due to: {Error}. This likely means that the user's refresh token is expired or revoked. The user's session will be ended, which will force the user to log in."); + state.TagArray[1] = new("{OriginalFormat}", "Failed to request new User Access Token due to: {Error}. This likely means that the user's refresh token is expired or revoked. The user's session will be ended, which will force the user to log in."); + state.TagArray[0] = new("Error", error); logger.Log( logLevel, - new(804513411, nameof(UserSessionRevoked)), + new(1313108000, nameof(UserSessionRevoked)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var error = s.TagArray[1].Value ?? "(null)"; + var error = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to request new User Access Token due to: {error}. This likely means that the user's refresh token is expired or revoked. The user's session will be ended, which will force the user to log in."); #else @@ -1272,7 +1352,7 @@ namespace Duende.Bff.Otel /// /// Logs "BFF management endpoint {endpoint} is only intended for a browser window to request and load. It is not intended to be accessed with Ajax or fetch requests.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ManagementEndpointAccessedViaAjax(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string endpoint) { if (!logger.IsEnabled(logLevel)) @@ -1283,17 +1363,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("endpoint", endpoint); - state.TagArray[0] = new("{OriginalFormat}", "BFF management endpoint {endpoint} is only intended for a browser window to request and load. It is not intended to be accessed with Ajax or fetch requests."); + state.TagArray[1] = new("{OriginalFormat}", "BFF management endpoint {endpoint} is only intended for a browser window to request and load. It is not intended to be accessed with Ajax or fetch requests."); + state.TagArray[0] = new("endpoint", endpoint); logger.Log( logLevel, - new(441059535, nameof(ManagementEndpointAccessedViaAjax)), + new(1588002554, nameof(ManagementEndpointAccessedViaAjax)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var endpoint = s.TagArray[1].Value ?? "(null)"; + var endpoint = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"BFF management endpoint {endpoint} is only intended for a browser window to request and load. It is not intended to be accessed with Ajax or fetch requests."); #else @@ -1307,7 +1387,7 @@ namespace Duende.Bff.Otel /// /// Logs "Challenge was called for a BFF API endpoint, BFF response handling changing status code to 401.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ChallengeForBffApiEndpoint(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -1322,10 +1402,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(642681511, nameof(ChallengeForBffApiEndpoint)), + new(1068428514, nameof(ChallengeForBffApiEndpoint)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Challenge was called for a BFF API endpoint, BFF response handling changing status code to 401."; }); @@ -1336,7 +1416,7 @@ namespace Duende.Bff.Otel /// /// Logs "Forbid was called for a BFF API endpoint, BFF response handling changing status code to 403.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ForbidForBffApiEndpoint(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -1351,10 +1431,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(655421072, nameof(ForbidForBffApiEndpoint)), + new(568631999, nameof(ForbidForBffApiEndpoint)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Forbid was called for a BFF API endpoint, BFF response handling changing status code to 403."; }); @@ -1365,7 +1445,7 @@ namespace Duende.Bff.Otel /// /// Logs "Creating user session record in store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void CreatingUserSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -1376,19 +1456,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Creating user session record in store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Creating user session record in store for sub {Sub} sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(1874888402, nameof(CreatingUserSession)), + new(1880151499, nameof(CreatingUserSession)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Creating user session record in store for sub {sub} sid {sid}"); #else @@ -1402,7 +1482,7 @@ namespace Duende.Bff.Otel /// /// Logs "Detected a duplicate insert of the same session. This can happen when multiple browser tabs are open and can safely be ignored.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void DuplicateSessionInsertDetected(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception? ex = null) { if (!logger.IsEnabled(logLevel)) @@ -1417,10 +1497,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(83103844, nameof(DuplicateSessionInsertDetected)), + new(1718098917, nameof(DuplicateSessionInsertDetected)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Detected a duplicate insert of the same session. This can happen when multiple browser tabs are open and can safely be ignored."; }); @@ -1431,7 +1511,7 @@ namespace Duende.Bff.Otel /// /// Logs "Exception creating new server-side session in database: {Error}. If this is a duplicate key error, it's safe to ignore. This can happen (for example) when two identical tabs are open.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ExceptionCreatingSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex, string error) { if (!logger.IsEnabled(logLevel)) @@ -1442,17 +1522,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Error", error); - state.TagArray[0] = new("{OriginalFormat}", "Exception creating new server-side session in database: {Error}. If this is a duplicate key error, it's safe to ignore. This can happen (for example) when two identical tabs are open."); + state.TagArray[1] = new("{OriginalFormat}", "Exception creating new server-side session in database: {Error}. If this is a duplicate key error, it's safe to ignore. This can happen (for example) when two identical tabs are open."); + state.TagArray[0] = new("Error", error); logger.Log( logLevel, - new(54160514, nameof(ExceptionCreatingSession)), + new(768029607, nameof(ExceptionCreatingSession)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var error = s.TagArray[1].Value ?? "(null)"; + var error = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Exception creating new server-side session in database: {error}. If this is a duplicate key error, it's safe to ignore. This can happen (for example) when two identical tabs are open."); #else @@ -1466,7 +1546,7 @@ namespace Duende.Bff.Otel /// /// Logs "No record found in user session store when trying to delete user session for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoRecordFoundForKey(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.SessionManagement.SessionStore.UserSessionKey key) { if (!logger.IsEnabled(logLevel)) @@ -1477,17 +1557,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "No record found in user session store when trying to delete user session for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "No record found in user session store when trying to delete user session for key {Key}"); + state.TagArray[0] = new("Key", key.ToString()); logger.Log( logLevel, - new(1160496550, nameof(NoRecordFoundForKey)), + new(657599571, nameof(NoRecordFoundForKey)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value; + var key = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"No record found in user session store when trying to delete user session for key {key}"); #else @@ -1501,7 +1581,7 @@ namespace Duende.Bff.Otel /// /// Logs "Deleting user session record in store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void DeletingUserSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -1512,19 +1592,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Deleting user session record in store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Deleting user session record in store for sub {Sub} sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(959361069, nameof(DeletingUserSession)), + new(604800898, nameof(DeletingUserSession)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Deleting user session record in store for sub {sub} sid {sid}"); #else @@ -1538,7 +1618,7 @@ namespace Duende.Bff.Otel /// /// Logs "DbUpdateConcurrencyException: {Error}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void DbUpdateConcurrencyException(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string error) { if (!logger.IsEnabled(logLevel)) @@ -1549,17 +1629,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Error", error); - state.TagArray[0] = new("{OriginalFormat}", "DbUpdateConcurrencyException: {Error}"); + state.TagArray[1] = new("{OriginalFormat}", "DbUpdateConcurrencyException: {Error}"); + state.TagArray[0] = new("Error", error); logger.Log( logLevel, - new(1569080331, nameof(DbUpdateConcurrencyException)), + new(1856473546, nameof(DbUpdateConcurrencyException)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var error = s.TagArray[1].Value ?? "(null)"; + var error = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"DbUpdateConcurrencyException: {error}"); #else @@ -1573,7 +1653,7 @@ namespace Duende.Bff.Otel /// /// Logs "Getting user session record from store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void GettingUserSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -1584,19 +1664,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Getting user session record from store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Getting user session record from store for sub {Sub} sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(1913398477, nameof(GettingUserSession)), + new(370854000, nameof(GettingUserSession)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Getting user session record from store for sub {sub} sid {sid}"); #else @@ -1610,7 +1690,7 @@ namespace Duende.Bff.Otel /// /// Logs "Getting {Count} user session(s) from store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void GettingUserSessions(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, int count, string? sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -1621,21 +1701,21 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(4); - state.TagArray[3] = new("Count", count); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Getting {Count} user session(s) from store for sub {Sub} sid {Sid}"); + state.TagArray[3] = new("{OriginalFormat}", "Getting {Count} user session(s) from store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("Count", count); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(326910376, nameof(GettingUserSessions)), + new(819405639, nameof(GettingUserSessions)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var count = s.TagArray[3].Value; - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var count = s.TagArray[2].Value; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Getting {count} user session(s) from store for sub {sub} sid {sid}"); #else @@ -1649,7 +1729,7 @@ namespace Duende.Bff.Otel /// /// Logs "Deleting {Count} user session(s) from store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void DeletingUserSessions(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, int count, string? sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -1660,21 +1740,21 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(4); - state.TagArray[3] = new("Count", count); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Deleting {Count} user session(s) from store for sub {Sub} sid {Sid}"); + state.TagArray[3] = new("{OriginalFormat}", "Deleting {Count} user session(s) from store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("Count", count); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(1394785822, nameof(DeletingUserSessions)), + new(1296432247, nameof(DeletingUserSessions)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var count = s.TagArray[3].Value; - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var count = s.TagArray[2].Value; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Deleting {count} user session(s) from store for sub {sub} sid {sid}"); #else @@ -1688,7 +1768,7 @@ namespace Duende.Bff.Otel /// /// Logs "Updating user session record in store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void UpdatingUserSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -1699,19 +1779,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Updating user session record in store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Updating user session record in store for sub {Sub} sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(40359619, nameof(UpdatingUserSession)), + new(1237750320, nameof(UpdatingUserSession)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Updating user session record in store for sub {sub} sid {sid}"); #else @@ -1725,7 +1805,7 @@ namespace Duende.Bff.Otel /// /// Logs "Removing {Count} server side sessions". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RemovingServerSideSessions(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, int count) { if (!logger.IsEnabled(logLevel)) @@ -1736,17 +1816,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Count", count); - state.TagArray[0] = new("{OriginalFormat}", "Removing {Count} server side sessions"); + state.TagArray[1] = new("{OriginalFormat}", "Removing {Count} server side sessions"); + state.TagArray[0] = new("Count", count); logger.Log( logLevel, - new(1803003422, nameof(RemovingServerSideSessions)), + new(516689623, nameof(RemovingServerSideSessions)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var count = s.TagArray[1].Value; + var count = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Removing {count} server side sessions"); #else @@ -1760,7 +1840,7 @@ namespace Duende.Bff.Otel /// /// Logs "Retrieving token for user {User}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RetrievingTokenForUser(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? user) { if (!logger.IsEnabled(logLevel)) @@ -1771,17 +1851,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("User", user); - state.TagArray[0] = new("{OriginalFormat}", "Retrieving token for user {User}"); + state.TagArray[1] = new("{OriginalFormat}", "Retrieving token for user {User}"); + state.TagArray[0] = new("User", user); logger.Log( logLevel, - new(817366252, nameof(RetrievingTokenForUser)), + new(1155721757, nameof(RetrievingTokenForUser)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var user = s.TagArray[1].Value ?? "(null)"; + var user = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Retrieving token for user {user}"); #else @@ -1795,7 +1875,7 @@ namespace Duende.Bff.Otel /// /// Logs "Retrieving session {Sid} for sub {Sub}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RetrievingSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sid, string sub) { if (!logger.IsEnabled(logLevel)) @@ -1806,19 +1886,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sid", sid); - state.TagArray[1] = new("Sub", sub); - state.TagArray[0] = new("{OriginalFormat}", "Retrieving session {Sid} for sub {Sub}"); + state.TagArray[2] = new("{OriginalFormat}", "Retrieving session {Sid} for sub {Sub}"); + state.TagArray[1] = new("Sid", sid); + state.TagArray[0] = new("Sub", sub); logger.Log( logLevel, - new(2015766163, nameof(RetrievingSession)), + new(1542921726, nameof(RetrievingSession)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sid = s.TagArray[2].Value ?? "(null)"; - var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Retrieving session {sid} for sub {sub}"); #else @@ -1832,7 +1912,7 @@ namespace Duende.Bff.Otel /// /// Logs "Storing token for user {User}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void StoringTokenForUser(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? user) { if (!logger.IsEnabled(logLevel)) @@ -1843,17 +1923,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("User", user); - state.TagArray[0] = new("{OriginalFormat}", "Storing token for user {User}"); + state.TagArray[1] = new("{OriginalFormat}", "Storing token for user {User}"); + state.TagArray[0] = new("User", user); logger.Log( logLevel, - new(1675488649, nameof(StoringTokenForUser)), + new(114355538, nameof(StoringTokenForUser)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var user = s.TagArray[1].Value ?? "(null)"; + var user = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Storing token for user {user}"); #else @@ -1867,7 +1947,7 @@ namespace Duende.Bff.Otel /// /// Logs "Removing token for user {User}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RemovingTokenForUser(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? user) { if (!logger.IsEnabled(logLevel)) @@ -1878,17 +1958,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("User", user); - state.TagArray[0] = new("{OriginalFormat}", "Removing token for user {User}"); + state.TagArray[1] = new("{OriginalFormat}", "Removing token for user {User}"); + state.TagArray[0] = new("User", user); logger.Log( logLevel, - new(1247903432, nameof(RemovingTokenForUser)), + new(911167719, nameof(RemovingTokenForUser)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var user = s.TagArray[1].Value ?? "(null)"; + var user = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Removing token for user {user}"); #else @@ -1902,7 +1982,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to find a session to update, bailing out". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToFindSessionToUpdate(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -1917,10 +1997,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1686152447, nameof(FailedToFindSessionToUpdate)), + new(1188363286, nameof(FailedToFindSessionToUpdate)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Failed to find a session to update, bailing out"; }); @@ -1931,7 +2011,7 @@ namespace Duende.Bff.Otel /// /// Logs "Creating entry in store for AuthenticationTicket, key {Key}, with expiration: {Expiration}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void CreatingAuthenticationTicketEntry(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key, global::System.DateTime? expiration) { if (!logger.IsEnabled(logLevel)) @@ -1942,19 +2022,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Key", key); - state.TagArray[1] = new("Expiration", expiration); - state.TagArray[0] = new("{OriginalFormat}", "Creating entry in store for AuthenticationTicket, key {Key}, with expiration: {Expiration}"); + state.TagArray[2] = new("{OriginalFormat}", "Creating entry in store for AuthenticationTicket, key {Key}, with expiration: {Expiration}"); + state.TagArray[1] = new("Key", key); + state.TagArray[0] = new("Expiration", expiration); logger.Log( logLevel, - new(960199371, nameof(CreatingAuthenticationTicketEntry)), + new(916852806, nameof(CreatingAuthenticationTicketEntry)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[2].Value ?? "(null)"; - var expiration = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[1].Value ?? "(null)"; + var expiration = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Creating entry in store for AuthenticationTicket, key {key}, with expiration: {expiration}"); #else @@ -1968,7 +2048,7 @@ namespace Duende.Bff.Otel /// /// Logs "Retrieve AuthenticationTicket for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RetrieveAuthenticationTicket(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key) { if (!logger.IsEnabled(logLevel)) @@ -1979,17 +2059,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key); - state.TagArray[0] = new("{OriginalFormat}", "Retrieve AuthenticationTicket for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "Retrieve AuthenticationTicket for key {Key}"); + state.TagArray[0] = new("Key", key); logger.Log( logLevel, - new(65815620, nameof(RetrieveAuthenticationTicket)), + new(1404101509, nameof(RetrieveAuthenticationTicket)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Retrieve AuthenticationTicket for key {key}"); #else @@ -2003,7 +2083,7 @@ namespace Duende.Bff.Otel /// /// Logs "Ticket loaded for key: {Key}, with expiration: {Expiration}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void TicketLoaded(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key, global::System.DateTime? expiration) { if (!logger.IsEnabled(logLevel)) @@ -2014,19 +2094,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Key", key); - state.TagArray[1] = new("Expiration", expiration); - state.TagArray[0] = new("{OriginalFormat}", "Ticket loaded for key: {Key}, with expiration: {Expiration}"); + state.TagArray[2] = new("{OriginalFormat}", "Ticket loaded for key: {Key}, with expiration: {Expiration}"); + state.TagArray[1] = new("Key", key); + state.TagArray[0] = new("Expiration", expiration); logger.Log( logLevel, - new(1224988019, nameof(TicketLoaded)), + new(2067869024, nameof(TicketLoaded)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[2].Value ?? "(null)"; - var expiration = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[1].Value ?? "(null)"; + var expiration = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Ticket loaded for key: {key}, with expiration: {expiration}"); #else @@ -2040,7 +2120,7 @@ namespace Duende.Bff.Otel /// /// Logs "No AuthenticationTicket found in store for {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoAuthenticationTicketFoundForKey(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key) { if (!logger.IsEnabled(logLevel)) @@ -2051,17 +2131,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key); - state.TagArray[0] = new("{OriginalFormat}", "No AuthenticationTicket found in store for {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "No AuthenticationTicket found in store for {Key}"); + state.TagArray[0] = new("Key", key); logger.Log( logLevel, - new(426988975, nameof(NoAuthenticationTicketFoundForKey)), + new(1730106316, nameof(NoAuthenticationTicketFoundForKey)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"No AuthenticationTicket found in store for {key}"); #else @@ -2075,7 +2155,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to deserialize authentication ticket from store, deleting record for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToDeserializeAuthenticationTicket(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key) { if (!logger.IsEnabled(logLevel)) @@ -2086,17 +2166,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key); - state.TagArray[0] = new("{OriginalFormat}", "Failed to deserialize authentication ticket from store, deleting record for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "Failed to deserialize authentication ticket from store, deleting record for key {Key}"); + state.TagArray[0] = new("Key", key); logger.Log( logLevel, - new(1300162747, nameof(FailedToDeserializeAuthenticationTicket)), + new(717775336, nameof(FailedToDeserializeAuthenticationTicket)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to deserialize authentication ticket from store, deleting record for key {key}"); #else @@ -2110,7 +2190,7 @@ namespace Duende.Bff.Otel /// /// Logs "Renewing AuthenticationTicket for key {Key}, with expiration: {Expiration}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RenewingAuthenticationTicket(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key, global::System.DateTime? expiration) { if (!logger.IsEnabled(logLevel)) @@ -2121,19 +2201,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Key", key); - state.TagArray[1] = new("Expiration", expiration); - state.TagArray[0] = new("{OriginalFormat}", "Renewing AuthenticationTicket for key {Key}, with expiration: {Expiration}"); + state.TagArray[2] = new("{OriginalFormat}", "Renewing AuthenticationTicket for key {Key}, with expiration: {Expiration}"); + state.TagArray[1] = new("Key", key); + state.TagArray[0] = new("Expiration", expiration); logger.Log( logLevel, - new(707874553, nameof(RenewingAuthenticationTicket)), + new(696136082, nameof(RenewingAuthenticationTicket)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[2].Value ?? "(null)"; - var expiration = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[1].Value ?? "(null)"; + var expiration = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Renewing AuthenticationTicket for key {key}, with expiration: {expiration}"); #else @@ -2147,7 +2227,7 @@ namespace Duende.Bff.Otel /// /// Logs "Removing AuthenticationTicket from store for key {Key}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RemovingAuthenticationTicket(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string key) { if (!logger.IsEnabled(logLevel)) @@ -2158,17 +2238,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Key", key); - state.TagArray[0] = new("{OriginalFormat}", "Removing AuthenticationTicket from store for key {Key}"); + state.TagArray[1] = new("{OriginalFormat}", "Removing AuthenticationTicket from store for key {Key}"); + state.TagArray[0] = new("Key", key); logger.Log( logLevel, - new(1961829635, nameof(RemovingAuthenticationTicket)), + new(451155394, nameof(RemovingAuthenticationTicket)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var key = s.TagArray[1].Value ?? "(null)"; + var key = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Removing AuthenticationTicket from store for key {key}"); #else @@ -2182,7 +2262,7 @@ namespace Duende.Bff.Otel /// /// Logs "Getting AuthenticationTickets from store for sub {Sub} sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void GettingAuthenticationTickets(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -2193,19 +2273,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Getting AuthenticationTickets from store for sub {Sub} sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Getting AuthenticationTickets from store for sub {Sub} sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(622682141, nameof(GettingAuthenticationTickets)), + new(1759928912, nameof(GettingAuthenticationTickets)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Getting AuthenticationTickets from store for sub {sub} sid {sid}"); #else @@ -2219,7 +2299,7 @@ namespace Duende.Bff.Otel /// /// Logs "Frontend selected via path mapping '{PathMapping}', but request path '{Path}' has different case. Cookie path names are case sensitive, so the cookie likely doesn't work.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FrontendSelectedWithPathCasingIssue(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string pathMapping, global::Microsoft.AspNetCore.Http.PathString path) { if (!logger.IsEnabled(logLevel)) @@ -2230,19 +2310,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("PathMapping", pathMapping); - state.TagArray[1] = new("Path", path.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Frontend selected via path mapping '{PathMapping}', but request path '{Path}' has different case. Cookie path names are case sensitive, so the cookie likely doesn't work."); + state.TagArray[2] = new("{OriginalFormat}", "Frontend selected via path mapping '{PathMapping}', but request path '{Path}' has different case. Cookie path names are case sensitive, so the cookie likely doesn't work."); + state.TagArray[1] = new("PathMapping", pathMapping); + state.TagArray[0] = new("Path", path.ToString()); logger.Log( logLevel, - new(1880243510, nameof(FrontendSelectedWithPathCasingIssue)), + new(1615926397, nameof(FrontendSelectedWithPathCasingIssue)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var pathMapping = s.TagArray[2].Value ?? "(null)"; - var path = s.TagArray[1].Value; + var pathMapping = s.TagArray[1].Value ?? "(null)"; + var path = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Frontend selected via path mapping '{pathMapping}', but request path '{path}' has different case. Cookie path names are case sensitive, so the cookie likely doesn't work."); #else @@ -2256,7 +2336,7 @@ namespace Duende.Bff.Otel /// /// Logs "Management endpoints are automatically mapped, so the call to MapBffManagementEndpoints will be ignored. If you're using BffOptions.AutomaticallyRegisterBffMiddleware, you don't need to call endpoints.MapBffManagementEndpoints()". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void AlreadyMappedManagementEndpoints(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2271,10 +2351,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1219957122, nameof(AlreadyMappedManagementEndpoints)), + new(94227125, nameof(AlreadyMappedManagementEndpoints)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Management endpoints are automatically mapped, so the call to MapBffManagementEndpoints will be ignored. If you're using BffOptions.AutomaticallyRegisterBffMiddleware, you don't need to call endpoints.MapBffManagementEndpoints()"; }); @@ -2285,7 +2365,7 @@ namespace Duende.Bff.Otel /// /// Logs "Authenticating scheme: {Scheme}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void AuthenticatingScheme(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? scheme) { if (!logger.IsEnabled(logLevel)) @@ -2296,17 +2376,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Scheme", scheme); - state.TagArray[0] = new("{OriginalFormat}", "Authenticating scheme: {Scheme}"); + state.TagArray[1] = new("{OriginalFormat}", "Authenticating scheme: {Scheme}"); + state.TagArray[0] = new("Scheme", scheme); logger.Log( logLevel, - new(1078491209, nameof(AuthenticatingScheme)), + new(221489388, nameof(AuthenticatingScheme)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var scheme = s.TagArray[1].Value ?? "(null)"; + var scheme = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Authenticating scheme: {scheme}"); #else @@ -2320,7 +2400,7 @@ namespace Duende.Bff.Otel /// /// Logs "Signing out of scheme: {Scheme}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SigningOutOfScheme(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? scheme) { if (!logger.IsEnabled(logLevel)) @@ -2331,17 +2411,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Scheme", scheme); - state.TagArray[0] = new("{OriginalFormat}", "Signing out of scheme: {Scheme}"); + state.TagArray[1] = new("{OriginalFormat}", "Signing out of scheme: {Scheme}"); + state.TagArray[0] = new("Scheme", scheme); logger.Log( logLevel, - new(2030830787, nameof(SigningOutOfScheme)), + new(2114392866, nameof(SigningOutOfScheme)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var scheme = s.TagArray[1].Value ?? "(null)"; + var scheme = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Signing out of scheme: {scheme}"); #else @@ -2355,7 +2435,7 @@ namespace Duende.Bff.Otel /// /// Logs "Setting OIDC ProtocolMessage.Prompt to 'none' for BFF silent login". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SettingOidcPromptNoneForSilentLogin(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2370,10 +2450,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1767730600, nameof(SettingOidcPromptNoneForSilentLogin)), + new(839818343, nameof(SettingOidcPromptNoneForSilentLogin)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Setting OIDC ProtocolMessage.Prompt to 'none' for BFF silent login"; }); @@ -2384,7 +2464,7 @@ namespace Duende.Bff.Otel /// /// Logs "Setting OIDC ProtocolMessage.Prompt to {Prompt} for BFF silent login". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SettingOidcPromptForSilentLogin(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string prompt) { if (!logger.IsEnabled(logLevel)) @@ -2395,17 +2475,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Prompt", prompt); - state.TagArray[0] = new("{OriginalFormat}", "Setting OIDC ProtocolMessage.Prompt to {Prompt} for BFF silent login"); + state.TagArray[1] = new("{OriginalFormat}", "Setting OIDC ProtocolMessage.Prompt to {Prompt} for BFF silent login"); + state.TagArray[0] = new("Prompt", prompt); logger.Log( logLevel, - new(573166490, nameof(SettingOidcPromptForSilentLogin)), + new(1904470271, nameof(SettingOidcPromptForSilentLogin)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var prompt = s.TagArray[1].Value ?? "(null)"; + var prompt = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Setting OIDC ProtocolMessage.Prompt to {prompt} for BFF silent login"); #else @@ -2419,7 +2499,7 @@ namespace Duende.Bff.Otel /// /// Logs "Handling error response from OIDC provider for BFF silent login.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void HandlingErrorResponseFromOidcProviderForSilentLogin(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2434,10 +2514,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1137832901, nameof(HandlingErrorResponseFromOidcProviderForSilentLogin)), + new(248407638, nameof(HandlingErrorResponseFromOidcProviderForSilentLogin)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Handling error response from OIDC provider for BFF silent login."; }); @@ -2448,7 +2528,7 @@ namespace Duende.Bff.Otel /// /// Logs "Handling failed response from OIDC provider for BFF silent login.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void HandlingFailedResponseFromOidcProviderForSilentLogin(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2463,10 +2543,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(177583912, nameof(HandlingFailedResponseFromOidcProviderForSilentLogin)), + new(1743908777, nameof(HandlingFailedResponseFromOidcProviderForSilentLogin)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Handling failed response from OIDC provider for BFF silent login."; }); @@ -2477,7 +2557,7 @@ namespace Duende.Bff.Otel /// /// Logs "Processing back-channel logout request". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProcessingBackChannelLogoutRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2492,10 +2572,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(772319522, nameof(ProcessingBackChannelLogoutRequest)), + new(570229497, nameof(ProcessingBackChannelLogoutRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Processing back-channel logout request"; }); @@ -2506,7 +2586,7 @@ namespace Duende.Bff.Otel /// /// Logs "No claims in back-channel JWT". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NoClaimsInBackChannelJwt(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2521,10 +2601,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1573613638, nameof(NoClaimsInBackChannelJwt)), + new(241509663, nameof(NoClaimsInBackChannelJwt)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "No claims in back-channel JWT"; }); @@ -2535,7 +2615,7 @@ namespace Duende.Bff.Otel /// /// Logs "Claims found in back-channel JWT {Claims}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ClaimsFoundInBackChannelJwt(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string claims) { if (!logger.IsEnabled(logLevel)) @@ -2546,17 +2626,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Claims", claims); - state.TagArray[0] = new("{OriginalFormat}", "Claims found in back-channel JWT {Claims}"); + state.TagArray[1] = new("{OriginalFormat}", "Claims found in back-channel JWT {Claims}"); + state.TagArray[0] = new("Claims", claims); logger.Log( logLevel, - new(1092893573, nameof(ClaimsFoundInBackChannelJwt)), + new(1309119768, nameof(ClaimsFoundInBackChannelJwt)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var claims = s.TagArray[1].Value ?? "(null)"; + var claims = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Claims found in back-channel JWT {claims}"); #else @@ -2570,7 +2650,7 @@ namespace Duende.Bff.Otel /// /// Logs "Back-channel JWT validation successful". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void BackChannelJwtValidationSuccessful(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2585,10 +2665,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(664219482, nameof(BackChannelJwtValidationSuccessful)), + new(1897874243, nameof(BackChannelJwtValidationSuccessful)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Back-channel JWT validation successful"; }); @@ -2599,7 +2679,7 @@ namespace Duende.Bff.Otel /// /// Logs "Processing login request". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProcessingLoginRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2614,10 +2694,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(389857127, nameof(ProcessingLoginRequest)), + new(188495588, nameof(ProcessingLoginRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Processing login request"; }); @@ -2628,7 +2708,7 @@ namespace Duende.Bff.Otel /// /// Logs "Login endpoint triggering Challenge with returnUrl {ReturnUrl}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LoginEndpointTriggeringChallenge(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string returnUrl) { if (!logger.IsEnabled(logLevel)) @@ -2639,17 +2719,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("ReturnUrl", returnUrl); - state.TagArray[0] = new("{OriginalFormat}", "Login endpoint triggering Challenge with returnUrl {ReturnUrl}"); + state.TagArray[1] = new("{OriginalFormat}", "Login endpoint triggering Challenge with returnUrl {ReturnUrl}"); + state.TagArray[0] = new("ReturnUrl", returnUrl); logger.Log( logLevel, - new(1273811029, nameof(LoginEndpointTriggeringChallenge)), + new(1830924184, nameof(LoginEndpointTriggeringChallenge)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var returnUrl = s.TagArray[1].Value ?? "(null)"; + var returnUrl = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Login endpoint triggering Challenge with returnUrl {returnUrl}"); #else @@ -2663,7 +2743,7 @@ namespace Duende.Bff.Otel /// /// Logs "Processing logout request". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProcessingLogoutRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2678,10 +2758,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(598692640, nameof(ProcessingLogoutRequest)), + new(381187535, nameof(ProcessingLogoutRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Processing logout request"; }); @@ -2692,7 +2772,7 @@ namespace Duende.Bff.Otel /// /// Logs "Logout endpoint triggering SignOut with returnUrl {ReturnUrl}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LogoutEndpointTriggeringSignOut(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string returnUrl) { if (!logger.IsEnabled(logLevel)) @@ -2703,17 +2783,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("ReturnUrl", returnUrl); - state.TagArray[0] = new("{OriginalFormat}", "Logout endpoint triggering SignOut with returnUrl {ReturnUrl}"); + state.TagArray[1] = new("{OriginalFormat}", "Logout endpoint triggering SignOut with returnUrl {ReturnUrl}"); + state.TagArray[0] = new("ReturnUrl", returnUrl); logger.Log( logLevel, - new(247223768, nameof(LogoutEndpointTriggeringSignOut)), + new(1568891897, nameof(LogoutEndpointTriggeringSignOut)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var returnUrl = s.TagArray[1].Value ?? "(null)"; + var returnUrl = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Logout endpoint triggering SignOut with returnUrl {returnUrl}"); #else @@ -2727,7 +2807,7 @@ namespace Duende.Bff.Otel /// /// Logs "Processing silent login callback request". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProcessingSilentLoginCallbackRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2742,10 +2822,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(301260843, nameof(ProcessingSilentLoginCallbackRequest)), + new(2095781080, nameof(ProcessingSilentLoginCallbackRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Processing silent login callback request"; }); @@ -2756,7 +2836,7 @@ namespace Duende.Bff.Otel /// /// Logs "Silent login endpoint rendering HTML with JS postMessage to origin {Origin} with isLoggedIn {IsLoggedIn}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SilentLoginEndpointRenderingHtml(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string origin, string isLoggedIn) { if (!logger.IsEnabled(logLevel)) @@ -2767,19 +2847,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Origin", origin); - state.TagArray[1] = new("IsLoggedIn", isLoggedIn); - state.TagArray[0] = new("{OriginalFormat}", "Silent login endpoint rendering HTML with JS postMessage to origin {Origin} with isLoggedIn {IsLoggedIn}"); + state.TagArray[2] = new("{OriginalFormat}", "Silent login endpoint rendering HTML with JS postMessage to origin {Origin} with isLoggedIn {IsLoggedIn}"); + state.TagArray[1] = new("Origin", origin); + state.TagArray[0] = new("IsLoggedIn", isLoggedIn); logger.Log( logLevel, - new(1109308436, nameof(SilentLoginEndpointRenderingHtml)), + new(1542593693, nameof(SilentLoginEndpointRenderingHtml)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var origin = s.TagArray[2].Value ?? "(null)"; - var isLoggedIn = s.TagArray[1].Value ?? "(null)"; + var origin = s.TagArray[1].Value ?? "(null)"; + var isLoggedIn = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Silent login endpoint rendering HTML with JS postMessage to origin {origin} with isLoggedIn {isLoggedIn}"); #else @@ -2793,7 +2873,7 @@ namespace Duende.Bff.Otel /// /// Logs "Processing silent login request". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProcessingSilentLoginRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2808,10 +2888,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1638734764, nameof(ProcessingSilentLoginRequest)), + new(688702555, nameof(ProcessingSilentLoginRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Processing silent login request"; }); @@ -2822,7 +2902,7 @@ namespace Duende.Bff.Otel /// /// Logs "Using deprecated silentlogin endpoint. This endpoint will be removed in future versions. Consider calling the BFF Login endpoint with prompt=none.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void UsingDeprecatedSilentLoginEndpoint(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2837,10 +2917,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(123372604, nameof(UsingDeprecatedSilentLoginEndpoint)), + new(1891295205, nameof(UsingDeprecatedSilentLoginEndpoint)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Using deprecated silentlogin endpoint. This endpoint will be removed in future versions. Consider calling the BFF Login endpoint with prompt=none."; }); @@ -2851,7 +2931,7 @@ namespace Duende.Bff.Otel /// /// Logs "Processing user request". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ProcessingUserRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -2866,10 +2946,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(307967645, nameof(ProcessingUserRequest)), + new(1069052734, nameof(ProcessingUserRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Processing user request"; }); @@ -2880,7 +2960,7 @@ namespace Duende.Bff.Otel /// /// Logs "User endpoint indicates the user is not logged in, using status code {StatusCode}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void UserEndpointNotLoggedIn(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, int statusCode) { if (!logger.IsEnabled(logLevel)) @@ -2891,17 +2971,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("StatusCode", statusCode); - state.TagArray[0] = new("{OriginalFormat}", "User endpoint indicates the user is not logged in, using status code {StatusCode}"); + state.TagArray[1] = new("{OriginalFormat}", "User endpoint indicates the user is not logged in, using status code {StatusCode}"); + state.TagArray[0] = new("StatusCode", statusCode); logger.Log( logLevel, - new(837397288, nameof(UserEndpointNotLoggedIn)), + new(1988896519, nameof(UserEndpointNotLoggedIn)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var statusCode = s.TagArray[1].Value; + var statusCode = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"User endpoint indicates the user is not logged in, using status code {statusCode}"); #else @@ -2915,7 +2995,7 @@ namespace Duende.Bff.Otel /// /// Logs "User endpoint indicates the user is logged in with claims {Claims}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void UserEndpointLoggedInWithClaims(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string claims) { if (!logger.IsEnabled(logLevel)) @@ -2926,17 +3006,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Claims", claims); - state.TagArray[0] = new("{OriginalFormat}", "User endpoint indicates the user is logged in with claims {Claims}"); + state.TagArray[1] = new("{OriginalFormat}", "User endpoint indicates the user is logged in with claims {Claims}"); + state.TagArray[0] = new("Claims", claims); logger.Log( logLevel, - new(509704106, nameof(UserEndpointLoggedInWithClaims)), + new(1947226275, nameof(UserEndpointLoggedInWithClaims)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var claims = s.TagArray[1].Value ?? "(null)"; + var claims = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"User endpoint indicates the user is logged in with claims {claims}"); #else @@ -2950,7 +3030,7 @@ namespace Duende.Bff.Otel /// /// Logs "Nop implementation of session revocation for sub: {Sub}, and sid: {Sid}. Implement ISessionRevocationService to provide your own implementation.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void NopSessionRevocation(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -2961,19 +3041,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Nop implementation of session revocation for sub: {Sub}, and sid: {Sid}. Implement ISessionRevocationService to provide your own implementation."); + state.TagArray[2] = new("{OriginalFormat}", "Nop implementation of session revocation for sub: {Sub}, and sid: {Sid}. Implement ISessionRevocationService to provide your own implementation."); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(1523221365, nameof(NopSessionRevocation)), + new(51101818, nameof(NopSessionRevocation)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Nop implementation of session revocation for sub: {sub}, and sid: {sid}. Implement ISessionRevocationService to provide your own implementation."); #else @@ -2987,7 +3067,7 @@ namespace Duende.Bff.Otel /// /// Logs "Revoking sessions for sub {Sub} and sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RevokingSessions(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -2998,19 +3078,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Revoking sessions for sub {Sub} and sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Revoking sessions for sub {Sub} and sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(699009608, nameof(RevokingSessions)), + new(1976629049, nameof(RevokingSessions)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Revoking sessions for sub {sub} and sid {sid}"); #else @@ -3024,7 +3104,7 @@ namespace Duende.Bff.Otel /// /// Logs "Refresh token revoked for sub {Sub} and sid {Sid}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RefreshTokenRevoked(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string sub, string? sid) { if (!logger.IsEnabled(logLevel)) @@ -3035,19 +3115,19 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(3); - state.TagArray[2] = new("Sub", sub); - state.TagArray[1] = new("Sid", sid); - state.TagArray[0] = new("{OriginalFormat}", "Refresh token revoked for sub {Sub} and sid {Sid}"); + state.TagArray[2] = new("{OriginalFormat}", "Refresh token revoked for sub {Sub} and sid {Sid}"); + state.TagArray[1] = new("Sub", sub); + state.TagArray[0] = new("Sid", sid); logger.Log( logLevel, - new(1838828912, nameof(RefreshTokenRevoked)), + new(1939924033, nameof(RefreshTokenRevoked)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[2].Value ?? "(null)"; - var sid = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[1].Value ?? "(null)"; + var sid = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Refresh token revoked for sub {sub} and sid {sid}"); #else @@ -3061,7 +3141,7 @@ namespace Duende.Bff.Otel /// /// Logs "BFF session cleanup is enabled, but no IUserSessionStoreCleanup is registered in DI. BFF session cleanup will not run.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SessionCleanupNotRegistered(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3076,10 +3156,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1929165299, nameof(SessionCleanupNotRegistered)), + new(304786466, nameof(SessionCleanupNotRegistered)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "BFF session cleanup is enabled, but no IUserSessionStoreCleanup is registered in DI. BFF session cleanup will not run."; }); @@ -3090,7 +3170,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to cleanup session". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToCleanupSession(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -3105,10 +3185,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1657212172, nameof(FailedToCleanupSession)), + new(1791317797, nameof(FailedToCleanupSession)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Failed to cleanup session"; }); @@ -3119,7 +3199,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to cleanup expired sessions". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToCleanupExpiredSessions(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -3134,10 +3214,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(818018788, nameof(FailedToCleanupExpiredSessions)), + new(1361626621, nameof(FailedToCleanupExpiredSessions)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Failed to cleanup expired sessions"; }); @@ -3148,7 +3228,7 @@ namespace Duende.Bff.Otel /// /// Logs "Revoking user's refresh tokens in OnSigningOut for subject id: {Sub}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void RevokingUserRefreshTokensOnSigningOut(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, string? sub) { if (!logger.IsEnabled(logLevel)) @@ -3159,17 +3239,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Sub", sub); - state.TagArray[0] = new("{OriginalFormat}", "Revoking user's refresh tokens in OnSigningOut for subject id: {Sub}"); + state.TagArray[1] = new("{OriginalFormat}", "Revoking user's refresh tokens in OnSigningOut for subject id: {Sub}"); + state.TagArray[0] = new("Sub", sub); logger.Log( logLevel, - new(1414129037, nameof(RevokingUserRefreshTokensOnSigningOut)), + new(1753873664, nameof(RevokingUserRefreshTokensOnSigningOut)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var sub = s.TagArray[1].Value ?? "(null)"; + var sub = s.TagArray[0].Value ?? "(null)"; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Revoking user's refresh tokens in OnSigningOut for subject id: {sub}"); #else @@ -3183,7 +3263,7 @@ namespace Duende.Bff.Otel /// /// Logs "Explicitly setting ShouldRenew=false in OnValidatePrincipal due to query param suppressing slide behavior.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SuppressingSlideBehaviorOnValidatePrincipal(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3198,10 +3278,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1610470401, nameof(SuppressingSlideBehaviorOnValidatePrincipal)), + new(525394436, nameof(SuppressingSlideBehaviorOnValidatePrincipal)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Explicitly setting ShouldRenew=false in OnValidatePrincipal due to query param suppressing slide behavior."; }); @@ -3212,7 +3292,7 @@ namespace Duende.Bff.Otel /// /// Logs "Explicitly setting ShouldRenew=false in OnCheckSlidingExpiration due to query param suppressing slide behavior.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void SuppressingSlideBehaviorOnCheckSlidingExpiration(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3227,10 +3307,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(199146006, nameof(SuppressingSlideBehaviorOnCheckSlidingExpiration)), + new(642079923, nameof(SuppressingSlideBehaviorOnCheckSlidingExpiration)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Explicitly setting ShouldRenew=false in OnCheckSlidingExpiration due to query param suppressing slide behavior."; }); @@ -3241,7 +3321,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to process backchannel logout request. 'Logout token is missing'". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToProcessBackchannelLogoutRequestMissingToken(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3256,10 +3336,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1894136923, nameof(FailedToProcessBackchannelLogoutRequestMissingToken)), + new(1481259430, nameof(FailedToProcessBackchannelLogoutRequestMissingToken)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Failed to process backchannel logout request. 'Logout token is missing'"; }); @@ -3270,7 +3350,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to process backchannel logout request.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToProcessBackchannelLogoutRequest(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3285,10 +3365,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(219471514, nameof(FailedToProcessBackchannelLogoutRequest)), + new(708279731, nameof(FailedToProcessBackchannelLogoutRequest)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Failed to process backchannel logout request."; }); @@ -3299,7 +3379,7 @@ namespace Duende.Bff.Otel /// /// Logs "Logout token missing sub and sid claims.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LogoutTokenMissingSubAndSidClaims(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3314,10 +3394,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(928131743, nameof(LogoutTokenMissingSubAndSidClaims)), + new(799139100, nameof(LogoutTokenMissingSubAndSidClaims)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Logout token missing sub and sid claims."; }); @@ -3328,7 +3408,7 @@ namespace Duende.Bff.Otel /// /// Logs "Logout token should not contain nonce claim.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LogoutTokenShouldNotContainNonceClaim(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3343,10 +3423,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(294943236, nameof(LogoutTokenShouldNotContainNonceClaim)), + new(388846435, nameof(LogoutTokenShouldNotContainNonceClaim)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Logout token should not contain nonce claim."; }); @@ -3357,7 +3437,7 @@ namespace Duende.Bff.Otel /// /// Logs "Logout token missing events claim.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LogoutTokenMissingEventsClaim(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3372,10 +3452,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(2146508878, nameof(LogoutTokenMissingEventsClaim)), + new(1508212581, nameof(LogoutTokenMissingEventsClaim)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Logout token missing events claim."; }); @@ -3386,7 +3466,7 @@ namespace Duende.Bff.Otel /// /// Logs "Logout token contains missing http://schemas.openid.net/event/backchannel-logout value.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LogoutTokenMissingBackchannelLogoutValue(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel) { if (!logger.IsEnabled(logLevel)) @@ -3401,10 +3481,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1202315764, nameof(LogoutTokenMissingBackchannelLogoutValue)), + new(1611838429, nameof(LogoutTokenMissingBackchannelLogoutValue)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Logout token contains missing http://schemas.openid.net/event/backchannel-logout value."; }); @@ -3415,7 +3495,7 @@ namespace Duende.Bff.Otel /// /// Logs "Logout token contains invalid JSON in events claim value.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void LogoutTokenContainsInvalidJsonInEventsClaim(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -3430,10 +3510,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(493575433, nameof(LogoutTokenContainsInvalidJsonInEventsClaim)), + new(1683678372, nameof(LogoutTokenContainsInvalidJsonInEventsClaim)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Logout token contains invalid JSON in events claim value."; }); @@ -3444,7 +3524,7 @@ namespace Duende.Bff.Otel /// /// Logs "Error validating logout token.". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ErrorValidatingLogoutToken(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -3459,10 +3539,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(1001889170, nameof(ErrorValidatingLogoutToken)), + new(554632965, nameof(ErrorValidatingLogoutToken)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Error validating logout token."; }); @@ -3473,7 +3553,7 @@ namespace Duende.Bff.Otel /// /// Logs "A changed frontend was detected. Clearing caches for frontend {Frontend}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ChangedFrontendDetected_ClearingCaches(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend) { if (!logger.IsEnabled(logLevel)) @@ -3484,17 +3564,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Frontend", frontend.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "A changed frontend was detected. Clearing caches for frontend {Frontend}"); + state.TagArray[1] = new("{OriginalFormat}", "A changed frontend was detected. Clearing caches for frontend {Frontend}"); + state.TagArray[0] = new("Frontend", frontend.ToString()); logger.Log( logLevel, - new(713030089, nameof(ChangedFrontendDetected_ClearingCaches)), + new(1904143150, nameof(ChangedFrontendDetected_ClearingCaches)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[1].Value; + var frontend = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"A changed frontend was detected. Clearing caches for frontend {frontend}"); #else @@ -3508,7 +3588,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to clear hybrid cache for frontend {Frontend}". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToClearSchemeCache(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -3519,17 +3599,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Frontend", frontend.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Failed to clear hybrid cache for frontend {Frontend}"); + state.TagArray[1] = new("{OriginalFormat}", "Failed to clear hybrid cache for frontend {Frontend}"); + state.TagArray[0] = new("Frontend", frontend.ToString()); logger.Log( logLevel, - new(487089464, nameof(FailedToClearSchemeCache)), + new(1443803337, nameof(FailedToClearSchemeCache)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[1].Value; + var frontend = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to clear hybrid cache for frontend {frontend}"); #else @@ -3543,7 +3623,7 @@ namespace Duende.Bff.Otel /// /// Logs "Error occurred while processing frontend changes". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void ErrorWhileProcessingFrontendChanges(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::System.Exception ex) { if (!logger.IsEnabled(logLevel)) @@ -3558,10 +3638,10 @@ namespace Duende.Bff.Otel logger.Log( logLevel, - new(336053397, nameof(ErrorWhileProcessingFrontendChanges)), + new(1324568550, nameof(ErrorWhileProcessingFrontendChanges)), state, ex, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { return "Error occurred while processing frontend changes"; }); @@ -3572,7 +3652,7 @@ namespace Duende.Bff.Otel /// /// Logs "Failed to add frontend change to {Frontend} to queue". /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] public static void FailedToAddFrontendToQueue(this global::Microsoft.Extensions.Logging.ILogger logger, global::Microsoft.Extensions.Logging.LogLevel logLevel, global::Duende.Bff.DynamicFrontends.BffFrontendName frontend) { if (!logger.IsEnabled(logLevel)) @@ -3583,17 +3663,17 @@ namespace Duende.Bff.Otel var state = global::Microsoft.Extensions.Logging.LoggerMessageHelper.ThreadLocalState; _ = state.ReserveTagSpace(2); - state.TagArray[1] = new("Frontend", frontend.ToString()); - state.TagArray[0] = new("{OriginalFormat}", "Failed to add frontend change to {Frontend} to queue"); + state.TagArray[1] = new("{OriginalFormat}", "Failed to add frontend change to {Frontend} to queue"); + state.TagArray[0] = new("Frontend", frontend.ToString()); logger.Log( logLevel, - new(1846665177, nameof(FailedToAddFrontendToQueue)), + new(36295012, nameof(FailedToAddFrontendToQueue)), state, null, - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "9.1.0.0")] static string (s, _) => + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Gen.Logging", "10.0.0.0")] static string (s, _) => { - var frontend = s.TagArray[1].Value; + var frontend = s.TagArray[0].Value; #if NET return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, $"Failed to add frontend change to {frontend} to queue"); #else @@ -3603,6 +3683,7 @@ namespace Duende.Bff.Otel state.Clear(); } + public static string Sanitize(this string toSanitize) => toSanitize.ReplaceLineEndings(string.Empty); public static string Sanitize(this PathString toSanitize) => toSanitize.ToString().ReplaceLineEndings(string.Empty); diff --git a/bff/src/Bff/Otel/LogMessages.cs b/bff/src/Bff/Otel/LogMessages.cs index 15dc1313c..227d2492b 100644 --- a/bff/src/Bff/Otel/LogMessages.cs +++ b/bff/src/Bff/Otel/LogMessages.cs @@ -7,7 +7,7 @@ // using Duende.Bff.SessionManagement.SessionStore; // using Microsoft.AspNetCore.Http; // using Microsoft.Extensions.Logging; - +// // namespace Duende.Bff.Otel; // // internal static partial class LogMessages diff --git a/bff/src/Bff/ServiceCollectionExtensions.cs b/bff/src/Bff/ServiceCollectionExtensions.cs index 7afbd4af0..610033051 100644 --- a/bff/src/Bff/ServiceCollectionExtensions.cs +++ b/bff/src/Bff/ServiceCollectionExtensions.cs @@ -28,7 +28,8 @@ public static class ServiceCollectionExtensions return builder .AddBaseBffServices() - .AddDynamicFrontends(); + .AddDynamicFrontends() + .AddDiagnostics(); } } diff --git a/bff/test/Bff.Tests/ConventionTests.cs b/bff/test/Bff.Tests/ConventionTests.cs index 0cb150256..14003ef69 100644 --- a/bff/test/Bff.Tests/ConventionTests.cs +++ b/bff/test/Bff.Tests/ConventionTests.cs @@ -7,6 +7,7 @@ using Duende.Bff.AccessTokenManagement; using Duende.Bff.Blazor; using Duende.Bff.Blazor.Client; using Duende.Bff.Blazor.Client.Internals; +using Duende.Bff.Diagnostics; using Duende.Bff.DynamicFrontends.Internal; using Duende.Bff.Endpoints.Internal; using Duende.Bff.EntityFramework; @@ -25,13 +26,14 @@ public class ConventionTests(ITestOutputHelper output) public static readonly Assembly BffBlazorClientAssembly = typeof(BffBlazorClientOptions).Assembly; public static readonly Assembly BffEntityFrameworkAssembly = typeof(UserSessionEntity).Assembly; public static readonly Assembly BffYarpAssembly = typeof(BffYarpTransformBuilder).Assembly; + public static readonly Type[] AllTypes = BffAssembly.GetTypes() .Union(BffBlazorAssembly.GetTypes()) .Union(BffBlazorClientAssembly.GetTypes()) .Union(BffEntityFrameworkAssembly.GetTypes()) .Union(BffYarpAssembly.GetTypes()) - .ToArray(); + .ToArray(); [Fact] public void All_strongly_typed_strings_Have_private_value() @@ -66,7 +68,8 @@ public class ConventionTests(ITestOutputHelper output) { var buildMethod = type.GetMethods(BindingFlags.Static) .FirstOrDefault(m => m.Name == "Create"); - buildMethod.ShouldBeNull("The IStonglyTypedString defines a Create method, but it should be implemented explicitly on the interface, not on the type. \r\n IE: " + + buildMethod.ShouldBeNull( + "The IStonglyTypedString defines a Create method, but it should be implemented explicitly on the interface, not on the type. \r\n IE: " + " static AccessTokenString IStonglyTypedString.Create(string result) => new(result);"); } } @@ -83,9 +86,11 @@ public class ConventionTests(ITestOutputHelper output) // Try to invoke the constructor with a value and expect an exception var ex = Should.Throw(() => ctor.Invoke([])); - ex.InnerException.ShouldBeOfType().Message.ShouldContain("Can't create null value"); + ex.InnerException.ShouldBeOfType().Message + .ShouldContain("Can't create null value"); } } + [Fact] public void All_strongly_typed_strings_should_have_only_expected_constructors() { @@ -96,7 +101,8 @@ public class ConventionTests(ITestOutputHelper output) var ctors = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); // There must be exactly two constructors - ctors.Length.ShouldBe(2, $"{type.Name} should have exactly two constructors: one public parameterless and one private with a single string parameter."); + ctors.Length.ShouldBe(2, + $"{type.Name} should have exactly two constructors: one public parameterless and one private with a single string parameter."); // Find the public parameterless constructor var publicParameterlessCtor = ctors.FirstOrDefault(c => @@ -111,7 +117,8 @@ public class ConventionTests(ITestOutputHelper output) c.GetParameters().Length == 1 && c.GetParameters()[0].ParameterType == typeof(string)); - privateStringCtor.ShouldNotBeNull($"{type.Name} should have a private constructor with a single string parameter."); + privateStringCtor.ShouldNotBeNull( + $"{type.Name} should have a private constructor with a single string parameter."); } } @@ -135,13 +142,15 @@ public class ConventionTests(ITestOutputHelper output) [Fact()] public void All_types_not_in_Internal_namespace_should_be_sealed_or_static() { - Type[] exclusions = [ + Type[] exclusions = + [ typeof(SessionDbContext), typeof(SessionDbContext<>), typeof(UserSessionEntity), typeof(UserSession), typeof(UserSessionUpdate), - typeof(AccessTokenRetrievalError)]; + typeof(AccessTokenRetrievalError) + ]; // Find all types NOT in a '.Internal' namespace var nonInternalTypes = AllTypes @@ -169,7 +178,8 @@ public class ConventionTests(ITestOutputHelper output) public void All_async_methods_should_end_with_Async_and_have_cancellation_token_as_last_parameter() { var failures = new List(); - Type[] exclusions = [ + Type[] exclusions = + [ typeof(BffAuthenticationSchemeProvider), typeof(BffOpenIdConnectEvents), typeof(BffAuthenticationService), @@ -182,8 +192,8 @@ public class ConventionTests(ITestOutputHelper output) typeof(BffCacheClearingHostedService), typeof(SessionDbContext), typeof(SessionDbContext<>), + typeof(DiagnosticHostedService), typeof(ServerSideTokenStore), // This one needs to be removed after move to ATM 4.0 - ]; foreach (var type in AllTypes .Where(t => !exclusions.Contains(t)) @@ -206,7 +216,8 @@ public class ConventionTests(ITestOutputHelper output) var parameters = method.GetParameters(); if (parameters.Length == 0 || parameters.Last().ParameterType != typeof(CT)) { - failures.Add($"{type.FullName}.{method.Name}: Async method should have a CT as the last parameter."); + failures.Add( + $"{type.FullName}.{method.Name}: Async method should have a CT as the last parameter."); } } } @@ -218,18 +229,18 @@ public class ConventionTests(ITestOutputHelper output) failures.ShouldBeEmpty(); } + public static bool IsInternal(Type type) { if (type.IsNested) { return true; } + return type.IsNestedPrivate || type.IsNotPublic; } - - #nullable disable [Fact] public void AccessTokenManagement_is_not_exposed() @@ -252,7 +263,8 @@ public class ConventionTests(ITestOutputHelper output) } // Check public members for forbidden types - var members = type.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly); + var members = type.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | + BindingFlags.DeclaredOnly); foreach (var member in members) { switch (member) @@ -263,30 +275,36 @@ public class ConventionTests(ITestOutputHelper output) { break; } + if (IsForbiddenType(method.ReturnType)) { - errors.Add($"{type.FullName}.{method.Name} returns forbidden type {method.ReturnType.FullName}"); + errors.Add( + $"{type.FullName}.{method.Name} returns forbidden type {method.ReturnType.FullName}"); } foreach (var param in method.GetParameters()) { if (IsForbiddenType(param.ParameterType)) { - errors.Add($"{type.FullName}.{method.Name} parameter '{param.Name}' is forbidden type {param.ParameterType.FullName}"); + errors.Add( + $"{type.FullName}.{method.Name} parameter '{param.Name}' is forbidden type {param.ParameterType.FullName}"); } } + break; case PropertyInfo prop: if (IsForbiddenType(prop.PropertyType)) { - errors.Add($"{type.FullName}.{prop.Name} property is forbidden type {prop.PropertyType.FullName}"); + errors.Add( + $"{type.FullName}.{prop.Name} property is forbidden type {prop.PropertyType.FullName}"); } break; case FieldInfo field: if (IsForbiddenType(field.FieldType)) { - errors.Add($"{type.FullName}.{field.Name} field is forbidden type {field.FieldType.FullName}"); + errors.Add( + $"{type.FullName}.{field.Name} field is forbidden type {field.FieldType.FullName}"); } break; @@ -294,7 +312,8 @@ public class ConventionTests(ITestOutputHelper output) if (IsForbiddenType(evt.EventHandlerType!)) { - errors.Add($"{type.FullName}.{evt.Name} event is forbidden type {evt.EventHandlerType.FullName}"); + errors.Add( + $"{type.FullName}.{evt.Name} event is forbidden type {evt.EventHandlerType.FullName}"); } break; @@ -331,10 +350,12 @@ public class ConventionTests(ITestOutputHelper output) } } } + if (t.IsArray) { return IsForbiddenType(t.GetElementType()!); } + return false; } } @@ -346,15 +367,16 @@ public class ConventionTests(ITestOutputHelper output) // Find all types implementing IStringValue var stringValueTypes = AllTypes.Where(t => t.IsValueType && !t.IsAbstract) - .SelectMany(t => - t.GetInterfaces() - .Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IStronglyTypedValue<>) - && i.GenericTypeArguments[0] == t) - .Select(_ => t)) - .Distinct() - .ToList(); + .SelectMany(t => + t.GetInterfaces() + .Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IStronglyTypedValue<>) + && i.GenericTypeArguments[0] == t) + .Select(_ => t)) + .Distinct() + .ToList(); return stringValueTypes; } + [Fact] public void All_interface_async_methods_should_have_cancellation_token_with_default() { @@ -368,18 +390,22 @@ public class ConventionTests(ITestOutputHelper output) var parameters = method.GetParameters(); if (parameters.Length == 0) { - failures.Add($"{type.FullName}.{method.Name}: Async method should have a CancellationToken parameter with a default value."); + failures.Add( + $"{type.FullName}.{method.Name}: Async method should have a CancellationToken parameter with a default value."); continue; } + var ctParam = parameters.Last(); if (ctParam.ParameterType != typeof(System.Threading.CancellationToken)) { failures.Add($"{type.FullName}.{method.Name}: Last parameter should be CancellationToken."); continue; } + if (!ctParam.HasDefaultValue) { - failures.Add($"{type.FullName}.{method.Name}: CancellationToken parameter should have a default value."); + failures.Add( + $"{type.FullName}.{method.Name}: CancellationToken parameter should have a default value."); } } } diff --git a/bff/test/Bff.Tests/Diagnostics/FrontendCountDiagnosticEntryTests.cs b/bff/test/Bff.Tests/Diagnostics/FrontendCountDiagnosticEntryTests.cs new file mode 100644 index 000000000..ce867f077 --- /dev/null +++ b/bff/test/Bff.Tests/Diagnostics/FrontendCountDiagnosticEntryTests.cs @@ -0,0 +1,45 @@ +// Copyright (c) Duende Software. All rights reserved. +// See LICENSE in the project root for license information. + +using Duende.Bff.DynamicFrontends; +using Duende.Bff.Tests.TestInfra; +using Xunit.Abstractions; + +namespace Duende.Bff.Tests.Diagnostics; + +public class FrontendCountDiagnosticEntryTests(ITestOutputHelper testOutputHelper) : BffTestBase(testOutputHelper) +{ + [Fact] + public async Task Should_print_the_number_of_frontends_during_defined_interval() + { + Bff.OnConfigureBffOptions += options => + { + options.Diagnostics.LogFrequency = TimeSpan.FromHours(1); + }; + + await InitializeAsync(); + + AdvanceClock(TimeSpan.FromHours(1)); + + await Task.Delay(100); + + var bffLogMessages = Context.LogMessages.ToString().Split(Environment.NewLine).Where(x => x.StartsWith("bff")); + bffLogMessages.ShouldContain(x => x.Contains("\"FrontendCount\":0")); + + AddOrUpdateFrontend(new BffFrontend + { + Name = BffFrontendName.Parse("frontend1"), + }); + AddOrUpdateFrontend(new BffFrontend + { + Name = BffFrontendName.Parse("frontend2"), + }); + + AdvanceClock(TimeSpan.FromHours(1)); + + await Task.Delay(100); + + bffLogMessages = Context.LogMessages.ToString().Split(Environment.NewLine).Where(x => x.StartsWith("bff")); + bffLogMessages.ShouldContain(x => x.Contains("\"FrontendCount\":2")); + } +} diff --git a/bff/test/Bff.Tests/LicensingTests.cs b/bff/test/Bff.Tests/LicensingTests.cs index 887ec68cb..59af03634 100644 --- a/bff/test/Bff.Tests/LicensingTests.cs +++ b/bff/test/Bff.Tests/LicensingTests.cs @@ -1,9 +1,6 @@ // Copyright (c) Duende Software. All rights reserved. // See LICENSE in the project root for license information. -using System.Security.Claims; -using Duende.Bff.DynamicFrontends; -using Duende.Bff.Licensing; using Duende.Bff.Tests.TestInfra; using Microsoft.Extensions.Time.Testing; using Xunit.Abstractions; @@ -18,112 +15,38 @@ public class LicensingTests(ITestOutputHelper output) : BffTestBase(output) Bff.LicenseKey = null; await InitializeAsync(); - Context.LogMessages.ToString().ShouldContain("You do not have a valid license key for the Duende BFF security framework"); + var bffLogMessages = Context.LogMessages.ToString().Split(Environment.NewLine).Where(x => x.StartsWith("bff")); + bffLogMessages.ShouldContain(x => x.Contains("You do not have a valid license key for the Duende software.")); } [Fact] public async Task Given_expired_license_then_log_error() { - - Bff.LicenseKey = "eyJhbGciOiJQUzI1NiIsImtpZCI6IklkZW50aXR5U2VydmVyTGljZW5zZWtleS83Y2VhZGJiNzgxMzA0NjllODgwNjg5MTAyNTQxNGYxNiIsInR5cCI6ImxpY2Vuc2Urand0In0.eyJpc3MiOiJodHRwczovL2R1ZW5kZXNvZnR3YXJlLmNvbSIsImF1ZCI6IklkZW50aXR5U2VydmVyIiwiaWF0IjoxNzA0MDY3MjAwLCJleHAiOjE3MzE2Mjg4MDAsImNvbXBhbnlfbmFtZSI6Il90ZXN0IiwiY29udGFjdF9pbmZvIjoiam9lQGR1ZW5kZXNvZnR3YXJlLmNvbSIsImVkaXRpb24iOiJTdGFydGVyIiwiaWQiOiI3ODk2IiwiZmVhdHVyZSI6ImJmZiJ9.YcRGLlVuNBSqNuO1mdXk4GvvVEQFfQUNAnTkzs9W2iNKCxLXrZ5mDPuyTNsDSwEqsfXG8bUCVFxFGp1Bfkxs8hUIBiKuVXfeIB_lmpj5f-KueZ_XlWm0pYT-ROAzVbDdNgMR9YqCPAw8ANclk7HwRcXc0VnLNcKRFrZ0OOWNysFIanTmg7hRIQmDuMLNc2j8HCZSRJ06fijecS72lM4Vv9a6myJvAsASQhKnWTLzQvdzW7T99eobLy45qJu39LMTQkPkkJUS41YPmi2_kEmeMcRucgU4dQKHD5zT9KmzPVWJwsyowWIJ6U7lZ8FXZ8c9POsQeTeQEJY6FheJ2Ut-6Q"; + Bff.LicenseKey = + "eyJhbGciOiJQUzI1NiIsImtpZCI6IklkZW50aXR5U2VydmVyTGljZW5zZWtleS83Y2VhZGJiNzgxMzA0NjllODgwNjg5MTAyNTQxNGYxNiIsInR5cCI6ImxpY2Vuc2Urand0In0.eyJpc3MiOiJodHRwczovL2R1ZW5kZXNvZnR3YXJlLmNvbSIsImF1ZCI6IklkZW50aXR5U2VydmVyIiwiaWF0IjoxNzA0MDY3MjAwLCJleHAiOjE3MzE2Mjg4MDAsImNvbXBhbnlfbmFtZSI6Il90ZXN0IiwiY29udGFjdF9pbmZvIjoiam9lQGR1ZW5kZXNvZnR3YXJlLmNvbSIsImVkaXRpb24iOiJTdGFydGVyIiwiaWQiOiI3ODk2IiwiZmVhdHVyZSI6ImJmZiJ9.YcRGLlVuNBSqNuO1mdXk4GvvVEQFfQUNAnTkzs9W2iNKCxLXrZ5mDPuyTNsDSwEqsfXG8bUCVFxFGp1Bfkxs8hUIBiKuVXfeIB_lmpj5f-KueZ_XlWm0pYT-ROAzVbDdNgMR9YqCPAw8ANclk7HwRcXc0VnLNcKRFrZ0OOWNysFIanTmg7hRIQmDuMLNc2j8HCZSRJ06fijecS72lM4Vv9a6myJvAsASQhKnWTLzQvdzW7T99eobLy45qJu39LMTQkPkkJUS41YPmi2_kEmeMcRucgU4dQKHD5zT9KmzPVWJwsyowWIJ6U7lZ8FXZ8c9POsQeTeQEJY6FheJ2Ut-6Q"; await InitializeAsync(); - Context.LogMessages.ToString().ShouldContain("Your license for Duende BFF security framework has expired on"); + var bffLogMessages = Context.LogMessages.ToString().Split(Environment.NewLine).Where(x => x.StartsWith("bff")); + bffLogMessages.ShouldContain(x => x.Contains("Your license for the Duende Software has expired on ")); } [Fact] public async Task Given_valid_license_then_details() { - SetupValidLicenseWithoutFrontends(); await InitializeAsync(); - var log = Context.LogMessages.ToString(); - log.ShouldContain("Duende BFF security Framework License information:"); - log.ShouldContain("- Edition: Starter"); - log.ShouldContain("- Expiration: 11/15/2024 00:00:00 +00:00"); - log.ShouldContain("- LicenseContact: joe@duendesoftware.com"); - log.ShouldContain("- LicenseContact: joe@duendesoftware.com"); - log.ShouldContain("- Number of frontends licensed: not licensed for multi-frontend feature"); + var bffLogMessages = Context.LogMessages.ToString().Split(Environment.NewLine).Where(x => x.StartsWith("bff")) + .ToList(); + bffLogMessages.ShouldNotContain(x => x.Contains("You do not have a valid license key for the Duende software.")); + bffLogMessages.ShouldNotContain(x => x.Contains("Your license for the Duende Software has expired on ")); } private void SetupValidLicenseWithoutFrontends() { The.Clock = new FakeTimeProvider(new DateTimeOffset(2024, 1, 1, 1, 1, 1, TimeSpan.Zero)); - Bff.LicenseKey = "eyJhbGciOiJQUzI1NiIsImtpZCI6IklkZW50aXR5U2VydmVyTGljZW5zZWtleS83Y2VhZGJiNzgxMzA0NjllODgwNjg5MTAyNTQxNGYxNiIsInR5cCI6ImxpY2Vuc2Urand0In0.eyJpc3MiOiJodHRwczovL2R1ZW5kZXNvZnR3YXJlLmNvbSIsImF1ZCI6IklkZW50aXR5U2VydmVyIiwiaWF0IjoxNzA0MDY3MjAwLCJleHAiOjE3MzE2Mjg4MDAsImNvbXBhbnlfbmFtZSI6Il90ZXN0IiwiY29udGFjdF9pbmZvIjoiam9lQGR1ZW5kZXNvZnR3YXJlLmNvbSIsImVkaXRpb24iOiJTdGFydGVyIiwiaWQiOiI3ODk2IiwiZmVhdHVyZSI6ImJmZiJ9.YcRGLlVuNBSqNuO1mdXk4GvvVEQFfQUNAnTkzs9W2iNKCxLXrZ5mDPuyTNsDSwEqsfXG8bUCVFxFGp1Bfkxs8hUIBiKuVXfeIB_lmpj5f-KueZ_XlWm0pYT-ROAzVbDdNgMR9YqCPAw8ANclk7HwRcXc0VnLNcKRFrZ0OOWNysFIanTmg7hRIQmDuMLNc2j8HCZSRJ06fijecS72lM4Vv9a6myJvAsASQhKnWTLzQvdzW7T99eobLy45qJu39LMTQkPkkJUS41YPmi2_kEmeMcRucgU4dQKHD5zT9KmzPVWJwsyowWIJ6U7lZ8FXZ8c9POsQeTeQEJY6FheJ2Ut-6Q"; - } - - [Fact] - public async Task When_not_licence_for_multi_frontends_then_warns() - { - SetupValidLicenseWithoutFrontends(); - await InitializeAsync(); - - Bff.AddOrUpdateFrontend(Some.BffFrontend()); - var log = Context.LogMessages.ToString(); - log.ShouldContain($"Frontend {The.FrontendName} was added. However, your current license does not support multiple frontends"); - - } - - [Fact] - public async Task When_licenced_for_frontends_then_info() - { - SetupValidLicenseWithoutFrontends(); - - Bff.OnConfigureServices += services => - { - Claim[] claims = [ - new Claim("feature", "bff"), - new Claim("bff_frontend_limit", "10"), - ]; - - services.AddSingleton(sp => - { - return new LicenseValidator( - logger: sp.GetRequiredService>(), - claims: new ClaimsPrincipal(new ClaimsIdentity(claims)), - timeProvider: The.Clock); - }); - }; - await InitializeAsync(); - - Bff.AddOrUpdateFrontend(Some.BffFrontend()); - var log = Context.LogMessages.ToString(); - log.ShouldContain($"Frontend {The.FrontendName} was added. Currently using 1 of 10 in the BFF License"); - - } - - [Fact] - public async Task When_exceeding_number_of_licensed_frontends_then_warning() - { - SetupValidLicenseWithoutFrontends(); - - Bff.OnConfigureServices += services => - { - Claim[] claims = [ - new Claim("feature", "bff"), - new Claim("bff_frontend_limit", "1"), - ]; - - services.AddSingleton(sp => - { - return new LicenseValidator( - logger: sp.GetRequiredService>(), - claims: new ClaimsPrincipal(new ClaimsIdentity(claims)), - timeProvider: The.Clock); - }); - }; - await InitializeAsync(); - - Bff.AddOrUpdateFrontend(Some.BffFrontend()); - Bff.AddOrUpdateFrontend(Some.BffFrontend() with - { - Name = BffFrontendName.Parse("second") - }); - var log = Context.LogMessages.ToString(); - log.ShouldContain($"Frontend {The.FrontendName} was added. Currently using 1 of 1 in the BFF License"); - log.ShouldContain($"Frontend second was added. This exceeds the maximum number of frontends allowed by your license"); - + Bff.LicenseKey = + "eyJhbGciOiJQUzI1NiIsImtpZCI6IklkZW50aXR5U2VydmVyTGljZW5zZWtleS83Y2VhZGJiNzgxMzA0NjllODgwNjg5MTAyNTQxNGYxNiIsInR5cCI6ImxpY2Vuc2Urand0In0.eyJpc3MiOiJodHRwczovL2R1ZW5kZXNvZnR3YXJlLmNvbSIsImF1ZCI6IklkZW50aXR5U2VydmVyIiwiaWF0IjoxNzA0MDY3MjAwLCJleHAiOjE3MzE2Mjg4MDAsImNvbXBhbnlfbmFtZSI6Il90ZXN0IiwiY29udGFjdF9pbmZvIjoiam9lQGR1ZW5kZXNvZnR3YXJlLmNvbSIsImVkaXRpb24iOiJTdGFydGVyIiwiaWQiOiI3ODk2IiwiZmVhdHVyZSI6ImJmZiJ9.YcRGLlVuNBSqNuO1mdXk4GvvVEQFfQUNAnTkzs9W2iNKCxLXrZ5mDPuyTNsDSwEqsfXG8bUCVFxFGp1Bfkxs8hUIBiKuVXfeIB_lmpj5f-KueZ_XlWm0pYT-ROAzVbDdNgMR9YqCPAw8ANclk7HwRcXc0VnLNcKRFrZ0OOWNysFIanTmg7hRIQmDuMLNc2j8HCZSRJ06fijecS72lM4Vv9a6myJvAsASQhKnWTLzQvdzW7T99eobLy45qJu39LMTQkPkkJUS41YPmi2_kEmeMcRucgU4dQKHD5zT9KmzPVWJwsyowWIJ6U7lZ8FXZ8c9POsQeTeQEJY6FheJ2Ut-6Q"; } } diff --git a/bff/test/Bff.Tests/PublicApiVerificationTests.VerifyPublicApi_Bff.verified.txt b/bff/test/Bff.Tests/PublicApiVerificationTests.VerifyPublicApi_Bff.verified.txt index c5bc5fdf4..f99c10a0b 100644 --- a/bff/test/Bff.Tests/PublicApiVerificationTests.VerifyPublicApi_Bff.verified.txt +++ b/bff/test/Bff.Tests/PublicApiVerificationTests.VerifyPublicApi_Bff.verified.txt @@ -309,6 +309,7 @@ namespace Duende.Bff.Configuration public System.Net.Http.HttpMessageHandler? BackchannelHttpHandler { get; set; } public bool BackchannelLogoutAllUserSessions { get; set; } public Duende.Bff.AccessTokenManagement.DPoPProofKey? DPoPJsonWebKey { get; set; } + public Duende.Bff.Configuration.DiagnosticsOptions Diagnostics { get; set; } public System.Collections.Generic.ICollection DiagnosticsEnvironments { get; } public Microsoft.AspNetCore.Http.PathString DiagnosticsPath { get; } public Duende.Bff.Configuration.DisableAntiForgeryCheck DisableAntiForgeryCheck { get; set; } @@ -344,6 +345,12 @@ namespace Duende.Bff.Configuration public Duende.Bff.AccessTokenManagement.Resource? Resource { get; init; } public Duende.Bff.AccessTokenManagement.Scheme? SignInScheme { get; init; } } + public sealed class DiagnosticsOptions + { + public DiagnosticsOptions() { } + public int ChunkSize { get; set; } + public System.TimeSpan LogFrequency { get; set; } + } public delegate bool DisableAntiForgeryCheck(Microsoft.AspNetCore.Http.HttpContext context); } namespace Duende.Bff.DynamicFrontends diff --git a/bff/test/Bff.Tests/TestInfra/TestDataBuilder.cs b/bff/test/Bff.Tests/TestInfra/TestDataBuilder.cs index 7043a2bdb..baeba7605 100644 --- a/bff/test/Bff.Tests/TestInfra/TestDataBuilder.cs +++ b/bff/test/Bff.Tests/TestInfra/TestDataBuilder.cs @@ -20,7 +20,7 @@ public class TestDataBuilder(TestData the) public readonly TestData The = the; internal LicenseValidator LicenseValidator => - new LicenseValidator(new NullLogger(), new ClaimsPrincipal(), The.Clock); + new(new NullLogger(), new ClaimsPrincipal(), The.Clock); public BffFrontend BffFrontend(BffFrontendName? name = null) => new() diff --git a/identity-server/src/IdentityServer/Services/DiagnosticDataService.cs b/identity-server/src/IdentityServer/Services/DiagnosticDataService.cs index f53ccf1ef..1baaaef1d 100644 --- a/identity-server/src/IdentityServer/Services/DiagnosticDataService.cs +++ b/identity-server/src/IdentityServer/Services/DiagnosticDataService.cs @@ -22,7 +22,7 @@ public class DiagnosticDataService _entries = entries; } - public async Task> GetJsonBytesAsync() + public async Task> GetJsonBytesAsync(CancellationToken cancellationToken = default) { var bufferWriter = new ArrayBufferWriter(); await using var writer = new Utf8JsonWriter(bufferWriter, new JsonWriterOptions { Indented = false }); @@ -37,14 +37,14 @@ public class DiagnosticDataService writer.WriteEndObject(); - await writer.FlushAsync(); + await writer.FlushAsync(cancellationToken); return bufferWriter.WrittenMemory; } - public async Task GetJsonStringAsync() + public async Task GetJsonStringAsync(CancellationToken cancellationToken = default) { - var bytes = await GetJsonBytesAsync(); + var bytes = await GetJsonBytesAsync(cancellationToken); return Encoding.UTF8.GetString(bytes.Span); } }