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

Fix APIAP routing policy rule #1777

Merged
merged 1 commit into from
Mar 27, 2020

Conversation

guicassolato
Copy link
Contributor

The regex used to match the path of the backend in the APIAP routing policy configuration should only allow paths that start with the chosen value for the path. Currently it matches all paths that contains the value.

This PR fixes it by wrapping the current regex pattern within a ^() group.

Closes THREESCALE-4736

@guicassolato guicassolato self-assigned this Mar 13, 2020
@eloycoto
Copy link

@jsmadis will be good to add this case to the framework ;-)

@guicassolato guicassolato requested a review from a team March 13, 2020 14:04
The regex used to match the path of the backend in the APIAP routing policy configuration should only allow paths that _start with_ the chosen value for the path. Currently it matches all paths that _contains_ the value. This fixes it by adding a `^` to the beginning of the pattern.
@guicassolato guicassolato force-pushed the fix/apiap/routing-rule-starts-with branch from f21917f to b9d6e10 Compare March 27, 2020 11:10
@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@4eec589). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1777   +/-   ##
=========================================
  Coverage          ?   93.06%           
=========================================
  Files             ?     2511           
  Lines             ?    83390           
  Branches          ?        0           
=========================================
  Hits              ?    77611           
  Misses            ?     5779           
  Partials          ?        0
Impacted Files Coverage Δ
test/unit/proxy_test.rb 100% <ø> (ø)
test/unit/backend_api_logic/routing_policy_test.rb 100% <ø> (ø)
app/models/config_path.rb 100% <100%> (ø)

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 4eec589...b9d6e10. Read the comment docs.

Copy link
Member

@thomasmaas thomasmaas left a comment

Choose a reason for hiding this comment

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

Probably good candidate for 2.8.1 @guicassolato? If so, change target release.

@guicassolato guicassolato merged commit f5ddca6 into master Mar 27, 2020
@guicassolato guicassolato deleted the fix/apiap/routing-rule-starts-with branch March 27, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants