TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.76k stars 1.09k forks source link

Merging to release-5.6.0: [TT-13128] Updated description for prefix and suffix matching config options (#6555) #6559

Closed buger closed 2 months ago

buger commented 2 months ago

User description

TT-13128 Updated description for prefix and suffix matching config options (#6555)

PR Type

documentation


Description


Changes walkthrough ๐Ÿ“

Relevant files
Documentation
config.go
Clarify and enhance documentation for path matching options

config/config.go
  • Updated descriptions for EnablePathPrefixMatching and
    EnablePathSuffixMatching.
  • Clarified the behavior of prefix and suffix matching.
  • Provided examples for both matching options.
  • Explained the impact on existing route definitions.
  • +35/-39 

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions


    PR Type

    Documentation


    Description


    Changes walkthrough ๐Ÿ“

    Relevant files
    Documentation
    config.go
    Clarify and enhance documentation for path matching options

    config/config.go
  • Updated the description for EnablePathPrefixMatching to clarify its
    behavior and provide examples.
  • Enhanced the description for EnablePathSuffixMatching, explaining its
    switch from wildcard to suffix mode.
  • Added examples to illustrate the differences between wildcard, prefix,
    and suffix matching.
  • Noted the potential need for adjustments in existing route definitions
    when enabling these options.
  • +35/-39 

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    github-actions[bot] commented 2 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก No key issues to review
    github-actions[bot] commented 2 months ago

    API Changes

    --- prev.txt    2024-09-20 11:15:39.566837650 +0000
    +++ current.txt 2024-09-20 11:15:36.651847128 +0000
    @@ -5905,47 +5905,10 @@
        // Regular expressions and parameterized routes will be left alone regardless of this setting.
        EnableStrictRoutes bool `json:"enable_strict_routes"`
    
    -   // EnablePathPrefixMatching changes the URL matching from wildcard mode to prefix mode.
    -   // For example, `/json` matches `*/json*` by current default behaviour.
    -   // If prefix matching is enabled, the match will be performed as a prefix match (`/json*`).
    -   //
    -   // The `/json` url would be matched as `^/json` against the following paths:
    -   //
    -   // - Full listen path and versioning URL (`/listen-path/v4/json`)
    -   // - Stripped listen path URL (`/v4/json`)
    -   // - Stripped version information (`/json`) - match.
    -   //
    -   // If versioning is disabled then the following URLs are considered:
    -   //
    -   // - Full listen path and endpoint (`/listen-path/json`)
    -   // - Stripped listen path (`/json`) - match.
    -   //
    -   // For inputs that start with `/`, a prefix match is ensured by
    -   // prepending the start of string `^` caret.
    -   //
    -   // For all other cases, the pattern remains unmodified.
    -   //
    -   // Combine this option with `enable_path_suffix_matching` to achieve
    -   // exact url matching with `/json` being evaluated as `^/json$`.
    +   // Combining EnablePathPrefixMatching with EnablePathSuffixMatching will result in exact URL matching, with `/json` being evaluated as `^/json$`.
        EnablePathPrefixMatching bool `json:"enable_path_prefix_matching"`
    
    -   // EnablePathSuffixMatching changes the URL matching to match as a suffix.
    -   // For example: `/json` is matched as `/json$` against the following paths:
    -   //
    -   // - Full listen path and versioning URL (`/listen-path/v4/json`)
    -   // - Stripped listen path URL (`/v4/json`)
    -   // - Stripped version information (`/json`) - match.
    -   //
    -   // If versioning is disabled then the following URLs are considered:
    -   //
    -   // - Full listen path and endpoint (`/listen-path/json`)
    -   // - Stripped listen path (`/json`) - match.
    -   //
    -   // If the input pattern already ends with a `$` (`/json$`)
    -   // then the pattern remains unmodified.
    -   //
    -   // Combine this option with `enable_path_prefix_matching` to achieve
    -   // exact url matching with `/json` being evaluated as `^/json$`.
    +   // Combining EnablePathSuffixMatching with EnablePathPrefixMatching will result in exact URL matching, with `/json` being evaluated as `^/json$`.
        EnablePathSuffixMatching bool `json:"enable_path_suffix_matching"`
    
        // Disable TLS verification. Required if you are using self-signed certificates.
    github-actions[bot] commented 2 months ago

    PR Code Suggestions โœจ

    No code suggestions found for the PR.

    sonarcloud[bot] commented 2 months ago

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    0.0% Coverage on New Code
    0.0% Duplication on New Code

    See analysis details on SonarCloud