diff --git a/CHANGELOG.md b/CHANGELOG.md index 005d23aab..52a81e22c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to ## Unreleased +### Fixed + +- Changed logger to fully mask config field values, rather than displaying last + 4 chars + ### Added - Updated jest matchers in the following way: diff --git a/packages/integration-sdk-runtime/src/logger/__tests__/index.test.ts b/packages/integration-sdk-runtime/src/logger/__tests__/index.test.ts index 627fbba89..863197d79 100644 --- a/packages/integration-sdk-runtime/src/logger/__tests__/index.test.ts +++ b/packages/integration-sdk-runtime/src/logger/__tests__/index.test.ts @@ -244,7 +244,7 @@ describe('createIntegrationLogger', () => { }), ).toEqual({ anything: '***', - masked: '****cret', + masked: '***', unmasked: 'this is clear', }); }); diff --git a/packages/integration-sdk-runtime/src/logger/index.ts b/packages/integration-sdk-runtime/src/logger/index.ts index 7a062b647..5abd177e6 100644 --- a/packages/integration-sdk-runtime/src/logger/index.ts +++ b/packages/integration-sdk-runtime/src/logger/index.ts @@ -144,9 +144,7 @@ function createInstanceConfigSerializer< for (const k of Object.keys(config)) { const field = fields && fields[k]; if (field) { - serialized[k] = field.mask - ? `****${config[k].substr(-4)}` - : config[k]; + serialized[k] = field.mask ? '***' : config[k]; } else { serialized[k] = '***'; }