fix: template: enforce bounds of template max_ttl (#3662)

This PR makes the following changes:

- enforces lower and upper limits on template `max_ttl_ms`
- adds a migration to enforce 7-day cap on `max_ttl`
- allows setting template `max_ttl` to 0
- updates template edit CLI help to be clearer
This commit is contained in:
Cian Johnston
2022-08-24 15:45:14 +01:00
committed by GitHub
parent 343d1184b2
commit eba753ba87
9 changed files with 207 additions and 25 deletions

View File

@ -0,0 +1 @@
-- this is a no-op

View File

@ -0,0 +1,2 @@
-- Set a cap of 7 days on template max_ttl
UPDATE templates SET max_ttl = 604800000000000 WHERE max_ttl > 604800000000000;