feat(server): integrate Better Auth, access control, and deployment mode startup
Wire up Better Auth for session-based authentication. Add actor middleware that resolves local_trusted mode to an implicit board actor and authenticated mode to Better Auth sessions. Add access service with membership, permission, invite, and join-request management. Register access routes for member/invite/ join-request CRUD. Update health endpoint to report deployment mode and bootstrap status. Enforce tasks:assign and agents:create permissions in issue and agent routes. Add deployment mode validation at startup with guardrails (loopback-only for local_trusted, auth config required for authenticated). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,14 @@ export function boardMutationGuard(): RequestHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Local-trusted mode uses an implicit board actor for localhost-only development.
|
||||
// In this mode, origin/referer headers can be omitted by some clients for multipart
|
||||
// uploads; do not block those mutations.
|
||||
if (req.actor.source === "local_implicit") {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isTrustedBoardMutationRequest(req)) {
|
||||
res.status(403).json({ error: "Board mutation requires trusted browser origin" });
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user