Gateway: add SecretRef support for gateway.auth.token with auth-mode guardrails (#35094)

This commit is contained in:
Josh Avant
2026-03-05 12:53:56 -06:00
committed by GitHub
parent bc66a8fa81
commit 72cf9253fc
112 changed files with 5750 additions and 465 deletions

View File

@@ -3256,5 +3256,35 @@ description: test skill
}),
);
});
it("adds warning finding when probe auth SecretRef is unavailable", async () => {
const cfg: OpenClawConfig = {
gateway: {
mode: "local",
auth: {
mode: "token",
token: { source: "env", provider: "default", id: "MISSING_GATEWAY_TOKEN" },
},
},
secrets: {
providers: {
default: { source: "env" },
},
},
};
const res = await audit(cfg, {
deep: true,
deepTimeoutMs: 50,
probeGatewayFn: async (opts) => successfulProbeResult(opts.url),
env: {},
});
const warning = res.findings.find(
(finding) => finding.checkId === "gateway.probe_auth_secretref_unavailable",
);
expect(warning?.severity).toBe("warn");
expect(warning?.detail).toContain("gateway.auth.token");
});
});
});