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
@@ -43,7 +43,10 @@ export async function processWebhook(
|
||||
if (!groups.some((g) => g.id === tenantId)) {
|
||||
return { status: 404, body: { error: "Group not found" } };
|
||||
}
|
||||
const secret = await getTenantSecret(env.KV, tenantId);
|
||||
const secret = await getTenantSecret(
|
||||
env.KV,
|
||||
groups.find((g) => g.id === tenantId)!,
|
||||
);
|
||||
if (!secret) {
|
||||
return { status: 404, body: { error: "Webhook disabled for this group" } };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user