refactor: update TTL validation to allow a maximum of 10 years and adjust environment variable defaults for AWS credentials

This commit is contained in:
Victor Santos
2025-10-27 14:51:16 -03:00
parent 7a31ea6eda
commit 5e9ff00630
3 changed files with 11 additions and 12 deletions
@@ -107,9 +107,8 @@ const formSchema = z.object({
const valMs = ms(val);
if (valMs < 60 * 1000)
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "TTL must be a greater than 1min" });
// a day
if (valMs > 24 * 60 * 60 * 1000)
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "TTL must be less than a day" });
if (valMs > ms("10y"))
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "TTL must be less than 10 years" });
}),
name: z.string().refine((val) => val.toLowerCase() === val, "Must be lowercase"),
environment: z.object({ name: z.string(), slug: z.string() }),