mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -77,7 +77,7 @@ describe("API key permission scoping", () => {
|
||||
method: "PUT",
|
||||
url: "/api/v1/settings",
|
||||
headers: { authorization: `Bearer ${apiKey}` },
|
||||
payload: { testSetting: "hacked" },
|
||||
payload: { defaultTheme: "dark" },
|
||||
});
|
||||
expect(writeRes.statusCode).toBe(403);
|
||||
});
|
||||
@@ -96,7 +96,7 @@ describe("API key permission scoping", () => {
|
||||
method: "PUT",
|
||||
url: "/api/v1/settings",
|
||||
headers: { authorization: `Bearer ${body.key}` },
|
||||
payload: { testSetting: "value" },
|
||||
payload: { defaultTheme: "dark" },
|
||||
});
|
||||
expect(writeRes.statusCode).toBe(200);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user