-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[TT-15507] Reverting /hello endpoint to always return 200 status code #7278
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
Conversation
…OAS API Definition (#6914) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-7306" title="TT-7306" target="_blank">TT-7306</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS:migration] Migrate Mock Response from Classic API Definition to OAS API Definition</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description This PR ensures OAS operations migrated from mock responses include only necessary properties. Response body and headers are not required for custom mock responses. <!-- Describe your changes in detail --> ## Related Issue https://tyktech.atlassian.net/browse/TT-7306 <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 ___ ### **Description** - Simplify OAS migration for mock responses. - Remove redundant content and header assignments. - Update tests to verify only description presence. - Adjust test fixtures for expected response schema. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>operation.go</strong><dd><code>Refactor mock response creation logic.</code> </dd></summary> <hr> apidef/oas/operation.go <li>Removed dummy response description and content assignment.<br> <li> Eliminated header and media type definitions.<br> <li> Introduced an uninitialized <code>oasDesc</code> variable for response <br>descriptions. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6914/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+2/-34</a> </td> </tr> <tr> <td> <details> <summary><strong>mock_response.yml</strong><dd><code>Update mock response fixtures.</code> </dd></summary> <hr> apidef/oas/testdata/fixtures/mock_response.yml <li>Replaced content and headers in responses with a description field.<br> <li> Removed example payloads to align with new schema. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6914/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+4/-39</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>operation_test.go</strong><dd><code>Simplify mock response tests.</code> </dd></summary> <hr> apidef/oas/operation_test.go <li>Removed assertions on content examples and header values.<br> <li> Updated tests to only require non-nil response descriptions.<br> <li> Simplified the <code>verifyOASOperation</code> helper function. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6914/files#diff-cd234db716d6d2edc97c135ef546021c9ab4fa9282d63964bd155d41635cf964">+28/-79</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** PR for [TT-14169](https://tyktech.atlassian.net/browse/TT-14169) Addressed CVEs: - https://nvd.nist.gov/vuln/detail/CVE-2025-22868 - https://nvd.nist.gov/vuln/detail/CVE-2025-22869 - https://nvd.nist.gov/vuln/detail/CVE-2025-27144 - https://nvd.nist.gov/vuln/detail/cve-2022-29153 - https://nvd.nist.gov/vuln/detail/CVE-2024-2660 - https://nvd.nist.gov/vuln/detail/CVE-2025-22869 Rest of the CVEs were related to GNU C Library and OpenSSL. List of the CVEs can be found here: https://tyktechnologies.github.io/list-docker-cves/gateway/v5.8.0-rc1/ [TT-14169]: https://tyktech.atlassian.net/browse/TT-14169?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** - Bug fix ___ ### **Description** - Upgrade dependencies to address security CVEs - Update module versions in go.mod and go.sum ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update dependency versions in go.mod</code> </dd></summary> <hr> go.mod <li>Upgraded golang.org/x/crypto from v0.31.0 to v0.35.0<br> <li> Upgraded golang.org/x/oauth2 from v0.24.0 to v0.27.0<br> <li> Upgraded github.com/go-jose/go-jose/v4 from v4.0.1 to v4.0.5<br> <li> Updated golang.org/x/sync, golang.org/x/sys, golang.org/x/text <br>versions </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6917/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+6/-6</a> </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update dependency checksums in go.sum</code> </dd></summary> <hr> go.sum <li>Updated checksums for upgraded dependencies<br> <li> Reflected version changes for crypto, oauth2, and jose packages </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6917/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+14/-14</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14170" title="TT-14170" target="_blank">TT-14170</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update docs for Gateway changes</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 - Documentation ___ ### **Description** - Updated comments for clarity in API definitions. - Revised middleware and configuration inline comments. - Enhanced swagger documentation and version update. - Improved descriptive text for Tyk API behaviors. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>authentication.go</strong><dd><code>Clarify custom key lifetime comment.</code> </dd></summary> <hr> apidef/oas/authentication.go <li>Updated comment to specify access token lifetime.<br> <li> Clarified token retention description. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6919/files#diff-e51c9d24d4235e7cc53048cc1d92967d177585ba5e073f14876308a97bef6326">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Revise middleware skip comments formatting.</code> </dd></summary> <hr> apidef/oas/middleware.go <li>Reorganized skip rate-limit comment with classic API reference.<br> <li> Updated skip quota and quota reset comments with Tyk reference. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6919/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+6/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>upstream.go</strong><dd><code>Update preserve trailing slash comment.</code> </dd></summary> <hr> apidef/oas/upstream.go <li>Replaced duplicate header comment.<br> <li> Provided detailed explanation for trailing slash preservation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6919/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+2/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>config.go</strong><dd><code>Clarify control API port and cloud flag comments.</code> </dd></summary> <hr> config/config.go <li>Revised control API comment for separate port exposure.<br> <li> Updated cloud flag description for Tyk Cloud. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6919/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+2/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>swagger.yml</strong><dd><code>Update swagger version and endpoint summaries.</code> </dd></summary> <hr> swagger.yml <li>Bumped API version from 5.7.1 to 5.8.0.<br> <li> Updated summary texts to include Tyk branding.<br> <li> Enhanced endpoint descriptions for debug routes. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6919/files#diff-8f3c4cb253eee09ae2401daa7279a8bbfbfd4168bb579c3ac0ee5c672d63bb2c">+3/-3</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14214" title="TT-14214" target="_blank">TT-14214</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] ReadableDuration does not support millisecond granularity</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.0Regression%20ORDER%20BY%20created%20DESC" title="5.8.0Regression">5.8.0Regression</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description [TT-14214](https://tyktech.atlassian.net/browse/TT-14214) <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 [TT-14214]: https://tyktech.atlassian.net/browse/TT-14214?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** Bug fix Tests Enhancement ___ ### **Description** - Support millisecond granularity in ReadableDuration. - Update uptime, middleware and upstream tests for ms precision. - Add Milliseconds() method and floor Seconds() method. - Extend JSON schema patterns to include optional ms component. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>linter_test.go</strong><dd><code>Update uptime test timeout to millisecond precision</code> </dd></summary> <hr> apidef/oas/linter_test.go <li>Changed uptime test timeout from 10s to 10ms.<br> <li> Validate millisecond duration handling. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-b92239afd81e77a829fe7fe8410044dfd4dfda525d17dbf5f8811714a9c986d3">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware_test.go</strong><dd><code>Refine traffic logs retention period tests</code> </dd></summary> <hr> apidef/oas/middleware_test.go <li>Add 50ms offset to CustomRetentionPeriod.<br> <li> Reset retention period to ensure valid assertions. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-0af31cb29ae298a6ac3e402b283ab364a6fd793fd04f253ef7c4983234c17bef">+5/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>upstream_test.go</strong><dd><code>Enhance uptime tests with millisecond precision</code> </dd></summary> <hr> apidef/oas/upstream_test.go <li>Introduce sub-test for empty uptime tests.<br> <li> Validate timeout set to 50ms in filled uptime tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-222cc254c0c6c09fa0cf50087860b837a0873e2aef3c84ec7d80b1014c149057">+33/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>duration_test.go</strong><dd><code>Test millisecond JSON marshaling and Seconds() flooring</code> </dd></summary> <hr> internal/time/duration_test.go <li>Add test for JSON marshaling of 50ms duration.<br> <li> Verify Seconds() returns floored seconds from durations. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-71942cdc77128266498b62e712f82d0c63bbb39d236fe9e6677f49080c28cea1">+17/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>duration.go</strong><dd><code>Improve duration methods for millisecond handling</code> </dd></summary> <hr> internal/time/duration.go <li>Update Seconds() to return floored seconds.<br> <li> Add new Milliseconds() method for precise duration. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-6e8ef3118f84cbcc935f27d5a3ad5f4eb86eb22728400e9322c9b796b9d8d855">+8/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Update JSON schema regex for duration with ms support</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json - Update regex pattern to include optional milliseconds. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.strict.json</strong><dd><code>Update strict JSON schema regex for millisecond support</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.strict.json - Modify strict schema regex to support optional ms duration. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6916/files#diff-39a62344d6b741814a58dfd2d219665ecdf962bbec8e755dbc61e1684bb4892a">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** Upgrade `github.com/go-jose/go-jose/v3` to address https://nvd.nist.gov/vuln/detail/CVE-2025-27144. See the changes: https://github.com/go-jose/go-jose/releases/tag/v3.0.4 ___ ### **PR Type** Bug fix ___ ### **Description** - Update go-jose dependency to v3.0.4 - Adjust go.sum checksums accordingly - Mitigate CVE-2025-27144 vulnerability ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update dependency version in go.mod</code> </dd></summary> <hr> go.mod - Changed github.com/go-jose/go-jose/v3 version from v3.0.3 to v3.0.4 </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6925/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Adjust dependency checksums in go.sum</code> </dd></summary> <hr> go.sum <li>Updated checksum entries for github.com/go-jose/go-jose/v3 to v3.0.4 </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6925/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+2/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
Related tickets: TT-14302, TT-14303, TT-14304 This PR fixes following issues: - correctly maps `check_host_against_uptime_tests` to `loadBalancing.skipUnavailableHosts` - add `disabled` flag to uptime_tests including logic - remove `protocol` from `uptimeTests.tests` in OAS ## 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) - [ ] 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)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14170" title="TT-14170" target="_blank">TT-14170</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update docs for Gateway changes</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- https://tyktech.atlassian.net/browse/TT-14170 Added missing go docs for fields in the Tyk OAS API Definition. ___ ### **PR Type** - Documentation ___ ### **Description** - Added missing Go docs for API fields. - Standardized Tyk classic API definitions in comments. - Enhanced documentation across authentication, events, middleware, security and server. - Updated streaming config docs. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><details><summary>9 files</summary><table> <tr> <td><strong>authentication.go</strong><dd><code>Update go docs for authentication and key lifetime fields.</code></dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-e51c9d24d4235e7cc53048cc1d92967d177585ba5e073f14876308a97bef6326">+94/-10</a> </td> </tr> <tr> <td><strong>event.go</strong><dd><code>Add documentation for event handler and webhook configs.</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-528a9f5b311ff21c0b3a9b273e61398209ca8b51550327e4d437bba81e49d577">+26/-0</a> </td> </tr> <tr> <td><strong>middleware.go</strong><dd><code>Enhance middleware doc comments for plugins and transforms.</code></dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+75/-3</a> </td> </tr> <tr> <td><strong>root.go</strong><dd><code>Update API info and versioning documentation.</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+2/-0</a> </td> </tr> <tr> <td><strong>security.go</strong><dd><code>Add missing go docs for JWT and OAuth related fields.</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-15e7d47137452ca4f3f6139aa8c007cdb426152c41846f712f8bf5dfb607afcc">+60/-0</a> </td> </tr> <tr> <td><strong>server.go</strong><dd><code>Insert docs for server, client certificates and gateway tags.</code></dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+26/-0</a> </td> </tr> <tr> <td><strong>upstream.go</strong><dd><code>Document upstream configuration and request signing.</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+9/-0</a> </td> </tr> <tr> <td><strong>url_rewrite.go</strong><dd><code>Update documentation for URL rewrite rules and triggers.</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-7317c6061fb6488e079d733230045c7cbc1b4b2ffb98bb7da20d4025f4976e51">+4/-0</a> </td> </tr> <tr> <td><strong>config.go</strong><dd><code>Improve StreamingConfig and general config documentation.</code></dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6926/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+8/-2</a> </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14163" title="TT-14163" target="_blank">TT-14163</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Gateway enters in crashloop in emergency mode in k8n's</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- when start the rpc set as default in emergency mode.Some split in the connect function to improve readability <!-- Provide a general summary of your changes in the Title above --> ## Description With this PR now the dataplane will start in emergency mode until the RPC connection is successful. This will improve the start time when MDCB is down and the gateway is restarted or a new pod is created in a K8s environment. As a side work, some refactor of the ´Connect´ function to improve readability. ## Related Issue TT-14163 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested - Run an MDCB environment in k8s - Shut down MDCB, Replicas=0 - Start a new dataplane gw pod -> it should be initialized and not fall in crashback loop ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 ___ ### **Description** - Extracted configuration setup into a helper function. - Added initializeClient to manage RPC client initialization. - Introduced setupDialFunction for custom dialer configuration. - Improved readability by splitting Connect function parameters. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>rpc_client.go</strong><dd><code>Refactored Connect and added supporting helper functions.</code></dd></summary> <hr> rpc/rpc_client.go <li>Reformatted Connect function signature for clarity.<br> <li> Created setupConnectionConfig to store configuration and callbacks.<br> <li> Added initializeClient to set emergency mode and start client.<br> <li> Introduced setupDialFunction for dialer initialization. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6910/files#diff-3b88914c99bb9418e44e6389ce73579843562e8900730b380d7fff2e95c51033">+43/-44</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> Co-authored-by: sredny buitrago <[email protected]>
…enario (#6923) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-7306" title="TT-7306" target="_blank">TT-7306</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS:migration] Migrate Mock Response from Classic API Definition to OAS API Definition</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> This PR ensures that `ignoreAuthentication` is only present for OAS definitions originating from a migrated classic `API`. If the OAS definition is created directly, `ignoreAuthentication` should not be included. This is achieved by removing `extractMockResponsePaths` and related code. Additionally, `fillAllowance` is updated to prevent creating an allowance for mock response entries (`allow list` with `action=reply`). ## Related Issue https://tyktech.atlassian.net/browse/TT-7306 <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix - Tests ___ ### **Description** - Removed legacy mock response extraction functionality. - Deleted unused extractMockResponsePaths method. - Updated tests to expect zero mock responses. - Adjusted fixture to set mock_response to <nil>. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>operation.go</strong><dd><code>Remove mock response extraction function.</code> </dd></summary> <hr> apidef/oas/operation.go <li>Removed call to extractMockResponsePaths.<br> <li> Deleted extractMockResponsePaths function.<br> <li> Cleaned up related extraction logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6923/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-24</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>operation_test.go</strong><dd><code>Update tests for removed mock responses.</code> </dd></summary> <hr> apidef/oas/operation_test.go <li>Updated test expectations for mockResponse length.<br> <li> Removed assertions for legacy mock response values.<br> <li> Adjusted test conditions to expect no mock responses. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6923/files#diff-cd234db716d6d2edc97c135ef546021c9ab4fa9282d63964bd155d41635cf964">+4/-72</a> </td> </tr> <tr> <td> <details> <summary><strong>mock_response.yml</strong><dd><code>Update fixture to remove mock response data.</code> </dd></summary> <hr> apidef/oas/testdata/fixtures/mock_response.yml <li>Replaced mock_response data with <nil> value.<br> <li> Set white_list to <nil> in fixtures.<br> <li> Cleaned up legacy mock response data. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6923/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+6/-36</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
Hitherto, builds have been implemented using the features mechanism. With the proliferation of builds, fips, s/390, ee and so on, this has led to a confusing mess of conditionals in the templates. With this change, builds are parameterised in the config file and follow the same inheritance rules as the other parameters allowing for common builds to be specified at upper levels. A related change in policy match looks looks in tyk-ee instead of tyk. --------- Co-authored-by: Gromit <policy@gromit> Co-authored-by: Alok G Singh <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14170" title="TT-14170" target="_blank">TT-14170</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update docs for Gateway changes</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Code Review</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- Updated GW config godocs ___ ### **PR Type** - Documentation ___ ### **Description** - Updated access log documentation for Gateway. - Revised TLS version and SSL ciphers documentation links. - Modified control API port comment and link. - Updated KV store and secrets documentation references. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>config.go</strong><dd><code>Update godoc comments for Gateway configuration.</code> </dd></summary> <hr> config/config.go <li>Updated AccessLogsConfig comments to clarify log generation.<br> <li> Revised TLS version and custom SSL ciphers links in <br>HttpServerOptionsConfig.<br> <li> Modified ControlAPIPort comment for updated self-managed doc link.<br> <li> Updated KV store and secrets documentation links. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6938/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+8/-8</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
…aving a broken url (#6947) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14304" title="TT-14304" target="_blank">TT-14304</a></summary> <br /> <table> <tr> <th>Summary</th> <td>remove protocol from uptimeTests.tests in OAS</td> </tr> <tr> <th>Type</th> <td> <img alt="Sub-task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium" /> Sub-task </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- MAIN TASK: https://tyktech.atlassian.net/browse/TT-12957 SUBTASK: https://tyktech.atlassian.net/browse/TT-14304 <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix ___ ### **Description** - Return original URL when protocol is empty. - Prevent invalid protocol addition for classic API. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>upstream.go</strong><dd><code>Handle empty protocol in checkURL function.</code> </dd></summary> <hr> apidef/oas/upstream.go <li>Added check for empty protocol.<br> <li> Return original URL for classic API. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6947/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+4/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-7306" title="TT-7306" target="_blank">TT-7306</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS:migration] Migrate Mock Response from Classic API Definition to OAS API Definition</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> This PR makes sure that `allow_list` is not removed from migrated mock responses ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-7306 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 - Tests ___ ### **Description** - Remove resetting of allow list in OAS operations. - Update fixture tests with structured allow and block settings. - Add new test cases for block list and classic mock response. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>operation.go</strong><dd><code>Remove nil-reset of allow in operation config.</code> </dd></summary> <hr> apidef/oas/operation.go <li>Removed resetting allow property to nil.<br> <li> Preserve allow configuration for mock responses. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>mock_response.yml</strong><dd><code>Update mock response fixtures allow/block configuration.</code> </dd></summary> <hr> apidef/oas/testdata/fixtures/mock_response.yml <li>Replace allow: <nil> with explicit allow block.<br> <li> Add new block list test and update response settings.<br> <li> Enable allow list with enabled flag in fixtures. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14102" title="TT-14102" target="_blank">TT-14102</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS migration] Cache and Advanced Cache combined</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description This PR ensures that `OAS` cache is migrated correctly from the `classic` API. Values are imported from the API-level configuration (lower priority) and/or endpoint-level configurations (higher priority). For timeout, a default value of `60` is used if neither the API-level nor endpoint-level configuration specifies one. <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14102 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 ___ ### **Description** - Added debug logs to trace cache metadata. - Logged response codes and timeout values. - Aided testing of advanced cache behavior. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_redis_cache.go</strong><dd><code>Add debug logs in Redis cache middleware.</code> </dd></summary> <hr> gateway/mw_redis_cache.go <li>Inserted log for <code>cacheMeta</code> details.<br> <li> Logged <code>cacheOnlyResponseCodes</code> value.<br> <li> Logged <code>timeout</code> parameter. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6931/files#diff-6266e0dbd16cef89e6de86a2c893114ba07799c804e2138172f9f94b08cdded8">+5/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12957" title="TT-12957" target="_blank">TT-12957</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] Uptime testing</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Test</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix ___ ### **Description** - Fix timeout: convert value to seconds - Return original URL if protocol is empty ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>upstream.go</strong><dd><code>Fix timeout conversion and add empty protocol check</code> </dd></summary> <hr> apidef/oas/upstream.go <li>Multiply timeout by time.Second for proper conversion<br> <li> Add check for empty protocol in fillCheckURL to return original URL </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6956/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+5/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
…enabled in API definition (#6960) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14276" title="TT-14276" target="_blank">TT-14276</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Gateway panics if Uptime Tests are disabled in config but enabled in API definition </td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.0Regression%20ORDER%20BY%20created%20DESC" title="5.8.0Regression">5.8.0Regression</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- PR for [TT-14276](https://tyktech.atlassian.net/browse/TT-14276) `Gateway.nextTarget` method was designed to use `GlobalHostChecker` to control the selected host when `spec.Proxy.EnableLoadBalancing` and `spec.Proxy.CheckHostAgainstUptimeTests` are set to `true`. This leads to panic if the upstream tests are disabled globally in `tyk.conf`. It was actually checking `GlobalHostChecker` with the following condition: ```go if gw.GlobalHostChecker.store == nil { return host, nil } ``` But this block leads to panic because `gw.GlobalHostChecker` is nil. This PR corrects the condition and adds an integration test to check this specific combination of configuration parameters. [TT-14276]: https://tyktech.atlassian.net/browse/TT-14276?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** - Bug fix ___ ### **Description** - Prevent gateway panic when uptime tests are disabled in config - Add test verifying API returns 200 OK without GlobalHostChecker - Update condition to safely handle nil GlobalHostChecker ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>host_checker_test.go</strong><dd><code>Add test for disabled uptime tests scenario</code> </dd></summary> <hr> gateway/host_checker_test.go <li>Added new test case for uptime tests disabled in gateway config<br> <li> Validates API responds with 200 OK without panicking </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6960/files#diff-cfc8f5368c14d8fa56d845b1250f465b78c8aa6bfc5b47d0a556d706fa6b8622">+34/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>reverse_proxy.go</strong><dd><code>Refactor GlobalHostChecker nil check in nextTarget</code> </dd></summary> <hr> gateway/reverse_proxy.go <li>Updated condition check for GlobalHostChecker<br> <li> Return host early if GlobalHostChecker is nil to avoid panic </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6960/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+6/-3</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** https://tyktech.atlassian.net/browse/TT-14244 These are just cherry picks from release-5.3 where the bump to go vers and the godebug setup was already made. ___ ### **PR Type** - Enhancement ___ ### **Description** - Upgraded Go version from 1.23.4 to 1.23.6 - Added godebug flags for TLS and x509 compatibility - Consolidated debugging settings in go.mod ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Insert godebug flags and upgrade Go version</code> </dd></summary> <hr> go.mod <li>Updated Go version to 1.23.6<br> <li> Added godebug block with multiple TLS and x509 flags </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6963/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+15/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> Co-authored-by: Tit Petric <[email protected]> Co-authored-by: Tit Petric <[email protected]> Co-authored-by: Jeffy Mathew <[email protected]>
### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix ___ ### **Description** - Updated lint command branch revision - Replaced master with dynamic branch variable - Ensured CI works on non-master targets ___ ### **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>lint.yml</strong><dd><code>Use dynamic branch variable in lint command</code> </dd></summary> <hr> .taskfiles/lint.yml <li>Changed branch revision from master to dynamic variable.<br> <li> Updated lint task to reference <code>{{ .BRANCH_NAME }}</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6964/files#diff-363848321486b220d237efdc32336314ea3369c113f64fdfbec6a38ea62faf66">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
…tion on release p rs (#6965) ### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix ___ ### **Description** - Added new branch_name variable with fallback to master. - Updated lint command to use branch_name instead of BRANCH_NAME. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>lint.yml</strong><dd><code>Update branch variable and template in lint tasks.</code> </dd></summary> <hr> .taskfiles/lint.yml <li>Added branch_name variable with shell logic.<br> <li> Replaced template variable in golangci-lint command.<br> <li> Ensured proper branch detection for CI. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6965/files#diff-363848321486b220d237efdc32336314ea3369c113f64fdfbec6a38ea62faf66">+9/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-7815" title="TT-7815" target="_blank">TT-7815</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Cannot migrate API with endpoints containing path parameter </td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20DoD_Fail%20ORDER%20BY%20created%20DESC" title="DoD_Fail">DoD_Fail</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Re_open%20ORDER%20BY%20created%20DESC" title="Re_open">Re_open</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> This PR makes sure that path params are successfully migrated from Classic to OAS ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-7815 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix - Enhancement - Tests ___ ### **Description** - Refactored path splitting logic for OAS conversion. - Introduced helper functions for regex and mux template parsing. - Added unit tests covering various path parameter scenarios. - Provided test fixtures for classic to OAS migration. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>operation.go</strong><dd><code>Enhance path parameter migration in OAS operations.</code> </dd></summary> <hr> apidef/oas/operation.go <li>Added import for regexp and httputil.<br> <li> Refactored splitPath with empty path check.<br> <li> Introduced parsePathSegment, parseMuxTemplate, and isIdentifier.<br> <li> Improved regex detection and parameter naming. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6966/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+49/-18</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>operation_test.go</strong><dd><code>Add unit tests for splitPath functionality.</code> </dd></summary> <hr> apidef/oas/operation_test.go <li>Added TestSplitPath covering diverse scenarios.<br> <li> Verified correct parsing for simple, regex, and mux templates.<br> <li> Ensured empty and root paths are handled. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6966/files#diff-cd234db716d6d2edc97c135ef546021c9ab4fa9282d63964bd155d41635cf964">+72/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>path_params.yml</strong><dd><code>Add path params test fixture for OAS migration.</code> </dd></summary> <hr> apidef/oas/testdata/fixtures/path_params.yml <li>Created YAML fixtures for classic path parameter migration.<br> <li> Defined multiple test cases with varied input patterns.<br> <li> Mapped expected outputs for both simple and regex parameters. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6966/files#diff-0368200f5970a6c4e9bbfa2bb67a2af7568412926cf37d42a65579ef9bea4570">+144/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14413" title="TT-14413" target="_blank">TT-14413</a></summary> <br /> <table> <tr> <th>Summary</th> <td>API test test_oas_validate_request_parameters_on_path_level is now failing across all repos</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.0Regression%20ORDER%20BY%20created%20DESC" title="5.8.0Regression">5.8.0Regression</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> This PR make sure generateOperationID checks for existing params before generating new ones ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14413 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix - Tests ___ ### **Description** - Prevent overwriting existing parameters. - Add nil check before parameter initialization. - Skip duplicate parameter additions. - Include tests for operation ID and parameter retention. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>operation.go</strong><dd><code>Check and preserve existing parameters.</code> </dd></summary> <hr> apidef/oas/operation.go <li>Added nil check for parameter initialization.<br> <li> Created map for existing parameters.<br> <li> Skips adding duplicate parameters. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6973/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+15/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>operation_test.go</strong><dd><code>Add tests to validate operationID behavior.</code> </dd></summary> <hr> apidef/oas/operation_test.go <li>Introduced TestGetOperationID function.<br> <li> Validated operation ID generation.<br> <li> Verified parameter preservation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6973/files#diff-cd234db716d6d2edc97c135ef546021c9ab4fa9282d63964bd155d41635cf964">+136/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
…#6976) ### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description If an enforced timeout is configured for an API endpoint, now we will use it instead of the global default timeout, as it should take precedence. <!-- Describe your changes in detail --> ## Related Issue https://tyktech.atlassian.net/browse/TT-12343 <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context https://tyktech.atlassian.net/browse/TT-11285 <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested Unit tests <!-- 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. --> ## Screenshots (if appropriate) ## 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) - [ ] 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 <!-- 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 - [ ] 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** Bug fix, Tests ___ ### **Description** - Use API endpoint enforced timeout when configured - Update reverse proxy to prioritize enforced timeout - Add comprehensive tests for timeout scenarios - Validate behavior against global and explicit timeout settings ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>reverse_proxy.go</strong><dd><code>Use enforced API endpoint timeout in reverse proxy</code> </dd></summary> <hr> gateway/reverse_proxy.go <li>Add check for enforced timeout using <code>isTimeoutEnforced</code><br> <li> Update HTTP transport with the correct timeout value </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6976/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+6/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>reverse_proxy_test.go</strong><dd><code>Add comprehensive timeout prioritization tests</code> </dd></summary> <hr> gateway/reverse_proxy_test.go <li>Introduce <code>TestTimeoutPrioritization</code> with multiple timeout cases<br> <li> Test endpoints with differing enforced and default timeout values<br> <li> Verify gateway responses under various delay scenarios </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6976/files#diff-ce040f6555143f760fba6059744bc600b6954f0966dfb0fa2832b5eabf7a3c3f">+274/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14452" title="TT-14452" target="_blank">TT-14452</a></summary> <br /> <table> <tr> <th>Summary</th> <td>CVE's reported in RC4/5 images</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>Ready for Testing</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix ___ ### **Description** - Update `jwt/v4` version to v4.5.2. - Update `jwt/v5` version to v5.2.2. - Refresh dependency checksums in `go.sum`. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update jwt versions in go.mod dependencies</code> </dd></summary> <hr> go.mod <li>Bumped <code>github.com/golang-jwt/jwt/v4</code> from v4.5.1 to v4.5.2.<br> <li> Bumped <code>github.com/golang-jwt/jwt/v5</code> from v5.2.1 to v5.2.2. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6978/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+2/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Refresh go.sum with new jwt versions</code> </dd></summary> <hr> go.sum <li>Updated checksum entries for <code>jwt/v4</code> package.<br> <li> Updated checksum entries for <code>jwt/v5</code> package. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6978/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+4/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14357" title="TT-14357" target="_blank">TT-14357</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Stale context in UDG</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.1Refinement%20ORDER%20BY%20created%20DESC" title="5.8.1Refinement">5.8.1Refinement</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Commercial_candidate_rel3-2025%20ORDER%20BY%20created%20DESC" title="Commercial_candidate_rel3-2025">Commercial_candidate_rel3-2025</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_bug%20ORDER%20BY%20created%20DESC" title="customer_bug">customer_bug</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description In udg the headers are cached along with the plan for that request, so subsequent request with different headers use old headers to the upstream, this pr moves the header modification to the transport level out of the cache. <!-- Describe your changes in detail --> ## Benchmark results |Run | ns/op | byte/op | allocations |----------|----------|----------|------| | Before fix iteration 1 | 57626 | 1141010 | 1330 | | Before fix iteration 2 | 577525 | 1138360 | 1332 | | After fix iteration 1 | 586109 | 1143668 | 1350 | | After fix iteration 2 | 582655 | 1143647 | 1347 | ### benchmark comments This fix resolves a UDG request-handling issue but introduces a slight overhead. Benchmark measurements show minor increases in ns/op and allocations. While performance does dip slightly, the change ensures correct behavior and is considered an acceptable tradeoff for improving reliability. ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix - Tests - Enhancement ___ ### **Description** - Move header modification from cache to transport layer. - Introduce variableReplaceRoundTripper for header updates. - Extend tests and add benchmark for GraphQL UDG header behavior. - Clean up minor code style and loop iteration issues. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Miscellaneous</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_request_size_limit_test.go</strong><dd><code>Refine loop iteration in request size tests</code> </dd></summary> <hr> gateway/mw_request_size_limit_test.go <li>Refactored for-loop iteration over map keys.<br> <li> Improves clarity in test execution. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6977/files#diff-107317fefc06776e7acf5e35daac311b025a92c6721432272dbd7c7dcdd854f8">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>cache_test.go</strong><dd><code>Simplify Cache test struct instantiation</code> </dd></summary> <hr> internal/cache/cache_test.go <li>Simplified struct initialization for cache tests.<br> <li> Improved code formatting. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6977/files#diff-7fbdfb41b04a92f43e9826f893f4f7efa7431219a257f97f2c1d8219efb3f1fb">+3/-3</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>reverse_proxy_test.go</strong><dd><code>Add benchmark and enhanced tests for GraphQL headers</code> </dd></summary> <hr> gateway/reverse_proxy_test.go <li>Added BenchmarkGraphqlUDG test.<br> <li> Extended TestGraphQL_UDGHeaders with follow-up header checks.<br> <li> Validated proper header injection in GraphQL endpoints. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6977/files#diff-ce040f6555143f760fba6059744bc600b6954f0966dfb0fa2832b5eabf7a3c3f">+58/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>engine_v2.go</strong><dd><code>Move header modification to transport layer in EngineV2</code> </dd></summary> <hr> internal/graphengine/engine_v2.go <li>Introduced variableReplaceRoundTripper type.<br> <li> Wrapped reverse proxy RoundTripper to update headers.<br> <li> Removed inline header modification using variable replacer. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6977/files#diff-b1eaa954c9836f395e1d49090e85c739e3878747c8bd748f556fc5a53ff7b191">+22/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>graphql_go_tools_v1.go</strong><dd><code>Refactor GraphQL header modifier function</code> </dd></summary> <hr> internal/graphengine/graphql_go_tools_v1.go <li>Updated headerModifier to remove variable replacer.<br> <li> Simplified function signature for header injection. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6977/files#diff-e592cc8ca6ac39e7574765d7f2bbf19193f173791a1b0930d4dde7f9412dc882">+1/-6</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** PR for https://tyktech.atlassian.net/browse/TT-13365 `generate_bento_config_schema.go` generates a JSON schema for the Input/Output resources we support. Simply, ``` go run generate_bento_config.go ``` It'll generate a `bento-config-schema.json` file in the current working folder. You can also set an output path via `-output-path <string>` parameter. **How to add a new Input/Output resource** **1-** Import the related component for its side effects, for example if you want to produce a JSON schema that supports redis component, you can import it like the following: ``` _ "github.com/warpstreamlabs/bento/public/components/redis" ``` **2-** Add its name to `supportedItems` slice. You should know that some components exposes different input/output sources For example, components/kafka exposes `kafka` and `kafka_franz`. You need to dig into the Bento's codebase to understand which input/output is exposed by a component. Importing a small number of components was preferred instead of importing `components/all` because importing all components results in a huge `definitions/processor` object and there is no way to know which processor are used by the components we support. This tool assumes that we support the exact same components in both input and output sections. ___ ### **PR Type** enhancement ___ ### **Description** - Introduced a new Go script `generate_bento_config_schema.go` to generate a JSON schema for Bento configuration validation. - The script parses and manipulates JSON data to create a schema file, with error handling for file operations and JSON parsing. - Instructions are included for adding new Input/Output resources by importing components and updating the `supportedItems` slice. - The script outputs a `bento-config-schema.json` file, with an option to specify a custom output path. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>generate_bento_config_schema.go</strong><dd><code>Add Go script for generating Bento config JSON schema</code> </dd></summary> <hr> apidef/streams/bento/schema/generate_bento_config_schema.go <li>Added a new Go script to generate JSON schema for Bento config <br>validation.<br> <li> Implemented functions to parse and manipulate JSON schema data.<br> <li> Included error handling for file operations and JSON parsing.<br> <li> Provided instructions for adding new Input/Output resources.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6690/files#diff-6df17fac938f7b6fc05640fdfefd4315887362243e6130b53aec9563d12c84c5">+269/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12442" title="TT-12442" target="_blank">TT-12442</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Pro licensing it messed up. Sometimes more gateways than are licensed can get licences, sometimes gateways are refused when licences are available</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.1Refinement%20ORDER%20BY%20created%20DESC" title="5.8.1Refinement">5.8.1Refinement</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Commercial_candidate_rel2-2025%20ORDER%20BY%20created%20DESC" title="Commercial_candidate_rel2-2025">Commercial_candidate_rel2-2025</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_bug%20ORDER%20BY%20created%20DESC" title="customer_bug">customer_bug</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20jira_escalated%20ORDER%20BY%20created%20DESC" title="jira_escalated">jira_escalated</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20r2-commercial-candidate%20ORDER%20BY%20created%20DESC" title="r2-commercial-candidate">r2-commercial-candidate</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix ___ ### **Description** - Inject session ID header in API requests - Include session ID header in policy loader ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>api_definition.go</strong><dd><code>Insert session ID header in API requests</code> </dd></summary> <hr> gateway/api_definition.go <li>Added session header <code>header.XTykSessionID</code><br> <li> Retrieves session ID from <code>a.Gw.SessionID</code> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6984/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>policy.go</strong><dd><code>Insert session ID header in policy loader</code> </dd></summary> <hr> gateway/policy.go <li>Added session ID header "x-tyk-session-id"<br> <li> Uses <code>gw.SessionID</code> for header value </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6984/files#diff-ec674104322b26b82def55e9be32117753ab66e7840490481eb6eb4c15bc35e7">+1/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12442" title="TT-12442" target="_blank">TT-12442</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Pro licensing it messed up. Sometimes more gateways than are licensed can get licences, sometimes gateways are refused when licences are available</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.1Refinement%20ORDER%20BY%20created%20DESC" title="5.8.1Refinement">5.8.1Refinement</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Commercial_candidate_rel2-2025%20ORDER%20BY%20created%20DESC" title="Commercial_candidate_rel2-2025">Commercial_candidate_rel2-2025</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_bug%20ORDER%20BY%20created%20DESC" title="customer_bug">customer_bug</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20jira_escalated%20ORDER%20BY%20created%20DESC" title="jira_escalated">jira_escalated</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20r2-commercial-candidate%20ORDER%20BY%20created%20DESC" title="r2-commercial-candidate">r2-commercial-candidate</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix ___ ### **Description** - removed reLogin triggers on error responses - added session id header in registration request - prevented unnecessary gateway deregistration ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>api_definition.go</strong><dd><code>Remove redundant login failure handling</code> </dd></summary> <hr> gateway/api_definition.go <li>eliminated reLogin call on forbidden responses<br> <li> eliminated reLogin call on non-OK responses </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6985/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+0/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>dashboard_register.go</strong><dd><code>Insert session id header in registration</code> </dd></summary> <hr> gateway/dashboard_register.go - added session id header for dashboard registration request </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6985/files#diff-f504c88b3d2fa3b56b74c252aab41a934156879ef1150d33714225749e6cc94c">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>policy.go</strong><dd><code>Remove extraneous gateway reLogin on policy error</code> </dd></summary> <hr> gateway/policy.go - removed reLogin call on policy request failure </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6985/files#diff-ec674104322b26b82def55e9be32117753ab66e7840490481eb6eb4c15bc35e7">+0/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
… and apis (#6988) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12442" title="TT-12442" target="_blank">TT-12442</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Pro licensing it messed up. Sometimes more gateways than are licensed can get licences, sometimes gateways are refused when licences are available</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Code Review</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%205.8.1Refinement%20ORDER%20BY%20created%20DESC" title="5.8.1Refinement">5.8.1Refinement</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Commercial_candidate_rel2-2025%20ORDER%20BY%20created%20DESC" title="Commercial_candidate_rel2-2025">Commercial_candidate_rel2-2025</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_bug%20ORDER%20BY%20created%20DESC" title="customer_bug">customer_bug</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20jira_escalated%20ORDER%20BY%20created%20DESC" title="jira_escalated">jira_escalated</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20r2-commercial-candidate%20ORDER%20BY%20created%20DESC" title="r2-commercial-candidate">r2-commercial-candidate</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** - Bug fix ___ ### **Description** - Trigger gateway reload post-registration - Ensure latest API and policies load correctly ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>dashboard_register.go</strong><dd><code>Add gateway reload trigger after dashboard registration</code> </dd></summary> <hr> gateway/dashboard_register.go <li>Added call to h.Gw.DoReload after nonce is set<br> <li> Improves API and policy synchronization </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6988/files#diff-f504c88b3d2fa3b56b74c252aab41a934156879ef1150d33714225749e6cc94c">+1/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-10273" title="TT-10273" target="_blank">TT-10273</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] CORS check should be performed after API Version check</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20codilime_refined%20ORDER%20BY%20created%20DESC" title="codilime_refined">codilime_refined</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description The current implementation applies CORS middleware at the router level, which executes before the API Version Check middleware in the chain. This means that for versioned Tyk OAS APIs, the CORS configuration from the base API is always used, regardless of any version-specific CORS configurations. ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## 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) - [ ] New feature (non-breaking change which adds functionality) - [ ] 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. --> - [ ] 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** Bug fix, Enhancement, Tests ___ ### **Description** - Refactored CORS handling into a dedicated middleware for correct execution order - Ensured CORS checks occur after API version checks for OAS APIs - Updated OAuth endpoint handlers to apply CORS only when enabled - Added comprehensive unit and integration tests for the new CORS middleware ___ ### **Changes diagram** ```mermaid flowchart LR OldCORS["CORS at router level"] -- "removed" --> X1[""] VersionCheck["API Version Check Middleware"] -- "now before" --> NewCORS["CORSMiddleware"] NewCORS -- "added to middleware chain" --> APIHandler["API Handler"] OAuthEndpoints["OAuth Endpoints"] -- "wrapped with CORS if enabled" --> OAuthCORS["CORS Wrapper"] TestsOld["Old CORS tests"] -- "removed" --> X2[""] TestsNew["New CORSMiddleware tests"] -- "added" --> CORSMiddleware ``` ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api_loader.go</strong><dd><code>Move CORS handling to middleware chain after version check</code></dd></summary> <hr> gateway/api_loader.go <li>Removed router-level CORS middleware application<br> <li> Added CORSMiddleware to the middleware chain after version check </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7179/files#diff-cdf0b7f176c9d18e1a314b78ddefc2cb3a94b3de66f1f360174692c915734c68">+1/-16</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_cors.go</strong><dd><code>Add CORSMiddleware implementation for CORS handling</code> </dd></summary> <hr> gateway/mw_cors.go <li>Introduced CORSMiddleware struct and logic<br> <li> Handles CORS requests as part of middleware chain<br> <li> Returns early for preflight OPTIONS requests </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7179/files#diff-b83b51e5f6dc341b26ecc1ef7bd72d680f398e599eea327662e2169a3b55f208">+43/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>server.go</strong><dd><code>Apply CORS wrapper to OAuth endpoints when enabled</code> </dd></summary> <hr> gateway/server.go <li>Updated OAuth endpoint handlers to wrap with CORS only if enabled<br> <li> Added createCORSWrapper utility for conditional CORS wrapping </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7179/files#diff-4652d1bf175a0be8f5e61ef7177c9666f23e077d8626b73ac9d13358fa8b525b">+34/-4</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>api_loader_test.go</strong><dd><code>Remove outdated CORS tests</code> </dd></summary> <hr> gateway/api_loader_test.go - Removed legacy CORS test function </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7179/files#diff-f696545a659f4d96421b253edef4bcc8da0e7f52120b8f8866d32cbbb7cc1afc">+0/-73</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_cors_test.go</strong><dd><code>Add comprehensive CORSMiddleware tests</code> </dd></summary> <hr> gateway/mw_cors_test.go <li>Added unit tests for CORSMiddleware logic<br> <li> Added integration tests for CORS behavior on APIs and OAuth endpoints<br> <li> Utility functions for CORS config and middleware creation </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7179/files#diff-60316be235ab2e13eab4b17dfa535b441db3c29d388c433cca7d6fbe4d26c3a0">+157/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
…#7208) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14914" title="TT-14914" target="_blank">TT-14914</a></summary> <br /> <table> <tr> <th>Summary</th> <td> No response middleware information in Tyk OAS API Debugger</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Code Review</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC" title="QA_Fail">QA_Fail</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20codilime_refined%20ORDER%20BY%20created%20DESC" title="codilime_refined">codilime_refined</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description Short fix that @radkrawczyk managed to find. XRateLimit* already headers present in mocked-response. In addition smal refatoring. Code responsible for sending those headers placed in one method. ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## 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) - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix, Enhancement ___ ### **Description** - Centralized logic for sending rate-limit headers in responses - Fixed missing rate-limit headers in mocked and cached responses - Refactored code to use new `sendRateLimitHeaders` method - Improved maintainability by removing duplicate header logic ___ ### **Changes diagram** ```mermaid flowchart LR A["Duplicate rate-limit header logic"] -- "Refactored to" --> B["sendRateLimitHeaders method in APISpec"] B -- "Used by" --> C["Mock response middleware"] B -- "Used by" --> D["Redis cache middleware"] B -- "Used by" --> E["Virtual endpoint forced response"] B -- "Used by" --> F["Reverse proxy response handler"] C -- "Ensures" --> G["Consistent rate-limit headers in mocked responses"] D -- "Ensures" --> H["Consistent rate-limit headers in cached responses"] E -- "Ensures" --> I["Consistent rate-limit headers in forced responses"] F -- "Ensures" --> J["Consistent rate-limit headers in proxied responses"] ``` ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>model_apispec.go</strong><dd><code>Add and use centralized rate-limit header sender</code> </dd></summary> <hr> gateway/model_apispec.go <li>Added <code>sendRateLimitHeaders</code> method to centralize rate-limit header <br>logic<br> <li> Utilizes session data to set X-RateLimit headers on responses </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7208/files#diff-80c49b9bdb411a3d5a4706ec3ff138ef44154d0306040c19eba1cb5559f199d6">+22/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_redis_cache.go</strong><dd><code>Use centralized rate-limit headers in cache middleware</code> </dd></summary> <hr> gateway/mw_redis_cache.go <li>Replaces inline rate-limit header logic with <code>sendRateLimitHeaders</code><br> <li> Ensures cached responses include consistent rate-limit headers </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7208/files#diff-6266e0dbd16cef89e6de86a2c893114ba07799c804e2138172f9f94b08cdded8">+1/-9</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_virtual_endpoint.go</strong><dd><code>Use centralized rate-limit headers in virtual endpoint responses</code></dd></summary> <hr> gateway/mw_virtual_endpoint.go <li>Replaces inline rate-limit header logic with <code>sendRateLimitHeaders</code><br> <li> Ensures forced responses include quota headers </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7208/files#diff-daf72ac3b29609a9f2a77cccf648f91ba62b2ad977a7c5a44602c72b2a28b2e5">+1/-10</a> </td> </tr> <tr> <td> <details> <summary><strong>reverse_proxy.go</strong><dd><code>Use centralized rate-limit headers in reverse proxy responses</code></dd></summary> <hr> gateway/reverse_proxy.go <li>Replaces inline rate-limit header logic with <code>sendRateLimitHeaders</code><br> <li> Ensures proxied responses include quota headers </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7208/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+1/-9</a> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_mock_response.go</strong><dd><code>Add rate-limit headers to mocked responses</code> </dd></summary> <hr> gateway/mw_mock_response.go <li>Calls <code>sendRateLimitHeaders</code> to add rate-limit headers to mocked <br>responses<br> <li> Ensures mocked responses include quota information </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7208/files#diff-fa778ebf662b147d9693791799966dbd20fca6eb5dc98b2e7264230b4e0cbfbd">+2/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Miscellaneous</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Minor formatting adjustment</code> </dd></summary> <hr> gateway/middleware.go - Minor formatting change (added blank line) - No functional changes </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7208/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+1/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
… be in the same format as the other gateway logs (#7245) ### **User description** PR for https://tyktech.atlassian.net/browse/TT-14254 I have implemented a log adapter to translate Bento logs to Tyk's logging convention. The new logger. Log lines before the fix. Every Tyk Stream creates its own Logrus instance and Bento uses its own logger. This will cause issues with log aggregators like logz.io for Ara and Datadog making the product harder to support. ``` DEBU[2025-07-21T11:12:02+03:00] Starting stream DEBU[2025-07-21T11:12:02+03:00] Building new stream DEBU[2025-07-21T11:12:02+03:00] Stream built successfully, starting it INFO[2025-07-21T11:12:02+03:00] Starting stream {"label":"","level":"info","msg":"Output type kafka is now active","path":"root.output","stream":"default_stream","time":"2025-07-21T11:12:02+03:00"} DEBU[2025-07-21T11:12:02+03:00] Stream started successfully time="Jul 21 11:12:02" level=info msg="Successfully created stream: bce952d368e141286911e87d24807f6b_default_stream" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request time="Jul 21 11:12:38" level=info msg="Removing inactive stream manager: 3cacc3925d6de947d369b0a159a4b898ae116fa2fe8ddea2031b618ecc27e4f1" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request INFO[2025-07-21T11:12:38+03:00] Stopping stream INFO[2025-07-21T11:12:38+03:00] Stream stopped successfully ``` After the fix, it looks like the following. Bento and Tyk streams use the gateway's logger: ``` time="Jul 21 11:09:33" level=info msg="Starting stream" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request time="Jul 21 11:09:33" level=info msg="Output type kafka is now active" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry bento_label= bento_path=root.output mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request time="Jul 21 11:09:33" level=info msg="Successfully created stream: bce952d368e141286911e87d24807f6b_default_stream" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request time="Jul 21 11:10:27" level=info msg="Removing inactive stream manager: 3cacc3925d6de947d369b0a159a4b898ae116fa2fe8ddea2031b618ecc27e4f1" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request time="Jul 21 11:10:27" level=info msg="Stopping stream" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request time="Jul 21 11:10:27" level=info msg="Stream stopped successfully" api_id=bce952d368e141286911e87d24807f6b api_name=backoff-retry mw=StreamingMiddleware org_id=6821ac21f2c73410d7f5cdfa type=request ``` ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Introduced `bentoLogAdapter` to unify Bento and Tyk log formats - Refactored stream logging to use injected logger and adapter - Updated stream creation and tests for new logging approach - Added comprehensive unit tests for log adapter functionality ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Bento log output"] -- "via bentoLogAdapter" --> B["Tyk logger (logrus.Entry)"] B -- "used in Stream" --> C["Stream lifecycle (Start/Stop)"] D["Stream creation"] -- "inject logger" --> C E["Unit tests"] -- "test adapter & stream" --> B ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>bento_log_adapter.go</strong><dd><code>Add Bento-to-Tyk log adapter for unified logging</code> </dd></summary> <hr> ee/middleware/streams/bento_log_adapter.go <ul><li>Added new <code>bentoLogAdapter</code> type to translate Bento logs to Tyk format<br> <li> Implements <code>io.Writer</code> to parse JSON log lines and forward to logrus<br> <li> Handles log level mapping, message extraction, and field prefixing<br> <li> Ensures interface compliance and error handling for malformed logs</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7245/files#diff-317ddef92ffd0685991a22c5c62b758b1d8f6afc9a4453123d32aa4e58550651">+74/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>stream.go</strong><dd><code>Refactor Stream to use injected logger and log adapter</code> </dd></summary> <hr> ee/middleware/streams/stream.go <ul><li>Refactored to use injected <code>logrus.Entry</code> for logging instead of <br>internal logger<br> <li> Integrated <code>bentoLogAdapter</code> via <code>slog.NewJSONHandler</code> for Bento logs<br> <li> Updated all logging calls to use new logger<br> <li> Improved comments and logging consistency</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7245/files#diff-12571ea9605d5a2dd5ab5aa36972649881f87a84a39b7074213d29d24fc396a8">+22/-34</a> </td> </tr> <tr> <td> <details> <summary><strong>manager.go</strong><dd><code>Inject logger into Stream during creation</code> </dd></summary> <hr> ee/middleware/streams/manager.go <ul><li>Modified stream creation to inject logger into <code>NewStream</code><br> <li> Ensures all streams use unified logging approach</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7245/files#diff-3e372b3346d8d296e6953152c89202a634d7654f10549676af9aea8628e13dfb">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>bento_log_adapter_test.go</strong><dd><code>Add tests for Bento log adapter functionality</code> </dd></summary> <hr> ee/middleware/streams/bento_log_adapter_test.go <ul><li>Added unit tests for <code>bentoLogAdapter</code> covering info, error, and <br>undefined levels<br> <li> Tests correct field mapping and log output format<br> <li> Includes test for handling malformed/corrupt log lines</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7245/files#diff-a6348482f9267925b69aa6fd11156cf43a6cb6b2f4e0fd21a996b4e6adcefcf0">+79/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>stream_test.go</strong><dd><code>Update stream tests for logger injection and refactor</code> </dd></summary> <hr> ee/middleware/streams/stream_test.go <ul><li>Updated tests to use new logger-injected <code>NewStream</code> signature<br> <li> Added helper for test logger creation<br> <li> Ensured tests are compatible with refactored logging</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7245/files#diff-7831fa7a5e3c834833b4f09c7e28a36275214856a2df3d4b70c8cce6f1328afb">+12/-5</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
…added helper method (#7246) ### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description [TT-15321](https://tyktech.atlassian.net/browse/TT-15321) <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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 [TT-15321]: https://tyktech.atlassian.net/browse/TT-15321?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** Documentation ___ ### **Description** - Adds a comprehensive development guide for OAS-only features - Details architecture and configuration for OAS-based features - Provides middleware implementation and testing strategies - Outlines documentation, best practices, and release considerations ___ ### Diagram Walkthrough ```mermaid flowchart LR A["New OAS-Only Feature Guide"] -- "explains" --> B["OAS Architecture & Core Structures"] B -- "guides" --> C["Feature Configuration in XTykAPIGateway"] C -- "leads to" --> D["Middleware Implementation"] D -- "requires" --> E["Testing Strategies"] E -- "includes" --> F["Documentation & Best Practices"] F -- "covers" --> G["Backward Compatibility & Release"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>oas_only_feature_development.md</strong><dd><code>Introduce OAS-only feature development guide for developers</code></dd></summary> <hr> docs/dev/oas_only_feature_development.md <ul><li>Adds a new markdown guide for OAS-only feature development<br> <li> Explains core architecture and configuration patterns<br> <li> Provides middleware and testing implementation examples<br> <li> Covers documentation, best practices, and release/migration</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7246/files#diff-5903eb29e63a6858c454176ff6690476ed98de5e0ff2e62fc531f474d8b737d8">+205/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-11244" title="TT-11244" target="_blank">TT-11244</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Custom domain regex causing problems with servers</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20codilime_refined%20ORDER%20BY%20created%20DESC" title="codilime_refined">codilime_refined</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix, Enhancement, Tests ___ ### **Description** - Fixed handling of custom domain regex in OAS server URLs. - Added robust parsing for server URLs with regex and variables. - Introduced `RemoveServer` method to remove servers by normalized URL. - Enhanced and expanded tests for server URL parsing and server management. ___ ### Diagram Walkthrough ```mermaid flowchart LR oasutil["oasutil/servers.go: Server URL parser & helpers"] oas["apidef/oas/oas.go: AddServers/RemoveServer logic"] oastest["apidef/oas/oas_test.go: AddServers & RemoveServer tests"] gateway["gateway/api.go: Integrate AddServers error handling"] oasutiltest["internal/oasutil/servers_test.go: Parser unit tests"] oasutil -- "used by" --> oas oas -- "tested by" --> oastest oasutil -- "tested by" --> oasutiltest gateway -- "calls" --> oas ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>oas.go</strong><dd><code>Refactor and fix OAS server URL add/remove logic</code> </dd></summary> <hr> apidef/oas/oas.go <ul><li>Added <code>RemoveServer</code> method for removing servers by normalized URL.<br> <li> Refactored <code>AddServers</code> to use new server URL parser and handle <br>regex/variables.<br> <li> Updated <code>AddServers</code> to return errors on invalid input.<br> <li> Improved handling of server variables and normalization.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7233/files#diff-80279b1d59499a41a77ff7a16a6e2c9b9b785a4fd1326c351da6884c867658d7">+36/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>servers.go</strong><dd><code>Add robust OAS server URL parser utility</code> </dd></summary> <hr> internal/oasutil/servers.go <ul><li>Introduced server URL parser handling regex and variables.<br> <li> Added error types for parsing issues and collisions.<br> <li> Provided normalization and variable extraction logic.<br> <li> Exported <code>ParseServerUrl</code> for external use.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7233/files#diff-98dd06199bf9992e099563df9150f18cb38094f4dae3299f33c5330722ddac3d">+162/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>oas_test.go</strong><dd><code>Expand and improve OAS server management tests</code> </dd></summary> <hr> apidef/oas/oas_test.go <ul><li>Updated <code>TestOAS_AddServers</code> to test new server URL parsing and <br>normalization.<br> <li> Added <code>Test_RemoveServer</code> for new removal logic and edge cases.<br> <li> Improved assertions for server variables and error handling.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7233/files#diff-74029ee88132d30d6478c96a35f8bb2200e0c8e6f42f2c9b147dc6bb7ce74644">+103/-42</a></td> </tr> <tr> <td> <details> <summary><strong>servers_test.go</strong><dd><code>Add unit tests for OAS server URL parser</code> </dd></summary> <hr> internal/oasutil/servers_test.go <ul><li>Added comprehensive unit tests for server URL parser.<br> <li> Covered positive and negative cases, including regex and collisions.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7233/files#diff-4a274e0f05feb520d7ff68fb48a7a28020ea7525820ac8105f4c898854a19af8">+91/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Integrate AddServers error handling in API creation</code> </dd></summary> <hr> gateway/api.go <ul><li>Updated OAS API add handler to handle errors from <code>AddServers</code>.<br> <li> Returns HTTP 400 if server URL parsing fails.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7233/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+4/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
…t `new_version_name` (#7244) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-7523" title="TT-7523" target="_blank">TT-7523</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS Versioning] Gateway CE allows to create version without `new_version_name`</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20codilime_refined%20ORDER%20BY%20created%20DESC" title="codilime_refined">codilime_refined</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20version-tyk-oas%20ORDER%20BY%20created%20DESC" title="version-tyk-oas">version-tyk-oas</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description Gateway API accepts requests to create new API version even if the new version name parameter is not specified. This PR contains fix for this issue along with example, how a shared library could be used to extract common code. ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## 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) - [ ] New feature (non-breaking change which adds functionality) - [ ] 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. --> - [ ] 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** Bug fix, Enhancement, Tests ___ ### **Description** - Enforces validation for `new_version_name` when creating API versions - Returns HTTP 422 if `new_version_name` is missing in versioning requests - Refactors versioning logic into a shared library (`lib/apidef/version.go`) - Adds comprehensive unit tests for versioning logic in shared library ___ ### Diagram Walkthrough ```mermaid flowchart LR apiHandler["Gateway API Versioning Handler"] sharedLib["Shared Versioning Library (lib/apidef/version.go)"] validation["Validation for new_version_name"] error422["Returns HTTP 422 on missing new_version_name"] tests["Unit Tests for Versioning Logic"] apiHandler -- "Uses" --> sharedLib sharedLib -- "Performs" --> validation validation -- "On error" --> error422 sharedLib -- "Covered by" --> tests ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Enforce and refactor API versioning logic using shared library</code></dd></summary> <hr> gateway/api.go <ul><li>Integrates shared versioning library for parameter handling and <br>validation<br> <li> Enforces <code>new_version_name</code> presence, returning HTTP 422 if missing<br> <li> Refactors versioning logic to use new shared library functions<br> <li> Simplifies and clarifies API versioning code path</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7244/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+46/-56</a> </td> </tr> <tr> <td> <details> <summary><strong>version.go</strong><dd><code>Add shared library for API versioning logic and validation</code></dd></summary> <hr> lib/apidef/version.go <ul><li>Introduces shared library for API versioning parameter handling and <br>validation<br> <li> Implements strict validation for required parameters (e.g., <br><code>new_version_name</code>)<br> <li> Provides utility functions for configuring version definitions<br> <li> Centralizes versioning logic for reuse and maintainability</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7244/files#diff-9e698644fcca1a469641d3cd92ad309f640e4f8474b6d4fbe9478123516f180d">+181/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>version_test.go</strong><dd><code>Add unit tests for shared versioning library</code> </dd></summary> <hr> lib/apidef/version_test.go <ul><li>Adds comprehensive unit tests for versioning parameter logic and <br>validation<br> <li> Tests error handling for missing and invalid parameters<br> <li> Verifies configuration of version definitions via shared library<br> <li> Ensures robustness of new versioning logic</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7244/files#diff-c67df2864ba1a068ada18f017570b6190f6af0e1f1515f3110a81f59a7da42e6">+181/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
…using a schema problem (#7256) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14370" title="TT-14370" target="_blank">TT-14370</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] ReadableDuration converts some values to decimals causing a schema problem</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20codilime_refined%20ORDER%20BY%20created%20DESC" title="codilime_refined">codilime_refined</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## 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. --> ## Screenshots (if appropriate) ## 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) - [ ] 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 <!-- 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. --> - [ ] 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** Bug fix, Tests ___ ### **Description** - Fixes duration serialization to avoid decimal values in JSON. - Implements custom formatting for `ReadableDuration` output. - Adds new test cases for composite durations (e.g., "1m30s"). - Updates expected JSON outputs in tests for consistency. ___ ### Diagram Walkthrough ```mermaid flowchart LR durationGo["duration.go: Add custom format for ReadableDuration"] -- "uses" --> durationTestGo["duration_test.go: Update & add tests for new format"] durationGo -- "fixes" --> "JSON serialization issue" durationTestGo -- "validates" --> "Correct output for various durations" ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>duration.go</strong><dd><code>Custom formatting for ReadableDuration JSON serialization</code></dd></summary> <hr> internal/time/duration.go <ul><li>Adds a custom <code>format()</code> method for <code>ReadableDuration</code>.<br> <li> Ensures JSON serialization outputs only integer values and valid <br>patterns.<br> <li> Introduces constants and a conversion table for time units.<br> <li> Refactors <code>MarshalJSON</code> to use the new formatting logic.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7256/files#diff-6e8ef3118f84cbcc935f27d5a3ad5f4eb86eb22728400e9322c9b796b9d8d855">+53/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>duration_test.go</strong><dd><code>Update and expand tests for duration serialization</code> </dd></summary> <hr> internal/time/duration_test.go <ul><li>Updates expected JSON output for minute-based durations.<br> <li> Adds new test for composite durations (e.g., "1m30s").<br> <li> Ensures tests align with new serialization logic.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7256/files#diff-71942cdc77128266498b62e712f82d0c63bbb39d236fe9e6677f49080c28cea1">+9/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-15019" title="TT-15019" target="_blank">TT-15019</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update Gateway and Plugin Compiler to Go 1.24</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- PR for https://tyktech.atlassian.net/browse/TT-15019 ___ ### **PR Type** Enhancement ___ ### **Description** - Update Go version to 1.24 across all workflows and Dockerfiles - Update plugin compiler base image to Go 1.24 - Update Go version in go.mod to 1.24.0 - Ensure all CI and release jobs use Go 1.24 images ___ ### Diagram Walkthrough ```mermaid flowchart LR A[".github/workflows/ci-tests.yml"] -- "Set go-version to 1.24.x" --> B["CI uses Go 1.24"] C[".github/workflows/plugin-compiler-build.yml"] -- "Set GOLANG_CROSS to 1.24-bullseye" --> D["Plugin compiler uses Go 1.24"] E[".github/workflows/release.yml"] -- "Update golang_cross matrix to 1.24-bullseye" --> F["Release jobs use Go 1.24"] G["Dockerfile"] -- "Set GO_VERSION to 1.24" --> H["Gateway builds with Go 1.24"] I["ci/images/plugin-compiler/Dockerfile"] -- "Set BASE_IMAGE to Go 1.24" --> J["Plugin compiler Docker image uses Go 1.24"] K["go.mod"] -- "Set go version to 1.24.0" --> L["Project uses Go 1.24"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>ci-tests.yml</strong><dd><code>Update CI test workflow to Go 1.24</code> </dd></summary> <hr> .github/workflows/ci-tests.yml - Update Go version in matrix from 1.23.x to 1.24.x for CI tests </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7265/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>plugin-compiler-build.yml</strong><dd><code>Use Go 1.24 for plugin compiler build workflow</code> </dd></summary> <hr> .github/workflows/plugin-compiler-build.yml <ul><li>Set GOLANG_CROSS environment variable to 1.24-bullseye for plugin <br>compiler builds</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7265/files#diff-f3a95a900eb0ac23af6314e9cdea29fa16af0a9bcb61793a83a32ff13d4c4e79">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>release.yml</strong><dd><code>Update release workflow to use Go 1.24</code> </dd></summary> <hr> .github/workflows/release.yml <ul><li>Update golang_cross matrix and related conditionals from 1.23-bullseye <br>to 1.24-bullseye<br> <li> Ensure all build, push, and artifact steps use Go 1.24</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7265/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34">+11/-11</a> </td> </tr> <tr> <td> <details> <summary><strong>Dockerfile</strong><dd><code>Update Gateway Dockerfile to Go 1.24</code> </dd></summary> <hr> Dockerfile <ul><li>Change GO_VERSION build argument from 1.23 to 1.24<br> <li> Use golang:1.24-bullseye as base image</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7265/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>Dockerfile</strong><dd><code>Update plugin compiler Dockerfile to Go 1.24</code> </dd></summary> <hr> ci/images/plugin-compiler/Dockerfile - Change BASE_IMAGE from Go 1.23 to Go 1.24 for plugin compiler </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7265/files#diff-0ded1ed63ca128bd2d22721b0bc19dc85e440e4922164f465ac647917321971e">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Set project Go version to 1.24.0</code> </dd></summary> <hr> go.mod - Update Go version from 1.23.10 to 1.24.0 in go.mod </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7265/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
💔 The detected issue is not in one of the allowed statuses 💔
Please ensure your jira story is in one of the allowed statuses |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
API Changes no api changes detected |
🛡️ Security Snapshot
## Security Impact AnalysisThe PR changes the ## Identified VulnerabilitiesNo direct security vulnerabilities introduced by this change. The modification:
The only minor concern is the removal of error logging for JSON encoding failures, which slightly reduces observability but does not constitute a security vulnerability. ## Security RecommendationsConsider retaining error logging for JSON encoding failures to maintain observability. While encoding errors are rare, logging them helps with debugging and ensures that any unexpected behavior is captured: if err := json.NewEncoder(w).Encode(res); err != nil {
mainLog.Warning("[Liveness] Could not encode response, error: %s", err.Error())
} ## OWASP ComplianceThis change does not impact OWASP Top 10 concerns:
The change aligns with standard health check implementation patterns used in cloud-native applications. ## Summary
Tip: Mention me again using |
🚀 Performance Snapshot
## Performance Impact AnalysisThe changes to the ## Critical AreasThe liveness endpoint is not in a critical performance path for normal API traffic processing. It's primarily used by monitoring systems and Kubernetes health probes, which typically poll at intervals of several seconds. The changes don't affect any data structures or algorithms that would impact the core request processing pipeline. The simplification of the health check evaluation logic is a positive change from a performance perspective. ## Optimization RecommendationsWhile the removal of error logging improves performance slightly, it comes at the cost of reduced observability. Consider adding a debug-level log for JSON encoding failures to maintain some level of observability without the overhead of warning-level logging. This would help with troubleshooting in development environments while keeping production performance optimal. ## Summary
Tip: Mention me again using |
🚦 Connectivity Review Snapshot
## Connectivity Assessment
## Test Coverage Validation
## Security & Performance Impact
## Summary & Recommendations
Tip: Mention me again using |
📦 Impact Review Snapshot
## Impact AssessmentThis change modifies the behavior of the This is a common pattern for liveness probes in Kubernetes environments, where a non-200 status would cause pod restarts. The change is isolated to the gateway's internal health check handling and doesn't modify any API definitions, schemas, or protocols that would affect downstream repositories. ## Required UpdatesNo updates are required in downstream repositories as this change:
However, if any downstream repositories have tests or monitoring that expect the
## Compatibility ConcernsThe main compatibility concern is for any monitoring or alerting systems that rely on HTTP status codes from the It's worth noting that the PR maintains backward compatibility in terms of the response body format - the JSON structure remains the same with health status information. Only the HTTP status code behavior has changed. The PR also removes error logging for JSON encoding failures, which might slightly reduce observability but is unlikely to cause operational issues since encoding errors are rare in this context. The test case ## Summary & Recommendations
Tip: Mention me again using |
Analysis of PR #7278: Reverting /hello endpoint to always return 200 status codeThis PR modifies the behavior of the Key Changes:
Impact:
Minor Concern:The PR removes error logging for JSON encoding failures in the liveness handler, which could slightly reduce observability. However, encoding errors are rare in this context, and the readiness handler still logs these errors. Overall, this change aligns with best practices for Kubernetes liveness probes and simplifies the code while maintaining the ability to monitor component health through the response body. Tip: Mention me again using |
Security Impact Analysis of PR #7278This PR modifies the
Security AssessmentThis change has minimal security impact as it only affects how the health status is reported via HTTP status codes, not the actual security controls or authentication mechanisms. Positive Aspects
Potential Concerns
RecommendationConsider retaining error logging for JSON encoding failures to maintain observability, but the current implementation is acceptable from a security perspective. Overall, this is a safe operational change that follows standard patterns for containerized applications. Tip: Mention me again using |
Analysis of PR #7278: Reverting /hello endpoint to always return 200 status codeOverviewThis PR modifies the Current ImplementationCurrently, the func (gw *Gateway) LivenessHandler(w http.ResponseWriter, r *http.Request) {
// ...
redisStatus, rpcStatus := evaluateHealthChecks(gw)
res.Checks.Redis.Status = redisStatus
res.Checks.RPC.Status = rpcStatus
statusCode := determineHealthStatus(redisStatus, rpcStatus)
w.WriteHeader(statusCode)
if err := json.NewEncoder(w).Encode(res); err != nil {
mainLog.Error("Could not encode liveness response, error: ", err)
}
} The Changes in this PRBased on the PR description, the changes include:
RationaleThis change aligns with Kubernetes best practices for liveness probes, which should only fail when the process is completely unresponsive. The benefits include:
The comment in the // Unlike liveCheckHandler which always returns 200 OK, readinessHandler returns 503 Service Unavailable
// if the gateway is not ready to serve requests Impact
ConclusionThis is a targeted change that affects only the HTTP status code returned by the liveness endpoint, not the actual health check logic or information provided in the response. It's a sensible change for Kubernetes environments where pod lifecycle should be managed more conservatively. Tip: Mention me again using |
PR Review: Reverting /hello endpoint to always return 200 status codeThis PR simplifies the health check handling in the Tyk Gateway by removing unused functions and ensuring the Key Changes
Impact AnalysisThis change is beneficial for Kubernetes deployments where liveness probes should only restart pods when the application is completely down. By always returning 200 OK but including the actual health status in the response body, monitoring systems can still detect and alert on health issues without triggering unnecessary restarts. The PR maintains backward compatibility in terms of the response body format, so existing monitoring systems that parse the JSON response will continue to work correctly. Recommendations
Overall, this is a sensible change that aligns with Kubernetes best practices for liveness probes. Tip: Mention me again using |
|
User description
Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
Bug fix
Description
/hello
endpoint now always returns HTTP 200 statusRemoved dynamic status code logic from liveness handler
Simplified health check status evaluation
Cleaned up error handling in response encoding
Diagram Walkthrough
File Walkthrough
health_check.go
Liveness endpoint always returns HTTP 200, simplified logic
gateway/health_check.go