From d5b17a8f24b1980e5c03af2cfeea0a34095774ad Mon Sep 17 00:00:00 2001 From: = Date: Thu, 27 Jun 2024 13:05:30 +0530 Subject: [PATCH] feat: removed explicit check for aws access key credential allowing to pick it automatically --- .../integration-auth/integration-sync-secret.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/services/integration-auth/integration-sync-secret.ts b/backend/src/services/integration-auth/integration-sync-secret.ts index c193b6e4c..4d32f819a 100644 --- a/backend/src/services/integration-auth/integration-sync-secret.ts +++ b/backend/src/services/integration-auth/integration-sync-secret.ts @@ -720,15 +720,15 @@ const syncSecretsAWSSecretManager = async ({ let secretAccessKey = ""; let sessionToken; if (awsAssumeRoleArn) { - if (!appCfg.CLIENT_ID_AWS_INTEGRATION || !appCfg.CLIENT_SECRET_AWS_INTEGRATION) - throw new Error("Missing AWS Credentials for Assuming Role. Contact server admin."); - const client = new STSClient({ region: integration.region as string, - credentials: { - accessKeyId: appCfg.CLIENT_ID_AWS_INTEGRATION, - secretAccessKey: appCfg.CLIENT_SECRET_AWS_INTEGRATION - } + credentials: + appCfg.CLIENT_ID_AWS_INTEGRATION && appCfg.CLIENT_SECRET_AWS_INTEGRATION + ? { + accessKeyId: appCfg.CLIENT_ID_AWS_INTEGRATION, + secretAccessKey: appCfg.CLIENT_SECRET_AWS_INTEGRATION + } + : undefined }); const command = new AssumeRoleCommand({ RoleArn: awsAssumeRoleArn,