Commit graph

3 commits

Author SHA1 Message Date
Brad Groux
3f5c9a03af
feat: enforce CLI and MCP token permissions
## Summary

- adds a shared client-side API permission mapper and guarded API client for CLI and MCP calls
- exposes a non-secret /api/auth/context endpoint for scoped token preflight
- routes CLI and MCP task lookup helpers through the guarded client
- preflights direct summary text fetches that bypass the JSON API helper
- adds focused CLI and MCP token authorization coverage and documents the behavior

Refs #336.

## Verification

- pnpm --filter @veritas-kanban/shared build
- pnpm --filter @veritas-kanban/cli typecheck
- pnpm --filter @veritas-kanban/mcp build
- pnpm --filter @veritas-kanban/server typecheck
- focused CLI and MCP api-permissions tests
- pnpm lint:budget
- pnpm audit --prod --audit-level=high
- pnpm build
- GitHub Actions: Build, Lint & Type Check, Security Audit, Workspace Unit Tests
2026-05-31 04:35:10 -05:00
Brad Groux
dff58fac83 test: add MCP sprint and task tool integration tests (34 tests) 2026-03-08 03:04:41 -05:00
Brad Groux
e59c5072cf fix: resolve infinite render loop in useKeyboard test + memoize context value
Two bugs fixed:
1. TestConsumer's default param (tasks=[]) created a new array ref every render,
   causing an infinite useEffect loop with setTasks. Fixed with stable EMPTY_TASKS constant.
2. KeyboardProvider's context value was a new object literal every render.
   Wrapped in useMemo to prevent unnecessary consumer re-renders.
3. Destructured useKeyboard() return in test to use stable callback refs
   instead of the whole context object as useEffect deps.

Also: added root vitest.config.ts with workspace projects for mono-repo test runs.
2026-01-29 05:54:22 -06:00