mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 09:35:39 +00:00
647a3221f9
Hash RustDesk access tokens at rest (phase 1), add SSRF guards for admin network tools with LAN monitoring support, run dedicated console service user on Linux, and hook post-update verification plus service patching into both betterdesk.sh and the in-app updater.
18 lines
533 B
JavaScript
18 lines
533 B
JavaScript
'use strict';
|
|
|
|
const { hashAccessToken } = require('../lib/tokenHash');
|
|
|
|
describe('tokenHash', () => {
|
|
it('produces stable SHA-256 hex for the same token', () => {
|
|
const token = 'a'.repeat(64);
|
|
expect(hashAccessToken(token)).toHaveLength(64);
|
|
expect(hashAccessToken(token)).toBe(hashAccessToken(token));
|
|
});
|
|
|
|
it('differs for different tokens', () => {
|
|
const a = hashAccessToken('a'.repeat(64));
|
|
const b = hashAccessToken('b'.repeat(64));
|
|
expect(a).not.toBe(b);
|
|
});
|
|
});
|