mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:54:30 +00:00
feat(gateway): allow notifications.list for android nodes
This commit is contained in:
@@ -334,6 +334,19 @@ describe("resolveNodeCommandAllowlist", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("includes Android notifications.list by default", () => {
|
||||||
|
const allow = resolveNodeCommandAllowlist(
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
platform: "android 16",
|
||||||
|
deviceFamily: "Android",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(allow.has("notifications.list")).toBe(true);
|
||||||
|
expect(allow.has("system.notify")).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
it("can explicitly allow dangerous commands via allowCommands", () => {
|
it("can explicitly allow dangerous commands via allowCommands", () => {
|
||||||
const allow = resolveNodeCommandAllowlist(
|
const allow = resolveNodeCommandAllowlist(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const CAMERA_DANGEROUS_COMMANDS = ["camera.snap", "camera.clip"];
|
|||||||
const SCREEN_DANGEROUS_COMMANDS = ["screen.record"];
|
const SCREEN_DANGEROUS_COMMANDS = ["screen.record"];
|
||||||
|
|
||||||
const LOCATION_COMMANDS = ["location.get"];
|
const LOCATION_COMMANDS = ["location.get"];
|
||||||
|
const NOTIFICATION_COMMANDS = ["notifications.list"];
|
||||||
|
|
||||||
const DEVICE_COMMANDS = ["device.info", "device.status"];
|
const DEVICE_COMMANDS = ["device.info", "device.status"];
|
||||||
|
|
||||||
@@ -69,6 +70,7 @@ const PLATFORM_DEFAULTS: Record<string, string[]> = {
|
|||||||
...CANVAS_COMMANDS,
|
...CANVAS_COMMANDS,
|
||||||
...CAMERA_COMMANDS,
|
...CAMERA_COMMANDS,
|
||||||
...LOCATION_COMMANDS,
|
...LOCATION_COMMANDS,
|
||||||
|
...NOTIFICATION_COMMANDS,
|
||||||
...DEVICE_COMMANDS,
|
...DEVICE_COMMANDS,
|
||||||
...CONTACTS_COMMANDS,
|
...CONTACTS_COMMANDS,
|
||||||
...CALENDAR_COMMANDS,
|
...CALENDAR_COMMANDS,
|
||||||
|
|||||||
Reference in New Issue
Block a user