feat(IAsymmetricTokenDescriptor): Methode Validator.get mit Lazy Loading hinzugefügt.

This commit is contained in:
Developer 02
2025-01-10 23:32:53 +01:00
parent 39091ff5cf
commit b90a52412c
5 changed files with 27 additions and 6 deletions

View File

@@ -10,6 +10,10 @@ namespace DigitalData.Core.Security.RSAKey
{
public string? ApiRoute { get; init; }
private readonly Lazy<RSATokenValidator> _lazyTokenValidator;
public IAsymmetricTokenValidator Validator => _lazyTokenValidator.Value;
#region SecurityTokenDescriptor Map
/// <summary>
/// Gets or sets the value of the 'audience' claim.
@@ -102,6 +106,8 @@ namespace DigitalData.Core.Security.RSAKey
public RSATokenDescriptor()
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
_lazyTokenValidator = new(CreatePublicKey<RSATokenValidator>);
_lazyRsaSecurityKey = new(() => new RsaSecurityKey(RSA));
_lazySigningCredentials = new(() => SigningDigest is null