multica/apps/web
LinYushen b5674869ed
fix(auth): enforce auth on daemon API routes (#224)
* fix(auth): enforce auth middleware and workspace membership on daemon API routes

Daemon routes were registered without the Auth middleware, meaning the
server accepted unauthenticated requests to register runtimes, claim
tasks, etc. The daemon client already sends a Bearer token — the server
just wasn't validating it.

- Split /api/daemon routes: pairing-session endpoints stay public (used
  before the daemon has a token), all others now require Auth middleware
- Add workspace membership check in DaemonRegister so only workspace
  members can register runtimes
- Update test to include X-User-ID header matching the new auth requirement

Closes MUL-90

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(daemon): remove dead pairing-session feature

The daemon pairing flow was never completed — the daemon authenticates
via CLI config token, not pairing sessions. Remove all related code:

- Delete daemon_pairing.go handler (4 unused handlers)
- Remove pairing routes from router.go (3 public + 1 protected)
- Delete /pair/local page + test from frontend
- Remove DaemonPairingSession types and API client methods
- Add migration 029 to drop daemon_pairing_session table
- Update LOCAL_DEVELOPMENT.md to reflect actual auth flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:13:58 +08:00
..
app fix(auth): enforce auth on daemon API routes (#224) 2026-03-31 16:13:58 +08:00
components Merge remote-tracking branch 'origin/main' into feature/file-upload-cloudfront 2026-03-31 15:59:46 +08:00
features Merge remote-tracking branch 'origin/main' into feature/file-upload-cloudfront 2026-03-31 15:59:46 +08:00
hooks fix(upload): harden upload flow — sanitize filenames, refresh CF cookies, deduplicate handlers 2026-03-31 15:52:40 +08:00
lib refactor(web): self-contained shadcn UI with base-nova style and design tokens 2026-03-24 18:19:26 +08:00
public Provision default workspaces and harden daemon pairing 2026-03-24 15:19:27 +08:00
shared fix(auth): enforce auth on daemon API routes (#224) 2026-03-31 16:13:58 +08:00
test Merge pull request #168 from multica-ai/forrestchang/agent-arch-review 2026-03-29 17:54:22 +08:00
components.json chore(ui): switch shadcn menuColor from inverted-translucent to default 2026-03-31 11:01:54 +08:00
next-env.d.ts feat: pivot to AI-native task management platform (#232) 2026-03-20 17:55:49 +08:00
next.config.ts feat: resizable sidebar, issue detail rewrite, package consolidation 2026-03-26 16:47:04 +08:00
package.json Merge remote-tracking branch 'origin/main' into feature/file-upload-cloudfront 2026-03-31 15:59:46 +08:00
postcss.config.mjs refactor(web): self-contained shadcn UI with base-nova style and design tokens 2026-03-24 18:19:26 +08:00
tsconfig.json refactor: remove unused monorepo tooling 2026-03-26 17:57:11 +08:00
vitest.config.ts feat: resizable sidebar, issue detail rewrite, package consolidation 2026-03-26 16:47:04 +08:00