Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/backend/Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ export function createHandler({
}

if (action === HandleAction.Mutate && request.method === 'POST') {
const user = expectUser()
const user = userCtx?.user
expectJson()
const policy = await local.createPolicy(user.roles)
const policy = user && (await local.createPolicy(user.roles))
const mutations = await body
Comment on lines 167 to 171

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a new auth mode for mutate (API key without a user), but there are no tests covering the permission behavior and expected status codes for this path. Please add handler tests exercising action=mutate with (1) a verified user (policy enforced) and (2) API-key-only auth, asserting the intended permission model (deny by default vs allow-all vs specific role).

Copilot uses AI. Check for mistakes.
const attempt = async (retry = 0) => {
await local.syncWith(cnx)
Expand Down
Loading