Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

1.0 KB
Raw Blame
import { describe, expect, it } from "vitest";

import { browserOpenCommand } from "../src/auth/oauth-flow.js";

describe("OAuth browser launch platform contract", () => {
  it("passes a hostile Windows OAuth URL as one literal argv token", () => {
    const url = "https://login.example/callback?state=a&next=\"calc.exe\"|more";
    const command = browserOpenCommand(url, "win32", {
      SystemRoot: "D:\\Windows",
    });

    expect(command).toEqual({
      file: "D:\\Windows\\System32\\rundll32.exe",
      args: ["url.dll,FileProtocolHandler", url],
      options: { windowsHide: true, timeout: 5_000 },
    });
    expect(command.args).toHaveLength(2);
  });

  it("uses argv-only native openers on macOS and Linux", () => {
    const url = "https://login.example/path with spaces?state=a&b=c";

    expect(browserOpenCommand(url, "darwin")).toMatchObject({
      file: "open",
      args: [url],
    });
    expect(browserOpenCommand(url, "linux")).toMatchObject({
      file: "xdg-open",
      args: [url],
    });
  });
});