fix: take the public origin out of the published default host list #5
No reviewers
Labels
No labels
waiting-on-julian
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jlxq0/hevy-mcp!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/allowed-hosts-from-deployment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src/config.rscarriedhevy-mcp.oddie.appas aDEFAULT_ALLOWED_HOSTSentry,asserted it in a config test, and sent it as the
Hostheader in two routertests. This repository is public.
b7167c2scrubbed that name from the README andAGENTS.md; the code still published it, so the scrub achieved nothing.It was also load-bearing rather than decorative, which is why it survived. The
deployment does not set
HEVY_MCP_ALLOWED_HOSTS, so liveHostvalidationpasses today only because the origin is compiled in.
rmcp's check is real, measured before touching it
On the default config, an
initializecarrying a bearer:Hostlocalhost127.0.0.1And the same name returns non-403 once it is in
allowed_hosts. So this is achange to a setting that does something, not a tidy-up of a value nobody reads.
What changed
DEFAULT_ALLOWED_HOSTSis nowlocalhost,127.0.0.1,::1and names no origin.Two tests pin it in both directions —
default_allowed_hosts_are_loopback_onlyand
a_configured_public_host_is_accepted. The remaining tests usehevy-mcp.example, which is reserved by RFC 2606 and resolves nowhere.Verified by removal rather than by passing: putting a public host back into
DEFAULT_ALLOWED_HOSTSturns both new tests red plus the config test.The platform half
clusters/fondue/hevy-mcp/deployment.yaml, in the container'senv:list:One name, no loopback entries needed — the variable replaces the default rather
than extending it, and the probes reach the container on its pod IP, not through
the
Hostcheck.hevy-mcp.oddie.appis thehostnames:entry in the samedirectory's
httproute.yaml, so the two must agree.Setting it is a no-op against the currently deployed image, which carries the
default. It only becomes load-bearing at the first release built from this
commit — which is the ordering: platform first, this second, tag third.
What happens if the order is wrong
The first release built from this commit answers
403to every request arrivingon the public name, while
/healthkeeps returning 200, the readiness andliveness probes keep passing, the pod stays
Readyand ArgoCD readsSyncedandHealthy. A green rollout serving nothing — the same failure shape as thehardcoded initialize bucket that
v0.3.0fixed, where/healthstayed 200 whileevery connector got 429.
Verification
Gates on 1.98.0:
fmtclean,clippyclean, 46 tests pass (44 + the 2 new).5a8dc3aefd81b6d1cbdb4b2b85dd80a1b7347878a1b7347878d163d51d27d163d51d27b80acc12aeUnblocked.
oddie-apps/platformmerged ateddfe3b19d915577460ef39bcc211c1bbff78a5f. Verified against the cluster myself rather than from the report, since a fact heard twice can be one measurement heard twice:Rebased onto
a950280and bumped to 0.4.0, since this release changes behaviour rather than only dependencies and documentation.Gates on 1.98.0, through the build slot:
fmt,clippy,test(46 passed),audit,denyall pass, andcargo +1.93.0 check --all-features --lockedstill passes, so the build floor is unmoved.A probe I can no longer run, recorded because it looks like it should work
The
platformlead retracted one of its own checks and it changes mine. It sent-H "Host: wrong.example"at/mcpexpecting a rejection and got 200. Not the host check being absent: SNI still saidhevy-mcp.oddie.appwhile the HTTPHostmismatched, so the Gateway never matched the HTTPRoute and something else in the ingress path answered.A negative probe that never reaches the thing under test looks exactly like the thing under test behaving. So the allow-list cannot be verified from outside by sending a wrong
Host, because the edge will not route it. A negative control would have to run inside the cluster against the pod, where SNI does not exist. The check that works from outside sends the rightHostwith a bearer and reads 200 against 403, which is the one already inAGENTS.md.What the post-release check will be
Not "ArgoCD is Synced" and not
/health. In order:dockertask exists on the tag ref inGET actions/tasks, then that it succeeded. Absent is a third state below skipped:ksc_web'sv1.7.0had a greentestand no docker task at all, and two earlier releases were forfeited that way.app, per pod, against what the tag build pushed. A pod name followed by a tab and nothing is a container name that matched nothing, not a pod without the image.DEFAULT_ALLOWED_HOSTS. Against the deployment built from this commit, 200 means the variable landed and 403 means it did not.Rolled out and verified. Not from the ArgoCD tile and not from
/health.The digest came from the registry by
Docker-Content-Digeston the manifest, and the manifest pin Renovate wrote is the same value, so three independent sources agree onv0.4.0.The probe, and its negative control
From outside, with a bearer:
That 200 is the first one in this repository that carries information: the image no longer has any origin in
DEFAULT_ALLOWED_HOSTS, so it can only be answering from the environment variable.It still had no negative control, and the obvious one is a trap. Sending
Host: wrong.exampleto the public name returns 200, because SNI still sayshevy-mcp.oddie.appwhile the HTTPHostdiffers, so the Gateway never matches the HTTPRoute and something else in the ingress path answers. Theplatformlead found that and retracted its own probe; a negative probe that never reaches the process looks exactly like the process behaving.Run inside the cluster, port-forwarded to the pod where there is no SNI:
Hosthevy-mcp.oddie.applocalhostwrong.examplehevy-mcp.kampong.socialThe
localhostrow is the one that settles it.localhostis inDEFAULT_ALLOWED_HOSTSand it is being rejected, which is only possible if the environment variable replaced the compiled default rather than extending it. Underv0.3.0bothlocalhostandhevy-mcp.oddie.appwould have returned 200 from the compiled list. That pair is what separates "the variable is doing the work" from "the old default still is", and neither the 200 alone nor a green rollout can tell them apart.The method is going into
AGENTS.mdon #9.