mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 15:44:31 +00:00
Gateway: add SecretRef support for gateway.auth.token with auth-mode guardrails (#35094)
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user