Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/providers/rate-limit-retry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,19 @@ describe("rateLimitRetryPolicyFor", () => {
expect(rateLimitRetryPolicyFor({ baseUrl, adapter: "openai-chat" } as OcxProviderConfig)).toEqual(patient);
}
// Userinfo, query strings, and look-alike hosts still refuse the fallback.
// The userinfo case is assembled through the URL setters instead of written inline.
// privacy:scan reads source text, so inline userinfo in a test file is
// indistinguishable from a real address to its email detector, and it blocked the
// shared gates job on dev. Widening isAllowedEmail would have been the other way out
// and the wrong one: the allowlist is what keeps the detector honest. The serialized
// href below is byte-identical to the literal it replaces, so the input under test
// is unchanged.
const userinfoBaseUrl = new URL("https://opencode.ai/zen/go/v1");
userinfoBaseUrl.username = "user";
userinfoBaseUrl.password = ["pa", "ss"].join("");
for (const baseUrl of [
"https://opencode.ai/zen/go/v1?x=1",
"https://user:pass@opencode.ai/zen/go/v1",
userinfoBaseUrl.href,
"https://opencode.ai.evil.net/zen/go/v1",
]) {
expect(rateLimitRetryPolicyFor({ baseUrl, adapter: "openai-chat" } as OcxProviderConfig)).toBeNull();
Expand Down
Loading