feat(grpc): Add server-side stream validators#2595
Closed
sauravzg wants to merge 2 commits intohyperium:masterfrom
Closed
feat(grpc): Add server-side stream validators#2595sauravzg wants to merge 2 commits intohyperium:masterfrom
sauravzg wants to merge 2 commits intohyperium:masterfrom
Conversation
cc729c2 to
c6e486a
Compare
Collaborator
|
As discussed offline, we likely should move |
Collaborator
Author
|
Back from OOO. ETA for addressing comment: 1d , since I need to catch up to a few things first. |
Introduces `ServerSendStreamValidator` and `ServerRecvStreamValidator` to enforce strict gRPC semantics on server streams. These are intended to wrap raw transport streams before passing them to application-level handlers, ensuring that user-provided service logic cannot violate protocol rules. - `ServerSendStreamValidator` ensures proper response sequencing (Headers -> Messages -> Trailers) and prevents invalid state transitions, while fully supporting trailers-only responses. - `ServerRecvStreamValidator` safely manages terminal states, ensuring that any subsequent polls after stream completion consistently return an error to prevent undefined behavior. - Adds comprehensive unit tests to verify state machine correctness and protocol compliance.
c6e486a to
c5d8980
Compare
Collaborator
Author
|
I'll close this PR and create a new one, since it's painful to do stacked PR workflow from fork. |
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.
Introduces
ServerSendStreamValidatorandServerRecvStreamValidatorto enforce strict gRPC semantics on server streams. These are intended to wrap raw transport streams before passing them to application-level handlers, ensuring that user-provided service logic cannot violate protocol rules.ServerSendStreamValidatorensures proper response sequencing (Headers -> Messages -> Trailers) and prevents invalid state transitions, while fully supporting trailers-only responses.ServerRecvStreamValidatorsafely manages terminal states, ensuring that any subsequent polls after stream completion consistently return an error to prevent undefined behavior.