Merged
Conversation
tock-ibm
reviewed
Aug 12, 2025
node/router/router.go
Outdated
Comment on lines
+350
to
+353
| // func (r *Router) updateVerifier(config *nodeconfig.RouterNodeConfig) error { | ||
| // return nil | ||
| // } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
removed the function since it is not used for now
| NumOfgRPCStreamsPerConnection int | ||
| UseTLS bool | ||
| ClientAuthRequired bool | ||
| RequestMaxBytes uint64 |
Contributor
There was a problem hiding this comment.
Add a getter to implement the FilterConfig interface
| close(start) | ||
| wg.Wait() | ||
| fmt.Println("max counter : ", maxVerifiers) | ||
| // require.True(t, maxVerifiers > 1) |
Contributor
There was a problem hiding this comment.
test this, and print with t.Logf()
node/router/router.go
Outdated
Comment on lines
+334
to
+340
| type RouterFilterConfig struct { | ||
| RequestMaxBytes uint64 | ||
| } | ||
|
|
||
| func (r RouterFilterConfig) GetMaxSizeBytes() (uint64, error) { | ||
| return r.RequestMaxBytes, nil | ||
| } | ||
|
|
||
| func createVerifier(config *nodeconfig.RouterNodeConfig) *requestfilter.RulesVerifier { | ||
| rv := requestfilter.NewRulesVerifier(nil) | ||
| rfc := RouterFilterConfig{RequestMaxBytes: config.RequestMaxBytes} | ||
| rv.AddRule(requestfilter.PayloadNotEmptyRule{}) | ||
| rv.AddRule(requestfilter.NewMaxSizeFilter(rfc)) | ||
| return rv | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Just add a getter on the RouterNodeConfig
node/router/stream.go
Outdated
| if err := s.verifier.Verify(msg); err != nil { | ||
| s.logger.Debugf("request is invalid: %s", err) | ||
| // send a response to the client | ||
| resp := protos.SubmitResponse{Error: fmt.Sprintf("request verifying error: %s", err), TraceId: msg.TraceId} |
Contributor
There was a problem hiding this comment.
request verification error
4676bb8 to
0b61ac3
Compare
Signed-off-by: Dor.Katzelnick <Dor.Katzelnick@ibm.com>
tock-ibm
approved these changes
Aug 13, 2025
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.
integrating request verifier in router