mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 00:16:38 +00:00
feat: share stale Codex translator path scanner
This commit is contained in:
1 parent
604ef7be81
commit
46d73ae79f
5 files changed
+150
-51
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
|
||||
import { findCodexTranslatorUrlPaths } from '../../../src/shared/stale-codex-translator-settings';
|
||||
|
||||
describe('stale Codex translator settings scanner', () => {
|
||||
it('reports nested object and array paths without returning sensitive values', () => {
|
||||
const settings = {
|
||||
env: {
|
||||
SAFE_VALUE: 'keep-me',
|
||||
ANTHROPIC_BASE_URL: 'http://127.0.0.1:8317/api/provider/codex',
|
||||
},
|
||||
hooks: {
|
||||
PostToolUse: [
|
||||
{
|
||||
matcher: 'Read',
|
||||
config: {
|
||||
headers: {
|
||||
Authorization: 'Bearer secret',
|
||||
},
|
||||
endpoint: 'https://proxy.example.com/api/provider/codex/v1/messages',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
'custom-key': ['https://proxy.example.com/api/provider/codex'],
|
||||
};
|
||||
|
||||
expect(findCodexTranslatorUrlPaths(settings)).toEqual([
|
||||
'env.ANTHROPIC_BASE_URL',
|
||||
'hooks.PostToolUse[0].config.endpoint',
|
||||
'["custom-key"][0]',
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user