Files
BetterDesk/web-nodejs/tests/agentBundleService.security.test.js
T
UNITRONIX ed96e94806 refactor(agent): enhance session management and input handling
- 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.
2026-08-06 00:50:02 +02:00

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;
}
}
});
});