mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-19 07:06:29 +00:00
* fix(crestodian): keep onboarding RPCs restart-safe * fix(profiles): isolate approval state migrations * fix(crestodian): bypass configured gateway setup * test(crestodian): type onboarding mocks * fix(onboarding): require inference before Crestodian * fix(onboarding): enforce verified inference handoff * fix(macos): reset setup on gateway endpoint edits * chore(i18n): refresh native source inventory * fix(gateway): keep socket on request cancellation * test(packaging): require workspace templates * fix(onboarding): bind setup to verified inference * fix(onboarding): align inference gate contracts * fix(crestodian): classify concurrent policy rejection * test(crestodian): expect registry restoration * fix(onboarding): bind setup to configured gateways * fix(codex): preserve startup phase deadlines * test(crestodian): match fail-closed policy ordering * test(onboarding): assert bound gateway handoff * fix(codex): bind runtime resolution to spawn cwd * test(crestodian): assert policy rejection order * fix(cli): preserve gateway routing across restarts * fix(macos): fail closed during gateway edits * test(macos): cover gateway route generation races * chore: keep release notes out of onboarding PR * fix(ci): refresh onboarding generated checks * style(swift): align gateway channel formatting * fix(ci): refresh plugin SDK surface budgets * fix(ci): resync native string inventory * refactor(swift): split gateway channel support * test(doctor): isolate plugin compatibility registry * test(macos): isolate gateway onboarding fixtures * test(macos): assert gateway lease health ordering * fix(codex): reconcile computer-use startup changes
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
import type { AuthProfileStore } from "openclaw/plugin-sdk/agent-runtime";
|
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
import {
|
|
fingerprintCodexAppServerAuthBinding,
|
|
prepareCodexAppServerAuthBinding,
|
|
} from "./auth-binding.js";
|
|
|
|
describe("Codex app-server auth binding", () => {
|
|
afterEach(() => vi.unstubAllEnvs());
|
|
|
|
it("materializes a SecretRef once and fingerprints the executed store", async () => {
|
|
const profileId = "openai:work";
|
|
const store: AuthProfileStore = {
|
|
version: 1,
|
|
profiles: {
|
|
[profileId]: {
|
|
type: "api_key",
|
|
provider: "openai",
|
|
keyRef: { source: "env", provider: "default", id: "OPENAI_WORK_KEY" },
|
|
},
|
|
},
|
|
};
|
|
const params = {
|
|
authProfileId: profileId,
|
|
authProfileStore: store,
|
|
agentDir: "/tmp/openclaw-codex-auth-binding",
|
|
config: {
|
|
auth: { profiles: { [profileId]: { provider: "openai", mode: "api_key" as const } } },
|
|
},
|
|
};
|
|
vi.stubEnv("OPENAI_WORK_KEY", "work-key-a");
|
|
|
|
const prepared = await prepareCodexAppServerAuthBinding(params);
|
|
expect(prepared?.authProfileStore).not.toBe(store);
|
|
expect(prepared?.authProfileStore.profiles[profileId]).toEqual({
|
|
type: "api_key",
|
|
provider: "openai",
|
|
key: "work-key-a",
|
|
});
|
|
expect(store.profiles[profileId]).toEqual({
|
|
type: "api_key",
|
|
provider: "openai",
|
|
keyRef: { source: "env", provider: "default", id: "OPENAI_WORK_KEY" },
|
|
});
|
|
expect(await fingerprintCodexAppServerAuthBinding(params)).toBe(prepared?.fingerprint);
|
|
|
|
vi.stubEnv("OPENAI_WORK_KEY", "work-key-b");
|
|
expect(await fingerprintCodexAppServerAuthBinding(params)).not.toBe(prepared?.fingerprint);
|
|
});
|
|
});
|