Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

Handle quoted authentication URLs (#179)

Dipesh Babu9eb2fa2c5171
diff --git a/sdk/typescript/src/auth.ts b/sdk/typescript/src/auth.ts
index c8e755477..d53a42f0f 100644
--- a/sdk/typescript/src/auth.ts
+++ b/sdk/typescript/src/auth.ts
@@ -461,7 +461,7 @@ export async function runCodex(
function preferredAuthUrl(value: string): string | null {
for (const match of plainTerminalText(value).matchAll(
- /https?:\/\/[^\s<>]+/g,
+ /https?:\/\/[^\s<>"']+/g,
)) {
const url = match[0].replace(/[.,;:!?)\]}]+$/, "");
try {
diff --git a/sdk/typescript/tests-ts/auth.test.ts b/sdk/typescript/tests-ts/auth.test.ts
index 08a2e4348..fca13e135 100644
--- a/sdk/typescript/tests-ts/auth.test.ts
+++ b/sdk/typescript/tests-ts/auth.test.ts
@@ -58,7 +58,7 @@ if (args.join(" ") === "login --with-api-key") {
console.error("Listening on http://[::ffff:127.0.0.1]:1455.");
console.error("Listening on http://[::ffff:0.0.0.0]:1455.");
console.error("Listening on http://[::127.0.0.1]:1455.");
- console.error("Open \\u001b[32mhttps://127.auth.example.test/device\\u001b[0m");
+ console.error('Open "\\u001b[32mhttps://127.auth.example.test/device\\u001b[0m"');
console.error("Enter this one-time code");
console.error("\\u001b[36m8356-V2EGR\\u001b[0m");
process.exit(0);
@@ -167,7 +167,7 @@ setInterval(() => {}, 1000);
await expect(logout(command, process.env)).resolves.toBeUndefined();
});
- test("captures interactive login metadata and completion", async () => {
+ test("captures quoted interactive login metadata and completion", async () => {
const command = await fakeCodex();
let succeeded = false;
const handle = new CodexLoginHandle(