Commit b25b97d
authored
fix(webhooks): make health route service-binding-only (#104)
## Summary
Closes the last finding from the public-surface sweep that followed
#103: `webhooks.trycheatcode.com/health` answered publicly (200,
unauthenticated, unrate-limited) with `releaseSha`/`versionId`, while
its only real consumer — the gateway's release aggregation — reaches it
through the WEBHOOKS service binding as
`https://webhooks.internal/health`.
The route now gates on the internal hostname and returns Hono's plain
`notFound()` on any other host, indistinguishable from a route that does
not exist. Same rule as #103: every public route must have a named
external consumer. The four provider webhook POST endpoints
(signature-verified) are untouched.
## Deploy safety
Gateway is unchanged; its binding fetch already carries the
`webhooks.internal` hostname, so the gate passes for old and new gateway
alike — no deploy-order coupling, no skew window. Roll-forward as usual.
## Verification
- Gates: lint, typecheck, full `turbo build --force` (19 packages incl.
web), knip, dependency-cruiser (844 modules, 0 violations), skills
bundle — all green
- Post-deploy: public `GET webhooks.trycheatcode.com/health` → 404;
gateway `/health/release` still 200 with the webhooks leg (proves the
internal path intact)1 parent 39d1a7c commit b25b97d
2 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
174 | | - | |
175 | | - | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
0 commit comments