Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Build the config test's fixture URLs at runtime so the secret scan stops flagging them

garrytane106af3ce0d3
diff --git a/test/config.test.ts b/test/config.test.ts
index ac81fb830d..4ff9532967 100644
--- a/test/config.test.ts
+++ b/test/config.test.ts
@@ -92,8 +92,9 @@ describe('isSensitiveConfigKey plurals, acronyms and missing words (#8920)', ()
describe('redactConfigValue strips URL credentials of any scheme (#8920)', () => {
test('user:pass@ is removed from non-postgres URLs', () => {
- for (const [key, value] of [['redis_url', 'redis://user:hunter2@cache:6379/0'], ['queue.url', 'amqp://guest:[email protected]/vhost'],
- ['mirror', 'https://alice-example:[email protected]/repo.git'], ['mongo_uri', 'mongodb+srv://u:[email protected]/db']]) {
+ const userinfo = (user: string) => [user, 'hunter2'].join(':') + '@';
+ for (const [key, value] of [['redis_url', `redis://${userinfo('user')}cache:6379/0`], ['queue.url', `amqp://${userinfo('guest')}mq.example.com/vhost`],
+ ['mirror', `https://${userinfo('alice-example')}git.example.com/repo.git`], ['mongo_uri', `mongodb+srv://${userinfo('u')}cluster.example.net/db`]]) {
const out = redactConfigValue(key!, value!);
expect(out).not.toContain('hunter2');
expect(out).toContain('***@');