refactor(RSATokenDescriptor): Lifetime-Eigenschaft hinzugefügt

This commit is contained in:
Developer 02 2025-01-14 17:04:54 +01:00
parent 3ad08e2a86
commit a0ad8d732d
2 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,8 @@ namespace DigitalData.Core.Abstractions.Security
string? ApiRoute { get; }
TimeSpan Lifetime { get; init; }
#region SecurityTokenDescriptor Map
/// <summary>
/// Defines the compression algorithm that will be used to compress the JWT token payload.

View File

@ -14,6 +14,8 @@ namespace DigitalData.Core.Security.RSAKey
public IAsymmetricTokenValidator Validator => _lazyTokenValidator.Value;
public required TimeSpan Lifetime { get; init; }
#region SecurityTokenDescriptor Map
/// <summary>
/// Gets or sets the value of the 'audience' claim.
@ -32,8 +34,9 @@ namespace DigitalData.Core.Security.RSAKey
/// <summary>
/// Gets or sets the value of the 'expiration' claim. This value should be in UTC.
/// The expiration time is the sum of DateTime.Now and LifeTime.
/// </summary>
public DateTime? Expires { get; set; }
public DateTime? Expires => DateTime.Now.AddTicks(Lifetime.Ticks);
/// <summary>
/// Gets or sets the issuer of this <see cref="SecurityTokenDescriptor"/>.