feat: Added API and functionality for protocol sidecar processes (support beyond HTTP)#85
Open
jentfoo wants to merge 26 commits into
Open
feat: Added API and functionality for protocol sidecar processes (support beyond HTTP)#85jentfoo wants to merge 26 commits into
jentfoo wants to merge 26 commits into
Conversation
Foundation for the protocol-adapter sidecar contract. The proxy/store capture model moves off the HTTP/HTTP2/WS-unioned HistoryEntry to a single Flow envelope with a common per-side Message type. Handlers keep their wire types on the hot path and convert to Flow/Message only at store time, so parsing/rules/serialization are untouched. WebSocket frames are now stored as child flows (parent_flow_id link, method=FRAME) rather than appended onto the handshake entry; children are retrievable by id but excluded from the default listing.
The change replaces the hardcoded peek-switch in handleConnection with a per-connection adapter claim/dispatch registry (first-claim-wins). Introduces the proxy/protocol package with EarlyAdapter (accept-time) and UpgradeAdapter (post-HTTP-upgrade) seams, plus thin shims wrapping the existing HTTP/1.1, HTTP/2, and WebSocket handlers.
This was not well suited in sidecar since it's not clearly a sidecar owned functionality (just needed by both sectool and sidecar).
This reduces a few features to only what's necessary, as well as cleaning up the verbosity of comments.
CI was updated to fail if `make lint` changes any files (preserving prior validation).
6c11251 to
5e1bb8d
Compare
…tools to be called)
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.
This change expands the use cases which
sectoolcan support outside of just HTTP and websockets to be able to be adapted with a second process for any request / response protocol. Now supported are purely binary protocols, as well as protocols which use an http101protocol switch / upgrade.These sidecar adapters run out-of-process, speaking a JSON-RPC 2.0 contract over a local socket (with a Go SDK provided, or any language via the raw wire protocol). Rather than acting as passive taps, a sidecar's traffic presents into sectool's unified flow timeline, so every existing tools operates on adapter flows with the same agent parity as native HTTP.