Merge PR #5784: fix(auth): isolate import tests from ambient broker config (@roboomp)

This commit is contained in:
can1357
2026-07-18 20:12:47 +02:00
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -116,6 +116,9 @@
### Fixed
- Fixed the cmux browser backend failing inside `cmux ssh` sessions by dialing loopback `CMUX_SOCKET_PATH` values over TCP and completing the relay HMAC-SHA256 challenge-response with credentials from the session environment or `~/.cmux/relay/<port>.auth` ([#5788](https://github.com/can1357/oh-my-pi/issues/5788)).
### Fixed
- Isolated the CLIProxyAPI auth-broker import tests from ambient broker configuration so fixture credentials cannot be uploaded to a live broker ([#5782](https://github.com/can1357/oh-my-pi/issues/5782)).
## [17.0.1] - 2026-07-16
@@ -22,9 +22,14 @@ describe("auth-broker import (CLIProxyAPI)", () => {
let agentDir = "";
let cliproxyDir = "";
let originalAgentDir: string | undefined;
const savedEnv: Record<string, string | undefined> = {};
beforeEach(async () => {
originalAgentDir = process.env.OMP_AGENT_DIR;
savedEnv.OMP_AUTH_BROKER_URL = process.env.OMP_AUTH_BROKER_URL;
savedEnv.OMP_AUTH_BROKER_TOKEN = process.env.OMP_AUTH_BROKER_TOKEN;
delete process.env.OMP_AUTH_BROKER_URL;
delete process.env.OMP_AUTH_BROKER_TOKEN;
agentDir = await fs.mkdtemp(path.join(os.tmpdir(), "omp-import-agent-"));
cliproxyDir = await fs.mkdtemp(path.join(os.tmpdir(), "omp-import-cliproxy-"));
setAgentDir(agentDir);
@@ -36,6 +41,10 @@ describe("auth-broker import (CLIProxyAPI)", () => {
else process.env.OMP_AGENT_DIR = originalAgentDir;
await removeWithRetries(agentDir);
await removeWithRetries(cliproxyDir);
for (const key of ["OMP_AUTH_BROKER_URL", "OMP_AUTH_BROKER_TOKEN"] as const) {
if (savedEnv[key] === undefined) delete process.env[key];
else process.env[key] = savedEnv[key];
}
});
async function writeCliProxyJson(name: string, body: Record<string, unknown>): Promise<string> {