From d058f424108fe1367d6ae8757a6f68acb31fee21 Mon Sep 17 00:00:00 2001 From: simon-id Date: Fri, 22 Nov 2024 15:08:03 +0100 Subject: [PATCH] Revert log change to avoid a conflict (#4931) * Update passport.js * update tests --- packages/dd-trace/src/appsec/passport.js | 2 +- packages/dd-trace/test/appsec/passport.spec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dd-trace/src/appsec/passport.js b/packages/dd-trace/src/appsec/passport.js index 0cbcb4b51b..2093b7b1fd 100644 --- a/packages/dd-trace/src/appsec/passport.js +++ b/packages/dd-trace/src/appsec/passport.js @@ -86,7 +86,7 @@ function passportTrackEvent (credentials, passportUser, rootSpan, mode) { const user = parseUser(getLogin(credentials), passportUser, mode) if (user['usr.id'] === undefined) { - log.warn('[ASM] No user ID found in authentication instrumentation') + log.warn('No user ID found in authentication instrumentation') return } diff --git a/packages/dd-trace/test/appsec/passport.spec.js b/packages/dd-trace/test/appsec/passport.spec.js index fcfeb9549f..7a3db36798 100644 --- a/packages/dd-trace/test/appsec/passport.spec.js +++ b/packages/dd-trace/test/appsec/passport.spec.js @@ -41,7 +41,7 @@ describe('Passport', () => { it('should call log when credentials is undefined', () => { passportModule.passportTrackEvent(undefined, undefined, undefined, 'safe') - expect(log.warn).to.have.been.calledOnceWithExactly('[ASM] No user ID found in authentication instrumentation') + expect(log.warn).to.have.been.calledOnceWithExactly('No user ID found in authentication instrumentation') }) it('should call log when type is not known', () => { @@ -49,7 +49,7 @@ describe('Passport', () => { passportModule.passportTrackEvent(credentials, undefined, undefined, 'safe') - expect(log.warn).to.have.been.calledOnceWithExactly('[ASM] No user ID found in authentication instrumentation') + expect(log.warn).to.have.been.calledOnceWithExactly('No user ID found in authentication instrumentation') }) it('should call log when type is known but username not present', () => { @@ -57,7 +57,7 @@ describe('Passport', () => { passportModule.passportTrackEvent(credentials, undefined, undefined, 'safe') - expect(log.warn).to.have.been.calledOnceWithExactly('[ASM] No user ID found in authentication instrumentation') + expect(log.warn).to.have.been.calledOnceWithExactly('No user ID found in authentication instrumentation') }) it('should report login failure when passportUser is not present', () => {