refactor(chapter-10): split routes into modules with validation and access guards

↗ view on GitHub · Amal · 2026-05-24 · bfb2466e

Chapter: 10 - API boundaries.

Plain-English map:
Introduce a module layer for API routes, validate incoming request shapes with
Zod, and add authorization checks around tabular document access.

Why it matters:
Large route files make it hard to see where trust boundaries are. Validation
and access checks need to sit at the boundary before data reaches deeper code.

Principle:
Validate inputs and authorize data access close to the edge of the system.

Precedent borrowed:
Upstream PR #155 and the fork report's strongest security signal: multiple
forks independently patched CWE-639 style tabular-document access bugs.

Upstream base: willchen96/mike@d39f580.
Original local commit: f913869.
Repository amal66/mike
Author Amal <mamalanand3@gmail.com>
Authored
Parents eea82f6a
Stats 26 files changed , +5283
Part of API route modularization with validation and access guards

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-bfb2466e.md from inside the repo you want the change in.

⬇ Download capture-commit-bfb2466e.md