From 691cbe0a4f6d361f6beeb2856e83c7e23f5a6cd2 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Wed, 30 Jul 2025 11:15:10 -0700 Subject: [PATCH] fix: correct issue client secret rotation interval check --- .../azure-client-secret/azure-client-secret-rotation-fns.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts index 57bfb6d59..84fcfdd90 100644 --- a/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts +++ b/backend/src/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns.ts @@ -199,7 +199,8 @@ export const azureClientSecretRotationFactory: TRotationFactory< ) => { const credentials = await $rotateClientSecret(); - if (rotationInterval > 365 * 5 - EXPIRY_PADDING_IN_DAYS) { + // 2.5 years as expiry is set to x2 interval for the inactive period of credential + if (rotationInterval > Math.floor(365 * 2.5) - EXPIRY_PADDING_IN_DAYS) { throw new BadRequestError({ message: "Azure does not support token duration over 5 years" }); }