fix(webhooks): make health route service-binding-only - #104
Merged
Conversation
The public webhook host (webhooks.trycheatcode.com) served /health unauthenticated and unrate-limited, exposing releaseSha and versionId with no public consumer: the only caller is the gateway's release aggregation, which probes https://webhooks.internal/health over the WEBHOOKS service binding. Gate the route on the internal hostname and answer c.notFound() on any other host, indistinguishable from a nonexistent route. Same posture as the preview-proxy public health removal (#103): every public route must have a named external consumer. Gateway is unchanged and its binding fetch already carries the internal hostname, so there is no deploy-order skew.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the last finding from the public-surface sweep that followed #103:
webhooks.trycheatcode.com/healthanswered publicly (200, unauthenticated, unrate-limited) withreleaseSha/versionId, while its only real consumer — the gateway's release aggregation — reaches it through the WEBHOOKS service binding ashttps://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.internalhostname, so the gate passes for old and new gateway alike — no deploy-order coupling, no skew window. Roll-forward as usual.Verification
turbo build --force(19 packages incl. web), knip, dependency-cruiser (844 modules, 0 violations), skills bundle — all greenGET webhooks.trycheatcode.com/health→ 404; gateway/health/releasestill 200 with the webhooks leg (proves the internal path intact)