From 4b5d0d0e5ee325cc319eaa9168002bd89c20ae00 Mon Sep 17 00:00:00 2001 From: barsa Date: Fri, 12 Dec 2025 18:44:51 +0900 Subject: [PATCH] Update .gitignore and enhance environment validation for Salesforce private key handling - Added 'dist2/' to .gitignore to exclude additional build outputs. - Updated environment validation schema to include optional support for Salesforce private key in base64 format, improving flexibility in configuration. --- .gitignore | 2 ++ apps/bff/src/core/config/env.validation.ts | 8 ++++++++ portal-backend.latest.tar.gz.sha256 | 2 +- portal-frontend.latest.tar.gz.sha256 | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 57c08a1a..2ac8b3b3 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ secrets/ # Build outputs dist/ +dist2/ build/ .next/ @@ -134,6 +135,7 @@ temp/ # Build outputs and development artifacts **/dist/ +**/dist2/ **/.next/ **/build/ **/*.tsbuildinfo diff --git a/apps/bff/src/core/config/env.validation.ts b/apps/bff/src/core/config/env.validation.ts index 300576bc..ff78dec0 100644 --- a/apps/bff/src/core/config/env.validation.ts +++ b/apps/bff/src/core/config/env.validation.ts @@ -67,6 +67,14 @@ export const envSchema = z.object({ SF_USERNAME: z.string().optional(), SF_CLIENT_ID: z.string().optional(), SF_PRIVATE_KEY_PATH: z.string().optional(), + // Optional: provide the Salesforce private key directly via environment variables. + // Supports: + // - PEM text (with -----BEGIN ... PRIVATE KEY----- headers), including single-line keys + // - base64-encoded DER + // - base64-encoded PEM text + // + // If set, this takes precedence over SF_PRIVATE_KEY_PATH. + SF_PRIVATE_KEY_BASE64: z.string().optional(), SF_AUTH_TIMEOUT_MS: z.coerce.number().int().positive().default(30000), SF_TOKEN_TTL_MS: z.coerce.number().int().positive().default(720000), SF_TOKEN_REFRESH_BUFFER_MS: z.coerce.number().int().positive().default(60000), diff --git a/portal-backend.latest.tar.gz.sha256 b/portal-backend.latest.tar.gz.sha256 index 2be94011..e92d6615 100644 --- a/portal-backend.latest.tar.gz.sha256 +++ b/portal-backend.latest.tar.gz.sha256 @@ -1 +1 @@ -dee6d178f1599a05911c9b6fb1246105112b7e81bfbac4e7df87ed91ca8a46c9 /home/barsa/projects/customer_portal/customer-portal/portal-backend.latest.tar.gz +b9e6a7c804df143f276ec06e4411004e08475923b35e8c29fb20495b1a637e61 /home/barsa/projects/customer_portal/customer-portal/portal-backend.latest.tar.gz diff --git a/portal-frontend.latest.tar.gz.sha256 b/portal-frontend.latest.tar.gz.sha256 index 4a1c7663..0dde62ab 100644 --- a/portal-frontend.latest.tar.gz.sha256 +++ b/portal-frontend.latest.tar.gz.sha256 @@ -1 +1 @@ -2595c445c8ed1dd73006d5f4e35adea931de3c101260e1e0e1126790a761812c /home/barsa/projects/customer_portal/customer-portal/portal-frontend.latest.tar.gz +d342327a541914cf92d768189597fb2323e1faf55d2eadfb56edc8cf5cec7a75 /home/barsa/projects/customer_portal/customer-portal/portal-frontend.latest.tar.gz