Handler and Route Inventory
Enumerate every route and its handler, including internal and versioned ones, because an unlisted handler is where a check you assumed exists turns out not to
Use when: a backend is in scope and no maintained list of routes with their handlers exists
Avoid when: framework-generated documentation lists every route with handler and middleware already confirmed current
Procedure
- Extract routes from the framework registry or router table rather than from prose documentation that may be stale.
- Record for each route its method, handler function, middleware chain and the roles permitted to reach it.
- Flag routes that exist but are undocumented, since these are usually the ones with the oldest checks.
- Note versioned duplicates where one version kept a check the newer one dropped.
- Separate public, authenticated and internal-only routes into three lists so coverage is visible per class.
- Carry undocumented and internal routes into the map phase as explicit questions rather than dropping them.
Signals
- The router table contains paths absent from the published documentation
- Two API versions expose the same operation with different middleware
- An internal-only route shares a prefix with public routes
- A handler is registered dynamically, so a static route list misses it
Patterns
1. Inventory row
path | method | handler | middleware | roles | documented
/api/v1/orders | GET | list_orders | auth, rate | member | yes
/internal/reindex | POST | reindex | none | internal | no
2. Class split
public | authenticated | internal; each list is reviewed separately so an internal route with no middleware is visible rather than averaged away
3. Dynamic-route note
when a route is registered at runtime, record where registration happens so the inventory can be regenerated from that source
Pitfalls
- Building the inventory from documentation, which is exactly what has drifted
- Skipping versioned duplicates, where a dropped check is most likely to be found
- Assuming internal routes are unreachable because a gateway usually fronts them
Done when
- Every route has a row with method, handler, middleware, permitted roles and documentation status
- Undocumented and internal routes are listed as explicit questions for the map phase