fix options binding
Some checks failed
Publish NuGets / build (release) Failing after 18s

This commit is contained in:
Mathias Beaulieu-Duncan 2024-12-22 13:10:44 -05:00
parent 892101a84d
commit 0f1f900055
Signed by: mathias
GPG Key ID: 8C3667DADE3B6303
3 changed files with 1 additions and 6 deletions

View File

@ -1,8 +1,5 @@
using System.Diagnostics.CodeAnalysis;
namespace OpenHarbor.JwtTokenManager; namespace OpenHarbor.JwtTokenManager;
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public class JwtTokenManagerOptions public class JwtTokenManagerOptions
{ {
public required string TokenEndpoint { get; set; } public required string TokenEndpoint { get; set; }

View File

@ -1,6 +1,5 @@
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http.Json; using System.Net.Http.Json;
using System.Text.Json;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using OpenHarbor.JwtTokenManager.Abstractions; using OpenHarbor.JwtTokenManager.Abstractions;

View File

@ -22,8 +22,7 @@ public static class ServiceCollectionExtensions
if (string.IsNullOrWhiteSpace(sectionName)) if (string.IsNullOrWhiteSpace(sectionName))
throw new ArgumentException("Section name must be provided.", nameof(sectionName)); throw new ArgumentException("Section name must be provided.", nameof(sectionName));
var section = configuration.GetSection(sectionName); services.Configure<JwtTokenManagerOptions>(configuration.GetSection(sectionName));
services.Configure<JwtTokenManagerBuilderOptions>(section);
// Apply the builder options // Apply the builder options
var builderOptions = new JwtTokenManagerBuilderOptions(); var builderOptions = new JwtTokenManagerBuilderOptions();