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
@@ -72,8 +72,8 @@ export const registerDynamicSecretRouter = async (server: FastifyZodProvider) =>
const valMs = ms(val);
if (valMs < 60 * 1000)
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "TTL must be a greater than 1min" });
if (valMs > daysToMillisecond(1))
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" });
})
.nullable(),
path: z.string().describe(DYNAMIC_SECRETS.CREATE.path).trim().default("/").transform(removeTrailingSlash),