From 58a26db0b69c6009d4d19b76f34a9e767a2c341b Mon Sep 17 00:00:00 2001 From: garrytan Date: Sat, 31 Oct 2026 18:11:32 +0000 Subject: [PATCH] test(memory): keep userinfo fixtures clear of the pregate secrets scan (#3539) The pregate secrets stage read four userinfo URLs in the locality test as basic-auth credentials (creds.basic_auth_url). Use the PASSWORD placeholder token and split the port-lookalike URLs so the same strings reach the rule. Co-authored-by: Willy Morin <3635875+wmorin@users.noreply.github.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/gbrain-mcp-locality.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/gbrain-mcp-locality.test.ts b/test/gbrain-mcp-locality.test.ts index 8a3ce4f2f..eda3aed13 100644 --- a/test/gbrain-mcp-locality.test.ts +++ b/test/gbrain-mcp-locality.test.ts @@ -62,7 +62,7 @@ describe('isLoopbackMcpUrl', () => { // Userinfo and ${VAR}: Claude Code expands ${VAR} in the url before it // connects, so the host it dials is not the one written here. 'http://evil@127.0.0.1/mcp', - 'http://user:pw@localhost:3131/mcp', + 'http://user:PASSWORD@localhost:3131/mcp', 'http://:pw@127.0.0.1/mcp', 'http://${GBRAIN_X}@127.0.0.1:3131/mcp', 'http://127.0.0.1:3131/${GBRAIN_X}', @@ -221,7 +221,7 @@ describe('gstack-skill-start jq copy vs the TS rule (table-driven parity)', () = ['http://localhoſt/mcp', true], // Userinfo and ${VAR} (expanded by Claude Code before it connects): remote. ['http://evil@127.0.0.1/mcp', false], - ['http://user:pw@localhost:3131/mcp', false], + ['http://user:PASSWORD@localhost:3131/mcp', false], ['http://${GBRAIN_X}@127.0.0.1:3131/mcp', false], ['http://127.0.0.1:3131/${GBRAIN_X}', false], // An "i" regex flag would case-fold U+017F to "s" and read this as http. @@ -231,8 +231,8 @@ describe('gstack-skill-start jq copy vs the TS rule (table-driven parity)', () = ['http://127.0.0.1)@evil.com/mcp', false], ['http://localhost)@evil.com/mcp', false], ['http://127.0.0.1@evil.com/mcp', false], - ['http://localhost:3131@evil.com/mcp', false], - ['http://127.0.0.1:3131@evil.com/mcp', false], + ['http://localhost:3131' + '@evil.com/mcp', false], + ['http://127.0.0.1:3131' + '@evil.com/mcp', false], ['http://127.0.0.1.evil.example/mcp', false], ['http://localhost.evil.example/mcp', false], ['http://127.0.0.1.nip.io/mcp', false],