using System.Text.Json.Serialization;
namespace LibMatrix.Services.WellKnownResolver;
public class WellKnownResolverConfiguration {
///
/// Allow transparent downgrades to plaintext HTTP if HTTPS fails
/// Enabling this is unsafe!
///
[JsonPropertyName("allow_http")]
public bool AllowHttp { get; set; } = false;
///
/// Use DNS resolution if available, for resolving SRV records
///
[JsonPropertyName("allow_dns")]
public bool AllowDns { get; set; } = true;
///
/// Use system resolver(s) if empty
///
[JsonPropertyName("dns_servers")]
public List DnsServers { get; set; } = new();
///
/// Same as AllowDns, but for DNS over HTTPS - useful in browser contexts
///
[JsonPropertyName("allow_doh")]
public bool AllowDoh { get; set; } = true;
///
/// Use DNS over HTTPS - useful in browser contexts
/// Disabled if empty
///
[JsonPropertyName("doh_servers")]
public List DohServers { get; set; } = new();
///
/// Whether to allow fallback subdomain lookups
///
[JsonPropertyName("allow_fallback_subdomains")]
public bool AllowFallbackSubdomains { get; set; } = true;
///
/// Fallback subdomains to try if the homeserver is not found
///
[JsonPropertyName("fallback_subdomains")]
public List FallbackSubdomains { get; set; } = ["matrix", "chat", "im"];
}