part #2
This commit is contained in:
@@ -5,8 +5,8 @@ namespace StellaOps.Cryptography.Kms;
|
||||
/// </summary>
|
||||
public sealed class GcpKmsOptions
|
||||
{
|
||||
private TimeSpan metadataCacheDuration = TimeSpan.FromMinutes(5);
|
||||
private TimeSpan publicKeyCacheDuration = TimeSpan.FromMinutes(10);
|
||||
private TimeSpan _metadataCacheDuration = TimeSpan.FromMinutes(5);
|
||||
private TimeSpan _publicKeyCacheDuration = TimeSpan.FromMinutes(10);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the service endpoint (default: <c>kms.googleapis.com</c>).
|
||||
@@ -18,8 +18,8 @@ public sealed class GcpKmsOptions
|
||||
/// </summary>
|
||||
public TimeSpan MetadataCacheDuration
|
||||
{
|
||||
get => metadataCacheDuration;
|
||||
set => metadataCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(5));
|
||||
get => _metadataCacheDuration;
|
||||
set => _metadataCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(5));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -27,16 +27,10 @@ public sealed class GcpKmsOptions
|
||||
/// </summary>
|
||||
public TimeSpan PublicKeyCacheDuration
|
||||
{
|
||||
get => publicKeyCacheDuration;
|
||||
set => publicKeyCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(10));
|
||||
get => _publicKeyCacheDuration;
|
||||
set => _publicKeyCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(10));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional factory that can construct a custom GCP facade (primarily used for testing).
|
||||
/// </summary>
|
||||
public Func<IServiceProvider, IGcpKmsFacade>? FacadeFactory { get; set; }
|
||||
|
||||
private static TimeSpan EnsurePositive(TimeSpan value, TimeSpan @default)
|
||||
=> value <= TimeSpan.Zero ? @default : value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user