fix: enforce settings authority boundaries (#618)

Close generic settings authorization bypasses and enforce per-setting authority, validation, redaction, transactional config import, and route-local write rate limiting.
This commit is contained in:
SnapOtter
2026-07-22 20:15:38 +08:00
committed by GitHub
parent 0467e87bfe
commit 44d8109486
63 changed files with 2287 additions and 731 deletions
+10 -1
View File
@@ -4,7 +4,16 @@ import { changedSettings, writableSettings } from "@/lib/settings-payload";
describe("writableSettings", () => {
it("strips server-managed read-only keys that the PUT rejects", () => {
expect(
writableSettings({ instance_id: "abc", cookie_secret: "shh", defaultTheme: "dark" }),
writableSettings({
instance_id: "abc",
cookie_secret: "shh",
scim_token_hash: "hash",
siem_config: "{}",
webhook_destinations: "[]",
ipAllowlist: "[]",
audit_archival_state: "state",
defaultTheme: "dark",
}),
).toEqual({ defaultTheme: "dark" });
});