From 37091526224f281cc4b32c9995ebc41f7b4a1e11 Mon Sep 17 00:00:00 2001 From: Dadam Rishikesh Reddy Date: Thu, 19 Feb 2026 16:50:26 +0530 Subject: [PATCH] feat(root): added _token and removed condition of staging and testing Changes: - Added _token and replaced the walletPassphrase with walletpassphrase -Removed the condition of staging and testing and make it available to all environments. TICKET: WP-7944 --- modules/logger/src/logger.ts | 16 ++-------------- modules/logger/src/sanitizeLog.ts | 3 ++- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/modules/logger/src/logger.ts b/modules/logger/src/logger.ts index 295b460650..46ad167d82 100644 --- a/modules/logger/src/logger.ts +++ b/modules/logger/src/logger.ts @@ -1,25 +1,13 @@ import { sanitize } from './sanitizeLog'; /** - * BitGo Logger with automatic sanitization in test/staging environments + * BitGo Logger with automatic sanitization for all environments */ class BitGoLogger { /** - * Determines if sanitization should be applied based on NODE_ENV - */ - private shouldSanitize(): boolean { - const env = process.env.NODE_ENV; - return env === 'test' || env === 'staging'; - } - - /** - * Sanitizes arguments if in test/staging environment + * Sanitizes arguments for all environments */ private sanitizeArgs(args: unknown[]): unknown[] { - if (!this.shouldSanitize()) { - return args; - } - return args.map((arg) => { if (typeof arg === 'object' && arg !== null) { return sanitize(arg); diff --git a/modules/logger/src/sanitizeLog.ts b/modules/logger/src/sanitizeLog.ts index fbbf38996f..12b49e81d9 100644 --- a/modules/logger/src/sanitizeLog.ts +++ b/modules/logger/src/sanitizeLog.ts @@ -11,7 +11,8 @@ const SENSITIVE_KEYS = new Set([ 'password', 'otp', 'passphrase', - 'walletPassphrase', + 'walletpassphrase', + '_token', ]); const BEARER_V2_PATTERN = /^v2x[a-f0-9]{32,}$/i;