feat: share stale Codex translator path scanner

This commit is contained in:
Tam Nhu Tran committed 2026-05-22 12:10:54 -04:00
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]',
]);
});
});