client: validate streaming gRPC response content types - #6
EffortlessSteven wants to merge 1 commit into
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe client now validates successful gRPC and gRPC-Web streaming response content types before exposing streams. The shared validator uses explicit protocol and codec values. Tests cover compatibility, rejection, error classification, status precedence, headers, and trailers-only responses. ChangesgRPC content-type validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GrpcClient
participant make_server_stream
participant validate_grpc_response_content_type
GrpcClient->>make_server_stream: construct successful streaming response
make_server_stream->>validate_grpc_response_content_type: validate protocol and codec content type
validate_grpc_response_content_type-->>make_server_stream: accept response or return validation error
make_server_stream-->>GrpcClient: expose stream or return error
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
e78dafd to
316b0c4
Compare
|
Mutation receipts retained for upstream review:
All mutations were restored before the final test runs. The custom missing-terminal-status runner also completed with gRPC 1,462 passed and gRPC-Web 2,854 passed, zero failures. |
316b0c4 to
ec693c3
Compare
Signed-off-by: EffortlessSteven <git@effortlesssteven.com>
ec693c3 to
c8aec5c
Compare
What this does
Server-streaming and bidi receive initialization did not validate that a successful response's
content-typematched the configured gRPC family or codec. In the trailers-only regression, a gRPC client acceptedapplication/grpc-web+proto:call_server_streamreturnedOk(ServerStream), thenmessage()returnedOk(None).make_server_streamnow reuses the unary validator after response-status classification and before encoding or stream construction. Missing and bare-family content types remain accepted; Connect and non-200 HTTP precedence are unchanged.Verification
Ok(ServerStream)thenOk(None); patchedUnknownbefore stream exposuregrpc-status; headers and compatibility cases preservedReview map
validate_grpc_response_content_type: takes protocol and codec directly.make_server_stream: shared server-streaming and bidi validation seam.