namespace SimpleOTP.DependencyInjection;
///
/// Configuration for the One-Time Password service.
///
public class OtpServiceConfig
{
///
/// The name of the issuer.
///
public string Issuer { get; set; } = null!;
///
/// The issuer domain.
///
///
/// IMPORTANT: Using this property will imply adherence to the Apple specification.
///
public string? IssuerDomain { get; set; }
///
/// The algorithm to use.
///
public OtpAlgorithm Algorithm { get; set; } = OtpAlgorithm.SHA1;
///
/// The number of digits in the OTP code.
///
public int Digits { get; set; } = 6;
///
/// The number of seconds between each OTP code.
///
public int Period { get; set; } = 30;
///
/// The type of One-Time Password to generate.
///
public OtpType Type { get; set; } = OtpType.Totp;
///
/// The format of OTP URIs.
///
public OtpUriFormat UriFormat { get; set; } = OtpUriFormat.Google;
///
/// Whether to use minimal URI formatting (only required, or altered properties are included), or full URI formatting.
///
public bool MinimalUri { get; set; } = true;
///
/// The tolerance span for the OTP codes validation.
///
public ToleranceSpanConfig ToleranceSpan { get; set; } = new();
///
/// Custom properties to place in OTP URIs.
///
public Dictionary CustomProperties { get; } = [];
}
///
/// Configuration for the tolerance span.
///
public class ToleranceSpanConfig
{
///
/// The number of periods/counter values behind the current value.
///
public int Behind { get; set; } = ToleranceSpan.Default.Behind;
///
/// The number of periods/counter values ahead of the current value.
///
public int Ahead { get; set; } = ToleranceSpan.Default.Ahead;
}