X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=blobdiff_plain;f=test%2Fsrc%2Flogger.js;fp=test%2Fsrc%2Flogger.js;h=cb5914b3584cb100ba15e91054d9a5758005c9e4;hp=3441f940d40251caa678b4e20f5d1f2c839c2ddb;hb=fba42a499fe1af051b0982c1f3e8b3873c9ed2fb;hpb=e8dccf76ec2776f07eddd1ce2f1c4fc150a6f790 diff --git a/test/src/logger.js b/test/src/logger.js index 3441f94..cb5914b 100644 --- a/test/src/logger.js +++ b/test/src/logger.js @@ -51,6 +51,32 @@ describe('Logger', function () { assert(logger.backend.info.args[0][0].includes('"********"')); }); + it('masks noisy cookie header', function () { + logger.info('testScope', 'message', { + ctx: { + cookie: { + squeepSession: 'blahblahblahblahblah', + }, + }, + }); + assert(logger.backend.info.called); + assert(logger.backend.info.args[0][0].includes('[scrubbed 20 bytes]')); + }); + + it('masks otp values', function () { + logger.info('teestScope', 'message', { + ctx: { + otpKey: '1234567890123456789012', + otpConfirmKey: '1234567890123456789012', + otpConfirmBox: 'xxxMysteryxxx', + otpState: 'xxxMysteryxxx', + } + }); + assert(logger.backend.info.called); + assert(!logger.backend.info.args[0][0].includes('"1234567890123456789012"')); + assert(!logger.backend.info.args[0][0].includes('"xxxMysteryxxx"')); + }); + it('strips uninteresting scope dross', function () { logger.info('testScope', 'message', { ctx: {