ironlicensing-dotnet/LicensingOptions.cs

57 lines
1.8 KiB
C#

namespace IronLicensing.Client;
public class LicensingOptions
{
/// <summary>
/// Public API key for client authentication (pk_live_xxx or pk_test_xxx)
/// </summary>
public string PublicKey { get; set; } = string.Empty;
/// <summary>
/// Product identifier slug (e.g., "git-cleaner")
/// </summary>
public string ProductSlug { get; set; } = string.Empty;
/// <summary>
/// Base URL for the IronLicensing API
/// </summary>
public string ApiBaseUrl { get; set; } = "https://ironlicensing.com/api/v1";
/// <summary>
/// Number of days to allow offline usage before requiring online validation
/// </summary>
public int OfflineGraceDays { get; set; } = 7;
/// <summary>
/// How often to re-validate license when online (in minutes)
/// </summary>
public int CacheValidationMinutes { get; set; } = 60;
/// <summary>
/// HTTP request timeout
/// </summary>
public TimeSpan HttpTimeout { get; set; } = TimeSpan.FromSeconds(30);
/// <summary>
/// Optional signing public key for offline signature verification.
/// If not provided, will be fetched from server and cached.
/// </summary>
public string? SigningPublicKey { get; set; }
/// <summary>
/// Enable strict offline validation requiring valid signatures.
/// If false, allows offline validation without signature verification.
/// </summary>
public bool RequireSignatureForOffline { get; set; } = true;
/// <summary>
/// Custom success URL for purchase redirects (deep link)
/// </summary>
public string SuccessUrl { get; set; } = "ironlicensing://purchase-success";
/// <summary>
/// Custom cancel URL for purchase redirects (deep link)
/// </summary>
public string CancelUrl { get; set; } = "ironlicensing://purchase-cancelled";
}