mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(security): surface refreshed gateway warnings
This commit is contained in:
@@ -375,6 +375,19 @@ describe("legacy file install scan compatibility", () => {
|
||||
|
||||
expect(result?.blocked).toMatchObject({
|
||||
code: "security_scan_blocked",
|
||||
installPolicyWarning: {
|
||||
targetName: "payload",
|
||||
targetType: "plugin",
|
||||
requestMode: "install",
|
||||
reason: "review the new finding",
|
||||
findings: [
|
||||
{
|
||||
ruleId: "changed-warning",
|
||||
severity: "warn",
|
||||
message: "new finding",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
expect(result?.blocked?.reason).toContain("Reason: review the new finding");
|
||||
expect(result?.blocked?.reason).toContain("new finding");
|
||||
|
||||
@@ -878,6 +878,13 @@ async function runOperatorInstallPolicy(params: {
|
||||
return {
|
||||
blocked: {
|
||||
code: "security_scan_blocked",
|
||||
installPolicyWarning: {
|
||||
targetName: params.targetName,
|
||||
targetType: params.targetType,
|
||||
requestMode: params.requestMode,
|
||||
reason: reevaluated.warning.reason,
|
||||
...(reevaluated.findings?.length ? { findings: reevaluated.findings } : {}),
|
||||
},
|
||||
reason: formatInstallPolicyNotice({
|
||||
decision: "warn",
|
||||
findings: reevaluated.findings,
|
||||
@@ -895,8 +902,8 @@ async function runOperatorInstallPolicy(params: {
|
||||
} else {
|
||||
logPolicyResult(reevaluated);
|
||||
}
|
||||
// Approval covers this warning only after a fresh evaluation. Callers that
|
||||
// offer one-shot approval still reject warnings from later scan stages.
|
||||
// Approval covers only an unchanged warning after a fresh evaluation.
|
||||
// One-shot callers still reject later or changed warnings.
|
||||
return undefined;
|
||||
}
|
||||
if (acknowledgement.status === "unavailable") {
|
||||
|
||||
Reference in New Issue
Block a user