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

Merging to release-5.5.1: [TT-13087] Adjust example gateway config, to have match preficing explicit by default (#6564) #6570

Conversation

buger
Copy link
Member

@buger buger commented Sep 23, 2024

User description

TT-13087 Adjust example gateway config, to have match preficing explicit by default (#6564)

User description

Description

TT-13087 Adjust example gateway config, to have match preficing explicit
by default

Motivation and Context

Would be advised that Gateway users, would have by default explicit path
matching settings enabled by default, as the wildcard behaviour of the
path matching, can be challenging at times to configure properly.

How This Has Been Tested

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to change)
  • Refactoring or add test (improvements in base code or adds test
    coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning
    why it's required
  • I would like a code coverage CI quality gate exception and have
    explained why

PR Type

enhancement, configuration changes


Description

  • Added new configuration options in tyk.conf.example to enable strict
    routing and explicit path matching by default.
  • The changes aim to improve the default behavior for gateway users by
    making path matching settings explicit.

Changes walkthrough 📝

Relevant files
Configuration changes
tyk.conf.example
Add explicit path matching options to example gateway config

tyk.conf.example

  • Added http_server_options section.
  • Enabled enable_strict_routes.
  • Enabled enable_path_prefix_matching.
  • Enabled enable_path_suffix_matching.
  • +5/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull
    request to receive relevant information


    PR Type

    enhancement, configuration changes


    Description

    • Added new configuration options in the example gateway config to enable explicit path matching by default.
    • Introduced http_server_options with enable_strict_routes, enable_path_prefix_matching, and enable_path_suffix_matching set to true.
    • These changes aim to make path matching behavior more predictable and easier to configure for users.

    Changes walkthrough 📝

    Relevant files
    Configuration changes
    tyk.conf.example
    Add explicit path matching options to example gateway config

    tyk.conf.example

  • Added http_server_options section.
  • Enabled enable_strict_routes, enable_path_prefix_matching, and
    enable_path_suffix_matching.
  • +5/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    …licit by default (#6564)
    
    ### **User description**
    ## Description
    TT-13087 Adjust example gateway config, to have match preficing explicit
    by default
    
    ## Motivation and Context
    Would be advised that Gateway users, would have by default explicit path
    matching settings enabled by default, as the wildcard behaviour of the
    path matching, can be challenging at times to configure properly.
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    - [x] New feature (non-breaking change which adds functionality)
    - [x] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [x] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [x] I ensured that the documentation is up to date
    - [x] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [x] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    enhancement, configuration changes
    
    
    ___
    
    ### **Description**
    - Added new configuration options in `tyk.conf.example` to enable strict
    routing and explicit path matching by default.
    - The changes aim to improve the default behavior for gateway users by
    making path matching settings explicit.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Configuration
    changes</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>tyk.conf.example</strong><dd><code>Add explicit path
    matching options to example gateway config</code></dd></summary>
    <hr>
    
    tyk.conf.example
    
    <li>Added <code>http_server_options</code> section.<br> <li> Enabled
    <code>enable_strict_routes</code>.<br> <li> Enabled
    <code>enable_path_prefix_matching</code>.<br> <li> Enabled
    <code>enable_path_suffix_matching</code>.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6564/files#diff-a6736b4b3cda1ee503675d7b725f6138f4eb83d7145f3afecf6087d219f2b23a">+5/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>                    
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    (cherry picked from commit d98cc03)
    Copy link
    Contributor

    API Changes

    no api changes detected

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Configuration Change
    The new configuration options enable_strict_routes, enable_path_prefix_matching, and enable_path_suffix_matching have been added to improve explicit path matching. Ensure that these settings do not conflict with existing configurations and are well-documented to avoid confusion among users.

    Copy link
    Contributor

    github-actions bot commented Sep 23, 2024

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Adjust the default setting of enable_path_suffix_matching to false to prevent potential routing issues

    Consider setting "enable_path_suffix_matching" to false by default to avoid
    unexpected behavior where routes might match suffixes unintentionally, which can
    lead to security concerns or routing errors.

    tyk.conf.example [36]

     "http_server_options": {
       "enable_strict_routes": true,
       "enable_path_prefix_matching": true,
    -  "enable_path_suffix_matching": true
    +  "enable_path_suffix_matching": false
     }
     
    Suggestion importance[1-10]: 8

    Why: The suggestion addresses a potential security concern by preventing unintended route matching, which could lead to routing errors or vulnerabilities. Setting enable_path_suffix_matching to false by default is a prudent measure to avoid these issues. The suggestion is relevant and improves the safety of the configuration.

    8

    Copy link

    sonarcloud bot commented Sep 23, 2024

    @buger buger merged commit c943a9c into release-5.5.1 Sep 23, 2024
    25 checks passed
    @buger buger deleted the merge/release-5.5.1/d98cc036e3d7afde6d9292d42520b301481dc5f3 branch September 23, 2024 08:58
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants