mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-11 13:49:03 +00:00
ed96e94806
- Updated session control mechanisms to ensure proper handling of remote input and clipboard operations. - Introduced session authorization checks to validate operator permissions before starting desktop sessions. - Improved input injection logic to prevent unauthorized access during active sessions. - Added new capabilities for managing session flags and controls, ensuring a more robust and secure desktop experience. - Enhanced error handling and logging for better traceability of session-related actions.
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
const bundleService = require('../services/agentBundleService');
|
|
|
|
describe('Support Agent bundle transport policy', () => {
|
|
const baseBranding = {
|
|
company_name: 'Example Support',
|
|
server_host: 'desk.example.test',
|
|
};
|
|
|
|
it('defaults generated Support Agent profiles to HTTPS', () => {
|
|
const result = bundleService.validateBranding(baseBranding);
|
|
expect(result.valid).toBe(true);
|
|
expect(result.normalized.use_https).toBe(true);
|
|
});
|
|
|
|
it('rejects plaintext transport unless explicitly enabled for development', () => {
|
|
const previous = process.env.BETTERDESK_ALLOW_INSECURE_DEV_AGENT_BUNDLES;
|
|
delete process.env.BETTERDESK_ALLOW_INSECURE_DEV_AGENT_BUNDLES;
|
|
try {
|
|
const result = bundleService.validateBranding({
|
|
...baseBranding,
|
|
use_https: false,
|
|
});
|
|
expect(result.valid).toBe(false);
|
|
expect(result.errors).toContain('https_required');
|
|
} finally {
|
|
if (previous === undefined) {
|
|
delete process.env.BETTERDESK_ALLOW_INSECURE_DEV_AGENT_BUNDLES;
|
|
} else {
|
|
process.env.BETTERDESK_ALLOW_INSECURE_DEV_AGENT_BUNDLES = previous;
|
|
}
|
|
}
|
|
});
|
|
});
|