feat(parser_http_server): HTTP+JSON pivot for TVC public ingress - #450
Draft
pepe-anchor wants to merge 1 commit into
Draft
feat(parser_http_server): HTTP+JSON pivot for TVC public ingress#450pepe-anchor wants to merge 1 commit into
pepe-anchor wants to merge 1 commit into
Conversation
Turnkey's TVC ingress is HTTP only (Cloudflare in front of app-<uuid>.turnkey.cloud rejects gRPC with 403), so switching the parse path onto the pivot needs a binary that speaks HTTP+JSON natively and calls parser_app::routes::parse in-process. Open v1 and v2 routes only. No payment enforcement, no auth, no proto change: those are separate PRs on top. What this PR does own is the three seams they plug into, so they can be written in parallel without colliding: handlers take raw Bytes (an X-Stamp signature covers the exact request bytes, and a Json<T> round-trip would invalidate it), bootProof comes from a BootProofSource trait, and the manifest fields are already borsh-encoded the way the Go verifier reads them. The integration test fails fast if the server dies before binding. It polls try_wait alongside the port, because wait_until_port_is_bound loops forever: a pivot built with --features vsock looks for the absolute in-enclave key path, exits at startup, and would otherwise hang CI instead of failing it. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Aug 6, 2026
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.
Why
Turnkey's TVC public ingress is HTTP only: Cloudflare in front of
app-<uuid>.turnkey.cloudrejects gRPC with 403 (verified 2026-05-16). So switching the parse path onto the pivot needs a binary that speaks HTTP and JSON natively and callsparser_app::routes::parsein process, instead of gRPC over vsock.This is the keystone of the PRS-581 stack. Two PRs are built directly on it in parallel (in-enclave X-Stamp auth, real NSM boot proof), so as much as it is a feature, it is the set of extension points those need.
What
Open v1 and v2 routes only, plus
/health. No payment enforcement, no auth, no proto change in this PR.The three seams it owns, and why each is shaped that way:
Bytes, neverJson<T>. An X-Stamp signature covers the exact request bytes; letting serde deserialize and re-serialize changes them (key order, whitespace) and invalidates every signature.parse_envelope(&[u8])deserializes while the caller keeps the untouched slice. A test pins this so a future refactor cannot quietly undo it.BootProofSourcetrait with aStaticBootProofimplementation, so the NSM-backed one is a new file rather than a rewrite.awsAttestationDocB64is an empty string here: empty, never faked, because a strict verifier must reject an unattested response outright./qos.manifestholds JSON at qos rev365ba7ed, butqosManifestB64andqosManifestEnvelopeB64are borsh bytes: the Go verifier borsh-deserializes both, and the attestation doc'suser_dataissha256(borsh(manifest)). Base64-ing the file bytes would produce fields nothing can verify. Verified againstvisualsign-turnkeyclientmanifest/parser.go.Also threads
include_intermediate_outputthrough for parity with the gateway's REST shape (#414). Every response, success and error, carriesbootProof.Test evidence
The integration test fails fast if the server dies before binding, polling
try_waitalongside the port.wait_until_port_is_boundloops forever, so without that check a pivot built with--features vsock(which looks for the absolute in-enclave key path, panics at startup) would hang CI instead of failing it. Confirmed with a negative control: it now fails in 0.05s with a diagnostic naming the cause.Rollback
Revert the commit. It adds a new binary that nothing calls yet and changes no existing behavior, so a revert is inert. Nothing is deployed by merging it.
Linear
PRS-581
Stacked on #446. Supersedes the pivot portion of #304.
🤖 Generated with Claude Code