fix(webui): treat the epoch export start as any time

This commit is contained in:
sam committed 2026-10-25 22:05:34 +11:00
1 parent 392f78733f
commit 56fe8071c4
1 file changed
+12 -1
+12 -1
View File
@@ -230,10 +230,21 @@ func auditExportFormat(r *http.Request) (string, bool) {
return "", false
}
// auditExportAllTime is the "any time" sentinel the dashboard sends for
// from. An export from the epoch is bounded by the page cap and deadline
// instead of the usual year.
var auditExportAllTime = time.Unix(0, 0).UTC()
// auditExportRange requires an explicit window of at most a year: an unbounded
// export would stream the instance's whole history.
func auditExportRange(filter audit.Filter) error {
if filter.From.IsZero() || filter.To.IsZero() || filter.To.Sub(filter.From) > auditExportMaxRange {
if filter.From.IsZero() || filter.To.IsZero() {
return errors.New("choose an export time range of 366 days or less")
}
if filter.From.Equal(auditExportAllTime) {
return nil
}
if filter.To.Sub(filter.From) > auditExportMaxRange {
return errors.New("choose an export time range of 366 days or less")
}
return nil