feat(tui): integrate body decoder registry for protobuf/gRPC display#26
Merged
Conversation
Introduces the pluggable body decoder architecture. Registry routes by content type to the first matching decoder; returns ErrNoDecoder on miss so callers can fall through to existing highlight behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Config persists proto_paths in ~/.httpmon/config.json (omitempty). Repeatable --proto-path flag merges after config paths. Enables proto file discovery for upcoming protobuf body decoder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Decodes protobuf wire format into JSON with field numbers as keys. Handles varints, fixed32/64, length-delimited (nested messages, strings, base64 binary), repeated fields, and groups. Returns application/json for downstream syntax highlighting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parses gRPC-Web framing (1-byte flags + 4-byte BE length), extracts data frames, skips trailers, notes compressed frames. Truncated frames decoded partially with annotation. Delegates payload to RawProtobufDecoder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Compiles .proto files via bufbuild/protocompile into a ProtoRegistry. Resolves gRPC service/method from request path (supports arbitrary prefix). Named decode uses dynamicpb + protojson for field names; falls back to raw wire decode on unknown service or unmarshal failure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire BodyDecoderRegistry through TUI ports so detail view can decode protobuf and gRPC-Web bodies into human-readable text. Includes: - Registry wiring in main.go with proto file loading - renderOpts refactor to thread decoder through detail pipeline - Remove protobuf MIME types from binary blocklist (now decoded) - E2E harness support for body decoder + gRPC Connect test - Fix gosec G115: safe uint64 cast in gRPC-Web frame parser - Makefile generate-proto target for buf codegen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lint/test/security run locally; CI was redundant. Release now triggers on v* tag push directly instead of chaining off CI workflow_run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
BodyDecoderRegistryinterface through TUI ports so the detail view decodes protobuf and gRPC-Web bodies into human-readable textmain.gowith optional.protofile loading via--proto-pathflag; raw wire-format decoding always availablerenderDetailBodypipeline to threadrenderOpts(decoder, dark-bg, pretty-print, collapsed state) instead of positional argshighlightbinary blocklist since they're now decodeduint64comparisongenerate-protoMakefile target for buf codegenwithBodyDecoderoption + new gRPC Connect round-trip testTest plan
make lint— 0 issuesmake test— all pass with race detectionmake security— G115 resolved; only generated-code G103 remainshttpmon --proto-path=<dir>and verify protobuf bodies render as decoded text in detail view🤖 Generated with Claude Code