-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for request item pattern matching in API gateway flow control #842
Conversation
- Update GatewayParamParser to support matching the request item. - Update the internal logic of converting gateway rules to parameter flow rules. - Add a GatewayRegexCache to cache the compiled regex for performance - Update test cases and demo Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #842 +/- ##
============================================
+ Coverage 41.73% 41.95% +0.21%
- Complexity 1383 1400 +17
============================================
Files 305 306 +1
Lines 8807 8843 +36
Branches 1188 1196 +8
============================================
+ Hits 3676 3710 +34
Misses 4677 4677
- Partials 454 456 +2
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #842 +/- ##
============================================
+ Coverage 41.73% 41.95% +0.21%
- Complexity 1383 1400 +17
============================================
Files 305 306 +1
Lines 8807 8843 +36
Branches 1188 1196 +8
============================================
+ Hits 3676 3710 +34
Misses 4677 4677
- Partials 454 456 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Eric Zhao [email protected]
Describe what this PR does / why we need it
Support pattern matching for request items in API gateway flow control.
Does this pull request fix one issue?
Resolves #839
Describe how you did it
GatewayParamParser
to support matching the request item.SentinelGatewayConstants.GATEWAY_NOT_MATCH_PARAM
)SentinelGatewayConstants.GATEWAY_NOT_MATCH_PARAM
) will be configured as an exception item with a large threshold (indicating always pass).GatewayRegexCache
to cache the compiled regex for performance.Describe how to verify it
Run the test cases and demo.
Special notes for reviews
NONE