using ScadaLink.Commons.Entities.Audit; using ScadaLink.Commons.Types.Enums; namespace ScadaLink.AuditLog.Configuration; /// /// Configuration for Audit Log (#23). Bound from the AuditLog section of /// appsettings.json. Defaults reflect the design (alog.md §6, §10): an /// 8 KiB payload-summary cap, a 64 KiB cap on error rows, and a 365-day central /// retention window with monthly partition-switch purge. The default /// header-redact list covers HTTP auth headers; per-target overrides extend /// (never replace) the global redactor set. /// public sealed class AuditLogOptions { /// Default payload-summary cap in bytes (default 8 KiB). public int DefaultCapBytes { get; set; } = 8192; /// Payload-summary cap on error rows in bytes (default 64 KiB). public int ErrorCapBytes { get; set; } = 65536; /// HTTP headers redacted by default before persistence. public List HeaderRedactList { get; set; } = new() { "Authorization", "X-Api-Key", "Cookie", "Set-Cookie", }; /// Body-content redactors applied globally (regex patterns). public List GlobalBodyRedactors { get; set; } = new(); /// Per-target redaction overrides keyed by target identifier. public Dictionary PerTargetOverrides { get; set; } = new(); /// Central retention window in days (default 365, range [30, 3650]). public int RetentionDays { get; set; } = 365; /// /// Per-body byte ceiling applied to and /// for rows /// (default 1 MiB). The 8 KiB / 64 KiB default/error caps that apply to other channels /// do not apply here — inbound traffic captures verbatim up to this ceiling and only /// then sets . See /// docs/plans/2026-05-23-inbound-api-full-response-audit-design.md. /// public int InboundMaxBytes { get; set; } = 1_048_576; }