Back to blog

Review Hono route changes before release with Noir

Use a small synthetic Hono fixture to turn an endpoint diff into a focused release review.

A new endpoint can be intentional and still deserve a second look. For example, adding search to a resource catalog changes the set of routes that users can reach. A route inventory makes that change visible before a release, even when the application cannot be run in the review environment.

This example is synthetic: it is not production source and does not make a claim about a deployed application's security. I ran the commands below with Noir 1.5.0. The draft was prepared with AI assistance, and the results were reproduced locally.

Create a small before-and-after fixture

Make two directories, before and after. Put this in before/app.ts:

import { Hono } from 'hono'

const app = new Hono()
app.get('/resources', (c) => c.json({ items: [] }))
app.get('/resources/:slug', (c) => c.json({ slug: c.req.param('slug') }))
export default app

Copy that file to after/app.ts, then add this route before export default app:

app.post('/api/search', async (c) => c.json({ query: (await c.req.json()).query }))

These handlers are intentionally minimal examples, not a production-ready API. Noir analyzes the source; the demo does not need a running Hono server or installed Hono package.

Compare the inventories

From the parent of before and after, run:

noir scan after --only-techs js_hono --diff-path before --format json --no-color

With the fixture above, Noir reported one added route and no removed or changed routes:

{
  "added": [{ "method": "POST", "url": "/api/search" }],
  "removed": [],
  "changed": []
}

The output above is an excerpt: the actual report includes additional endpoint details. The separate baseline and updated scans found two and three routes respectively. The path parameter slug was present in the endpoint details for the detail route.

To make an unexpected addition visible to a CI job, add --fail-on added:

noir scan after --only-techs js_hono --diff-path before \
  --format json --no-color --fail-on added > route-diff.json

In this fixture the command returned exit code 3, with POST /api/search in added. That is a review signal, not a verdict that the route is dangerous. A team can choose a different policy for intentional additions; make sure the CI job also treats tool errors separately from an expected diff.

What to review after the diff

For each added route, confirm the expected HTTP method and public path, then inspect the handler and its surrounding middleware. For the sample search route, a reviewer would check the accepted request shape, input limits, error handling and whether the route is meant to be public. The sample has no authentication or limits; it is there to demonstrate an inventory change, not to recommend that implementation.

There is a useful limit in this example. Noir extracted the slug path parameter, but the generated report did not identify query as a body parameter for the c.req.json() expression shown above. A missing parameter in the static report is not proof that the handler reads no input. Read the handler and test the running application separately where appropriate.

Likewise, a source-based list cannot prove that an endpoint is deployed, externally reachable, correctly authorized, or free of vulnerabilities. Dynamic routing, framework conventions and analyzer coverage can affect what appears. Keep the report as a way to focus human review, and compare it with runtime and deployment evidence rather than treating it as a complete security assessment.

Reports may include source paths and endpoint details. Before uploading them as CI artifacts or sharing them outside the team, decide who can access them and whether those details should be redacted.