Skip to content
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 parsing cookie as request items in gateway flow control #814

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Jun 5, 2019

Signed-off-by: Eric Zhao [email protected]

Describe what this PR does / why we need it

Support parsing cookie as request items in gateway flow control.

Does this pull request fix one issue?

Resolves #813

Describe how you did it

  • Add getCookieValue method in RequestItemParser interface and update GatewayParamParser with the logic
  • Add cookie parsing logic for Spring Cloud Gateway and Zuul 1.x in respective adapters

Describe how to verify it

Run the test cases.

Special notes for reviews

NONE

- Add `getCookieValue` method in RequestItemParser interface and update GatewayParamParser
- Add cookie parsing logic for Spring Cloud Gateway and Zuul

Signed-off-by: Eric Zhao <[email protected]>
@sczyh30 sczyh30 added kind/enhancement Category issues or prs related to enhancement. to-review To review labels Jun 5, 2019
@codecov-io
Copy link

codecov-io commented Jun 5, 2019

Codecov Report

Merging #814 into master will increase coverage by 0.04%.
The diff coverage is 47.82%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #814      +/-   ##
============================================
+ Coverage     41.71%   41.75%   +0.04%     
- Complexity     1376     1379       +3     
============================================
  Files           304      304              
  Lines          8764     8784      +20     
  Branches       1182     1184       +2     
============================================
+ Hits           3656     3668      +12     
- Misses         4662     4669       +7     
- Partials        446      447       +1
Impacted Files Coverage Δ Complexity Δ
...dapter/gateway/sc/ServerWebExchangeItemParser.java 45.45% <0%> (-17.05%) 4 <0> (ø)
...adapter/gateway/zuul/RequestContextItemParser.java 8.33% <0%> (-11.67%) 1 <0> (ø)
...dapter/gateway/common/rule/GatewayRuleManager.java 68.37% <100%> (+0.27%) 13 <0> (-1) ⬇️
...apter/gateway/common/param/GatewayParamParser.java 68.57% <71.42%> (+0.31%) 19 <1> (+2) ⬆️
...ava/com/alibaba/csp/sentinel/node/ClusterNode.java 95.23% <0%> (-4.77%) 7% <0%> (-1%)
...a/com/alibaba/csp/sentinel/node/StatisticNode.java 56.17% <0%> (+0.49%) 28% <0%> (+1%) ⬆️
...m/alibaba/csp/sentinel/log/DateFileLogHandler.java 57.57% <0%> (+3.03%) 7% <0%> (+1%) ⬆️
...a/csp/sentinel/slots/statistic/base/LeapArray.java 70.58% <0%> (+3.26%) 34% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 062385f...2017dbd. Read the comment docs.

@sczyh30 sczyh30 requested a review from CarpenterLee June 5, 2019 21:36
Copy link
Contributor

@CarpenterLee CarpenterLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sczyh30 sczyh30 merged commit 08676c4 into master Jun 14, 2019
@sczyh30 sczyh30 deleted the gateway/cookie-support branch June 14, 2019 09:48
@sczyh30 sczyh30 removed the to-review To review label Jun 19, 2019
CST11021 pushed a commit to CST11021/Sentinel that referenced this pull request Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support parsing cookie as request item in gateway flow control
3 participants