namespace OpenWaf.Infrastructure.Geo; /// What the loaded MMDB actually is. The reference repo stores a /// dbip-city-lite database under the legacy GeoLite2-Country.mmdb name /// and sniffs the real type from metadata rather than trusting the path; this /// is the same rule, surfaced. The build date is here because the database is /// pinned by a build ARG and ages with the image — a country policy enforced on /// a stale database misclassifies reallocated ranges invisibly. public sealed record GeoDatabaseInfo( string Path, string DatabaseType, DateTimeOffset? BuildDate, bool SupportsCity) { public TimeSpan? Age => BuildDate is null ? null : DateTimeOffset.UtcNow - BuildDate.Value; public bool IsStale(TimeSpan maxAge) => BuildDate is not null && DateTimeOffset.UtcNow - BuildDate.Value > maxAge; }