mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-07 15:21:06 +00:00
fix(exec): clarify and cover auto host override guard
This commit is contained in:
committed by
Peter Steinberger
parent
dae6632da1
commit
5dca81271c
@@ -57,6 +57,33 @@ describe("resolveExecTarget", () => {
|
||||
}),
|
||||
).toThrow("exec host not allowed");
|
||||
});
|
||||
|
||||
it("also rejects gateway override when configured host is auto", () => {
|
||||
expect(() =>
|
||||
resolveExecTarget({
|
||||
configuredTarget: "auto",
|
||||
requestedTarget: "gateway",
|
||||
elevatedRequested: false,
|
||||
sandboxAvailable: true,
|
||||
}),
|
||||
).toThrow("exec host not allowed");
|
||||
});
|
||||
|
||||
it("allows explicit auto request when configured host is auto", () => {
|
||||
expect(
|
||||
resolveExecTarget({
|
||||
configuredTarget: "auto",
|
||||
requestedTarget: "auto",
|
||||
elevatedRequested: false,
|
||||
sandboxAvailable: true,
|
||||
}),
|
||||
).toMatchObject({
|
||||
configuredTarget: "auto",
|
||||
requestedTarget: "auto",
|
||||
selectedTarget: "auto",
|
||||
effectiveHost: "sandbox",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("emitExecSystemEvent", () => {
|
||||
|
||||
Reference in New Issue
Block a user