'This is a log line with a session ID 0531032fc7415b7cc1b7516480ad121d391eddce3cfb2cee27dd5b215609c32827\n'+
'and another one 05766049a70e725ad02f7fe61b10e461380a4d7433f98096b3cacbf0362d5cab62';
'This is a log line with a session ID 0531032fc7415b7cc1b7516480ad121d391eddce3cfb2cee27dd5b215609c32827 and another one 05766049a70e725ad02f7fe61b10e461380a4d7433f98096b3cacbf0362d5cab62';
constactual=Privacy.redactSessionID(text);
constexpected=
'This is a log line with a session ID [REDACTED]\n and another one [REDACTED]';
constexpected='This is a log line with a session ID [REDACTED] and another one [REDACTED]';
assert.equal(actual,expected);
});
it('should not redact non session IDS',()=>{
consttext=
'This is a log line with a non-session ID sadsad0531032fc7415b7cc1b7516480ad121d391eddce3cfb2cee27dd5b215609c32827888\n'+
'and another one 766049a70e725ad02f7fe61b10e461380a4d7433f98096b3cacbf0362d5cab6234';
'This is a log line with a non-session ID sadsad0531032fc7415b7cc1b7516480ad121d391eddce3cfb2cee27dd5b215609c32827888 and another one 766049a70e725ad02f7fe61b10e461380a4d7433f98096b3cacbf0362d5cab6234';
constactual=Privacy.redactSessionID(text);
assert.equal(actual,text);
@ -31,12 +28,11 @@ describe('Privacy', () => {
describe('redactGroupIds',()=>{
it('should redact all group IDs',()=>{
consttext='This is a log line with two group IDs: group(123456789)\nand group(abcdefghij)';
consttext='This is a log line with two group IDs: group(123456789)and group(abcdefghij)';
constactual=Privacy.redactGroupIds(text);
constexpected=
'This is a log line with two group IDs: group([REDACTED]789)\n'+
'and group([REDACTED]hij)';
'This is a log line with two group IDs: group([REDACTED]789) and group([REDACTED]hij)';