Cap sync_interval at 30 days #174

Merged
benvin merged 1 commits from benvin/sync-interval-max into master 2026-10-25 20:23:01 +11:00
Member

sync_interval has no upper bound, so a value above MaxInt32 passes validation and then fails the INTEGER column insert as a 500, and very large values overflow time.Duration.

  • add MaxSyncInterval (30 days in seconds)
  • reject sync_interval above it with a 400 via ValidateSyncInterval
  • cover the boundary in TestValidateSyncInterval and over-limit values in TestSyncIntervalAPI
sync_interval has no upper bound, so a value above MaxInt32 passes validation and then fails the INTEGER column insert as a 500, and very large values overflow time.Duration. - add MaxSyncInterval (30 days in seconds) - reject sync_interval above it with a 400 via ValidateSyncInterval - cover the boundary in TestValidateSyncInterval and over-limit values in TestSyncIntervalAPI
unkin-agent added 1 commit 2026-10-25 19:15:23 +11:00
Cap sync_interval at 30 days
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
7336df8a0e
Author
Member
  • internal/api/v2/remotes_ttl_test.go:96 — over-limit cases only exercise POST; the update handler (remotes.go:156) is validated but untested → nit: add a PUT/PATCH over-limit case expecting 400.
- internal/api/v2/remotes_ttl_test.go:96 — over-limit cases only exercise POST; the update handler (remotes.go:156) is validated but untested → nit: add a PUT/PATCH over-limit case expecting 400.
benvin merged commit 5f33abba93 into master 2026-10-25 20:23:01 +11:00
benvin deleted branch benvin/sync-interval-max 2026-10-25 20:23:02 +11:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#174