mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:10:49 +00:00
fix(browser): require admin scope for browser request
Co-authored-by: RichardCao <RichardCao@users.noreply.github.com>
This commit is contained in:
@@ -118,6 +118,17 @@ describe("browser plugin", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("registers browser.request as an admin gateway method", () => {
|
||||
const { api, registerGatewayMethod } = createApi();
|
||||
registerBrowserPlugin(api);
|
||||
|
||||
expect(registerGatewayMethod).toHaveBeenCalledWith(
|
||||
"browser.request",
|
||||
runtimeApiMocks.handleBrowserGatewayRequest,
|
||||
{ scope: "operator.admin" },
|
||||
);
|
||||
});
|
||||
|
||||
it("declares setup auto-enable reasons for browser config surfaces", () => {
|
||||
const probe = registerBrowserAutoEnableProbe();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export function registerBrowserPlugin(api: OpenClawPluginApi) {
|
||||
})) as OpenClawPluginToolFactory);
|
||||
api.registerCli(({ program }) => registerBrowserCli(program), { commands: ["browser"] });
|
||||
api.registerGatewayMethod("browser.request", handleBrowserGatewayRequest, {
|
||||
scope: "operator.write",
|
||||
scope: "operator.admin",
|
||||
});
|
||||
api.registerService(createBrowserPluginService());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user