mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 09:35:39 +00:00
6d7692ea6a
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.
16 lines
495 B
JavaScript
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)');
|
|
});
|
|
});
|