mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
fix(admin): guard revisions and tenant targets
Read-time authorization alone cannot protect concurrent edits. Guard revisions, current roles and destination ownership in the write transaction, and use per-group endpoints for isolated changes.
This commit is contained in:
1 parent
4fc784ab9f
commit
2ec541ad7c
10 files changed
+2615
-300
No files matched your search
@@ -9,6 +9,9 @@ import {
|
||||
adminApiMe,
|
||||
adminApiGroupsGet,
|
||||
adminApiGroupsPut,
|
||||
adminGroupCreate,
|
||||
adminGroupUpdate,
|
||||
adminGroupDelete,
|
||||
adminApiRoutesGet,
|
||||
adminApiRoutesPut,
|
||||
adminApiLogs,
|
||||
@@ -40,6 +43,11 @@ export default defineEventHandler((event) => {
|
||||
if (seg[0] === "groups" && seg.length === 1) {
|
||||
if (method === "GET") return adminApiGroupsGet(event);
|
||||
if (method === "PUT") return adminApiGroupsPut(event);
|
||||
if (method === "POST") return adminGroupCreate(event);
|
||||
}
|
||||
if (seg[0] === "groups" && seg.length === 2) {
|
||||
if (method === "PUT") return adminGroupUpdate(event, seg[1]!);
|
||||
if (method === "DELETE") return adminGroupDelete(event, seg[1]!);
|
||||
}
|
||||
if (seg[0] === "routes" && seg.length === 1) {
|
||||
if (method === "GET") return adminApiRoutesGet(event);
|
||||
|
||||
Reference in new issue
Block a user