From 855158d0bbbd71fd090bf3cfa5d425f621a4d157 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Tue, 5 Dec 2023 19:34:43 +0700 Subject: [PATCH] Allow MI to create another MI test --- backend/src/ee/routes/v3/machineIdentity.ts | 2 +- backend/src/validation/machineIdentity.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/ee/routes/v3/machineIdentity.ts b/backend/src/ee/routes/v3/machineIdentity.ts index 66d32b13c..0550cf14f 100644 --- a/backend/src/ee/routes/v3/machineIdentity.ts +++ b/backend/src/ee/routes/v3/machineIdentity.ts @@ -37,7 +37,7 @@ router.post( router.post( "/", requireAuth({ - acceptedAuthModes: [AuthMode.JWT] + acceptedAuthModes: [AuthMode.JWT, AuthMode.MACHINE_ACCESS_TOKEN] }), machineIdentityController.createMachineIdentity ); diff --git a/backend/src/validation/machineIdentity.ts b/backend/src/validation/machineIdentity.ts index 49347a306..74d3ee92a 100644 --- a/backend/src/validation/machineIdentity.ts +++ b/backend/src/validation/machineIdentity.ts @@ -51,7 +51,7 @@ export const CreateMachineIdentityV3 = z.object({ .array() .min(1) .default([{ ipAddress: "0.0.0.0/0" }]), - accessTokenTTL: z.number().int().min(1) + accessTokenTTL: z.number().int().min(1).default(7200) }) });