mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 10:14:36 +00:00
chore: release v2.4.5 with comprehensive testing and documentation updates
This commit is contained in:
1 parent
7e2ee14f6f
commit
966a43f0f9
28 files changed
+2149
-853
No files matched your search
@@ -1,7 +1,7 @@
|
||||
const assert = require('assert');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const { expandPath, validateProfileName, isPathSafe } = require('../../../bin/helpers');
|
||||
const { expandPath } = require('../../../bin/helpers');
|
||||
|
||||
describe('helpers', () => {
|
||||
describe('expandPath', () => {
|
||||
@@ -24,34 +24,4 @@ describe('helpers', () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateProfileName', () => {
|
||||
it('accepts valid profile names', () => {
|
||||
assert(validateProfileName('glm'));
|
||||
assert(validateProfileName('sonnet-4-5'));
|
||||
assert(validateProfileName('my_profile'));
|
||||
assert(validateProfileName('profile123'));
|
||||
});
|
||||
|
||||
it('rejects invalid profile names', () => {
|
||||
assert(!validateProfileName('profile with spaces'));
|
||||
assert(!validateProfileName('profile@special'));
|
||||
assert(!validateProfileName('profile;injection'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('isPathSafe', () => {
|
||||
it('accepts safe paths', () => {
|
||||
assert(isPathSafe('/usr/local/bin/claude'));
|
||||
assert(isPathSafe('C:\\Program Files\\Claude\\claude.exe'));
|
||||
assert(isPathSafe('/home/user/.local/bin/claude'));
|
||||
});
|
||||
|
||||
it('rejects unsafe paths', () => {
|
||||
assert(!isPathSafe('/usr/bin/claude; rm -rf /'));
|
||||
assert(!isPathSafe('/usr/bin/claude|bash'));
|
||||
assert(!isPathSafe('/usr/bin/claude&echo pwned'));
|
||||
assert(!isPathSafe('/usr/bin/claude$(whoami)'));
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user