Locks: admin-configurable expiry cap for manual locks (#394) #397

Merged
Cordy merged 10 commits from lock-cap into main 2026-09-02 20:08:47 +00:00
Owner

Implements #394 (deferred L4 from #315).

  • lockMaxHours setting (0 = off, the default) with validation, persisted with the rest of the settings.
  • filelock.Store.SetMaxAge hook: a policy lens consulted at liveness checks (Live/List/rename-carry) for user-type locks only. Existing locks are affected immediately by a settings change, and turning the cap off revives them — the policy is never baked into stored records (save-time pruning still uses only a dav lock's own Expires). Dav locks keep their RFC timeouts.
  • Wired in main.go from the settings store; no restart needed.
  • Admin UI: "Manual lock expiry (hours)" number field in Basic settings (shared set-* field relocation), load/save through the existing merge-over-serverSettings PUT, i18n ×4.
  • Tests: cap semantics (old manual lock lapses, fresh one and dav lock unaffected, cap-off revives), settings validation, mutation check on the age comparison.

Closes #394.

Implements #394 (deferred L4 from #315). - `lockMaxHours` setting (0 = off, the default) with validation, persisted with the rest of the settings. - `filelock.Store.SetMaxAge` hook: a policy lens consulted at liveness checks (`Live`/`List`/rename-carry) for `user`-type locks only. Existing locks are affected immediately by a settings change, and turning the cap off revives them — the policy is never baked into stored records (save-time pruning still uses only a dav lock's own `Expires`). Dav locks keep their RFC timeouts. - Wired in `main.go` from the settings store; no restart needed. - Admin UI: "Manual lock expiry (hours)" number field in Basic settings (shared `set-*` field relocation), load/save through the existing merge-over-serverSettings PUT, i18n ×4. - Tests: cap semantics (old manual lock lapses, fresh one and dav lock unaffected, cap-off revives), settings validation, mutation check on the age comparison. Closes #394.
Cordy merged commit 8843886870 into main 2026-09-02 20:08:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#397
No description provided.