Files
BetterDesk/web-nodejs/tests/logRedact.test.js
UNITRONIX 6d7692ea6a fix(security): phase-A log redaction, font/transfer paths, CI permissions
Stop logging generated admin passwords, redact API login usernames,
confine font and file-transfer temp paths with safePath, and scope
GitHub Actions permissions in build.yml.
2026-06-09 02:42:56 +02:00

16 lines
495 B
JavaScript

'use strict';
const { redactUrlForLog, redactUsernameForLog } = require('../lib/logRedact');
describe('logRedact', () => {
test('redactUrlForLog strips credentials', () => {
expect(redactUrlForLog('https://user:secret@example.com/path'))
.toBe('https://example.com/path');
});
test('redactUsernameForLog masks username', () => {
expect(redactUsernameForLog('admin')).toBe('a***n');
expect(redactUsernameForLog('')).toBe('(empty)');
});
});