mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
fix(search): bound the clinical kinds by the search budget, one search per actor, query in a POST body
This commit is contained in:
1 parent
138792d555
commit
41049b3837
19 files changed
+637
-178
No files matched your search
@@ -154,6 +154,13 @@ describe("proxy.ts DEMO_MODE mutation allowlist", () => {
|
||||
).toBe(403);
|
||||
});
|
||||
|
||||
it("permits the record search, a read that travels as a POST", () => {
|
||||
// The query rides the body so it stays out of URLs and access logs; the
|
||||
// route writes nothing, so the demo searches like any other instance.
|
||||
expect(proxy(makeRequest("/api/search", "POST")).status).not.toBe(403);
|
||||
expect(proxy(makeRequest("/api/search", "DELETE")).status).toBe(403);
|
||||
});
|
||||
|
||||
it("still blocks a health-data mutation (POST /api/measurements)", () => {
|
||||
const res = proxy(makeRequest("/api/measurements", "POST"));
|
||||
expect(res.status).toBe(403);
|
||||
|
||||
Reference in new issue
Block a user