mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:30:43 +00:00
fix(codex): hash app-server env values in client keys
This commit is contained in:
committed by
Peter Steinberger
parent
20ff49f7c8
commit
a1c88f3ebe
@@ -302,6 +302,27 @@ describe("Codex app-server config", () => {
|
||||
expect(second).not.toContain("tok_second");
|
||||
});
|
||||
|
||||
it("derives distinct shared-client keys for distinct env values without exposing them", () => {
|
||||
const first = codexAppServerStartOptionsKey({
|
||||
transport: "stdio",
|
||||
command: "codex",
|
||||
args: ["app-server"],
|
||||
headers: {},
|
||||
env: { OPENAI_API_KEY: "sk-first" },
|
||||
});
|
||||
const second = codexAppServerStartOptionsKey({
|
||||
transport: "stdio",
|
||||
command: "codex",
|
||||
args: ["app-server"],
|
||||
headers: {},
|
||||
env: { OPENAI_API_KEY: "sk-second" },
|
||||
});
|
||||
|
||||
expect(first).not.toEqual(second);
|
||||
expect(first).not.toContain("sk-first");
|
||||
expect(second).not.toContain("sk-second");
|
||||
});
|
||||
|
||||
it("keeps runtime config keys aligned with manifest schema and UI hints", async () => {
|
||||
const manifest = JSON.parse(
|
||||
await fs.readFile(new URL("../../openclaw.plugin.json", import.meta.url), "utf8"),
|
||||
|
||||
@@ -304,7 +304,9 @@ export function codexAppServerStartOptionsKey(
|
||||
headers: Object.entries(options.headers).toSorted(([left], [right]) =>
|
||||
left.localeCompare(right),
|
||||
),
|
||||
env: Object.entries(options.env ?? {}).toSorted(([left], [right]) => left.localeCompare(right)),
|
||||
env: Object.entries(options.env ?? {})
|
||||
.toSorted(([left], [right]) => left.localeCompare(right))
|
||||
.map(([key, value]) => [key, hashSecretForKey(value)]),
|
||||
clearEnv: [...(options.clearEnv ?? [])].toSorted(),
|
||||
authProfileId: params.authProfileId ?? null,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user