36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using Microsoft.AspNetCore.SignalR.Client;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace DigitalData.Auth.Client;
|
|
|
|
public class ClientParams
|
|
{
|
|
public string Url { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Controls when the client attempts to reconnect and how many times it does so.
|
|
/// </summary>
|
|
public IRetryPolicy? RetryPolicy { get; private set; }
|
|
|
|
private TimeSpan? _retryDelay;
|
|
|
|
/// <summary>
|
|
/// To be able to serilize the simple <seealso cref="RetryPolicy"/>
|
|
/// </summary>
|
|
public TimeSpan? RetryDelay
|
|
{
|
|
get => _retryDelay;
|
|
set
|
|
{
|
|
RetryPolicy = new RetryPolicy(ctx => RetryDelay);
|
|
_retryDelay = value;
|
|
}
|
|
}
|
|
|
|
public event ClientEvent OnPublicKeyReceived = ClientEvents.UpdatePublicKeys;
|
|
|
|
internal void TriggerOnPublicReceivedEvent(AuthClient client, string issuer, string audience, string key, ILogger? logger = null)
|
|
=> OnPublicKeyReceived(client, issuer, audience, key, logger);
|
|
|
|
public List<ClientPublicKey> PublicKeys { get; set; } = new();
|
|
} |