From a55d64e430c5ee018980026ca6d393b37b5dfc9a Mon Sep 17 00:00:00 2001 From: Meet Date: Fri, 13 Sep 2024 03:52:09 +0530 Subject: [PATCH 1/2] chore: add log on empty value being pushed to gcp --- .../integration-auth/integration-sync-secret.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/src/services/integration-auth/integration-sync-secret.ts b/backend/src/services/integration-auth/integration-sync-secret.ts index 97525b032..2db6f20a2 100644 --- a/backend/src/services/integration-auth/integration-sync-secret.ts +++ b/backend/src/services/integration-auth/integration-sync-secret.ts @@ -207,6 +207,12 @@ const syncSecretsGCPSecretManager = async ({ } ); + if (!secrets[key].value) { + logger.warn( + `[GCP_SECRET_SYNC_1]: Empty secret value for key: ${key} and integration appId: ${integration.appId}` + ); + } + await request.post( `${IntegrationUrls.GCP_SECRET_MANAGER_URL}/v1/projects/${integration.appId}/secrets/${key}:addVersion`, { @@ -237,6 +243,12 @@ const syncSecretsGCPSecretManager = async ({ } ); } else if (secrets[key].value !== res[key]) { + if (!secrets[key].value) { + logger.warn( + `[GCP_SECRET_SYNC_2]: Empty secret value for key: ${key} and integration appId: ${integration.appId}` + ); + } + await request.post( `${IntegrationUrls.GCP_SECRET_MANAGER_URL}/v1/projects/${integration.appId}/secrets/${key}:addVersion`, { From f1aa2fbd84dc8405ad603e6d5913b0cdb86673f8 Mon Sep 17 00:00:00 2001 From: Meet Date: Fri, 13 Sep 2024 15:34:12 +0530 Subject: [PATCH 2/2] chore: better log string --- .../src/services/integration-auth/integration-sync-secret.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/services/integration-auth/integration-sync-secret.ts b/backend/src/services/integration-auth/integration-sync-secret.ts index 2db6f20a2..5085d4253 100644 --- a/backend/src/services/integration-auth/integration-sync-secret.ts +++ b/backend/src/services/integration-auth/integration-sync-secret.ts @@ -209,7 +209,7 @@ const syncSecretsGCPSecretManager = async ({ if (!secrets[key].value) { logger.warn( - `[GCP_SECRET_SYNC_1]: Empty secret value for key: ${key} and integration appId: ${integration.appId}` + `syncSecretsGcpsecretManager: create secret value in gcp where [key=${key}] and integration appId [appId=${integration.appId}]` ); } @@ -245,7 +245,7 @@ const syncSecretsGCPSecretManager = async ({ } else if (secrets[key].value !== res[key]) { if (!secrets[key].value) { logger.warn( - `[GCP_SECRET_SYNC_2]: Empty secret value for key: ${key} and integration appId: ${integration.appId}` + `syncSecretsGcpsecretManager: update secret value in gcp where [key=${key}] and integration appId [appId=${integration.appId}]` ); }