mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 15:00:21 +00:00
hooks: default hooks.internal.enabled to true so bundled hooks load on fresh installs
Made-with: Cursor
This commit is contained in:
committed by
Ayaan Zaidi
parent
3886b65ef2
commit
f849b8de97
@@ -23,9 +23,16 @@ describe("collectAttackSurfaceSummaryFindings", () => {
|
||||
expectedDetail: ["hooks.webhooks: enabled", "hooks.internal: enabled"],
|
||||
},
|
||||
{
|
||||
name: "reports both hook systems as disabled when neither is configured",
|
||||
name: "reports internal hooks as enabled by default and webhooks as disabled when neither is configured",
|
||||
cfg: {} satisfies OpenClawConfig,
|
||||
expectedDetail: ["hooks.webhooks: disabled", "hooks.internal: disabled"],
|
||||
expectedDetail: ["hooks.webhooks: disabled", "hooks.internal: enabled"],
|
||||
},
|
||||
{
|
||||
name: "reports internal hooks as disabled when explicitly set to false",
|
||||
cfg: {
|
||||
hooks: { internal: { enabled: false } },
|
||||
} satisfies OpenClawConfig,
|
||||
expectedDetail: ["hooks.internal: disabled"],
|
||||
},
|
||||
])("$name", ({ cfg, expectedDetail }) => {
|
||||
const [finding] = collectAttackSurfaceSummaryFindings(cfg);
|
||||
|
||||
@@ -526,7 +526,7 @@ export function collectAttackSurfaceSummaryFindings(cfg: OpenClawConfig): Securi
|
||||
const group = summarizeGroupPolicy(cfg);
|
||||
const elevated = cfg.tools?.elevated?.enabled !== false;
|
||||
const webhooksEnabled = cfg.hooks?.enabled === true;
|
||||
const internalHooksEnabled = cfg.hooks?.internal?.enabled === true;
|
||||
const internalHooksEnabled = cfg.hooks?.internal?.enabled !== false;
|
||||
const browserEnabled = cfg.browser?.enabled ?? true;
|
||||
|
||||
const detail =
|
||||
|
||||
Reference in New Issue
Block a user