From d484bcab19aeba2599a1fd907a1a1fdd4d08d451 Mon Sep 17 00:00:00 2001 From: Alex Klarfeld Date: Mon, 18 Dec 2023 09:18:29 -0800 Subject: [PATCH] Fixed remote config --- src/index.ts | 15 +++++++-------- src/utils.ts | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6535793..705e74d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,11 +65,11 @@ const Supergood = () => { config?: Partial; metadata?: Partial; } = { - clientId: process.env.SUPERGOOD_CLIENT_ID as string, - clientSecret: process.env.SUPERGOOD_CLIENT_SECRET as string, - config: {} as Partial, - metadata: {} as Partial - }, + clientId: process.env.SUPERGOOD_CLIENT_ID as string, + clientSecret: process.env.SUPERGOOD_CLIENT_SECRET as string, + config: {} as Partial, + metadata: {} as Partial + }, baseUrl = process.env.SUPERGOOD_BASE_URL || 'https://api.supergood.ai' ) => { if (!clientId) throw new Error(errors.NO_CLIENT_ID); @@ -130,7 +130,7 @@ const Supergood = () => { async (request: IsomorphicRequest, requestId: string) => { // Don't intercept if there's no remote config set // to avoid sensitive keys being sent to the SG server. - if(!supergoodConfig.remoteConfig) return; + if (!supergoodConfig.remoteConfig) return; try { const url = new URL(request.url); @@ -181,7 +181,7 @@ const Supergood = () => { let requestData = { url: '' }; let responseData = {}; - if(!supergoodConfig.remoteConfig) return; + if (!supergoodConfig.remoteConfig) return; try { const requestData = requestCache.get(requestId) as { @@ -289,7 +289,6 @@ const Supergood = () => { } if (data.length) { log.debug(`Flushed ${data.length} events`, { force }); - log.debug(`Flushing Ids: ${data.map((event) => event.request.id)}`) } } catch (e) { const error = e as Error; diff --git a/src/utils.ts b/src/utils.ts index d53627e..a6e0e79 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -165,6 +165,7 @@ const redactValuesFromKeys = ( const value = _get(event, keyPath); if (value) { _set(event, keyPath, null); + // Don't return : for null values sensitiveKeyMetadata.push({ keyPath: unmarshalKeyPath(keyPath), ...redactValue(value) }); } }