-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[TT-2539] added access/transaction logs #6616
base: master
Are you sure you want to change the base?
Conversation
This reverts commit 3e435cc.
API Changes --- prev.txt 2025-01-07 15:13:32.983974846 +0000
+++ current.txt 2025-01-07 15:13:28.417968002 +0000
@@ -4752,6 +4752,16 @@
TYPES
+type AccessLogsConfig struct {
+ // Enable the transaction logs. Default: false
+ Enabled bool `json:"enabled"`
+
+ // This setting defaults to empty which prints the default log.
+ // Set this value to determine which fields will be printed in the access log.
+ Template []string `json:"template"`
+}
+ AccessLogsConfig defines the type of transactions logs printed to stdout
+
type AnalyticsConfigConfig struct {
// Set empty for a Self-Managed installation or `rpc` for multi-cloud.
Type string `json:"type"`
@@ -5204,6 +5214,10 @@
// If not set or left empty, it will default to `standard`.
LogFormat string `json:"log_format"`
+ // You can configure the transaction logs to be turned on
+ // If not set or left empty, it will default to 'false'
+ AccessLogs AccessLogsConfig `json:"access_logs"`
+
// Section for configuring OpenTracing support
// Deprecated: use OpenTelemetry instead.
Tracer Tracer `json:"tracing"`
@@ -11369,6 +11383,12 @@
CONSTANTS
const (
+ HashSha256 = crypto.HashSha256
+ HashMurmur32 = crypto.HashMurmur32
+ HashMurmur64 = crypto.HashMurmur64
+ HashMurmur128 = crypto.HashMurmur128
+)
+const (
// DefaultConn is the default connection type. Not analytics and Not cache.
DefaultConn = "default"
// CacheConn is the cache connection type
@@ -11376,26 +11396,26 @@
// AnalyticsConn is the analytics connection type
AnalyticsConn = "analytics"
)
-const B64JSONPrefix = "ey"
- `{"` in base64
-
-const MongoBsonIdLength = 24
VARIABLES
var (
+ HashStr = crypto.HashStr
+ HashKey = crypto.HashKey
+)
+var (
+ GenerateToken = crypto.GenerateToken
+ TokenHashAlgo = crypto.TokenHashAlgo
+ TokenID = crypto.TokenID
+ TokenOrg = crypto.TokenOrg
+)
+var (
// ErrRedisIsDown is returned when we can't communicate with redis
ErrRedisIsDown = errors.New("storage: Redis is either down or was not configured")
// ErrStorageConn is returned when we can't get a connection from the ConnectionHandler
ErrStorageConn = fmt.Errorf("Error trying to get singleton instance: %w", ErrRedisIsDown)
)
-var (
- HashSha256 = "sha256"
- HashMurmur32 = "murmur32"
- HashMurmur64 = "murmur64"
- HashMurmur128 = "murmur128"
-)
var ErrKeyNotFound = errors.New("key not found")
ErrKeyNotFound is a standard error for when a key is not found in the
storage engine
@@ -11404,19 +11424,9 @@
FUNCTIONS
-func GenerateToken(orgID, keyID, hashAlgorithm string) (string, error)
- If hashing algorithm is empty, use legacy key generation
-
-func HashKey(in string, hashKey bool) string
-func HashStr(in string, withAlg ...string) string
func NewConnector(connType string, conf config.Config) (model.Connector, error)
NewConnector creates a new storage connection.
-func TokenHashAlgo(token string) string
-func TokenID(token string) (id string, err error)
- TODO: add checks
-
-func TokenOrg(token string) string
TYPES
|
Failed to generate code suggestions for PR |
hashAlgorithm = DefaultHashAlgorithm | ||
} | ||
|
||
jsonToken := fmt.Sprintf(`{"org":"%s","id":"%s","h":"%s"}`, orgID, keyID, hashAlgorithm) |
Check failure
Code scanning / CodeQL
Potentially unsafe quoting Critical
JSON value
If this
JSON value
If this
JSON value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 days ago
To fix the problem, we need to ensure that any user-provided data embedded in the JSON string is properly escaped. This can be achieved by using a JSON library to construct the JSON string instead of manually formatting it. This approach ensures that all special characters are correctly escaped.
- Replace the manual JSON string construction with a call to
json.Marshal
to safely encode the data. - Update the
GenerateToken
function to usejson.Marshal
for creating the JSON token.
-
Copy modified lines R36-R45
@@ -35,4 +35,12 @@ | ||
|
||
jsonToken := fmt.Sprintf(`{"org":"%s","id":"%s","h":"%s"}`, orgID, keyID, hashAlgorithm) | ||
return base64.StdEncoding.EncodeToString([]byte(jsonToken)), err | ||
tokenData := map[string]string{ | ||
"org": orgID, | ||
"id": keyID, | ||
"h": hashAlgorithm, | ||
} | ||
jsonToken, err := json.Marshal(tokenData) | ||
if err != nil { | ||
return "", err | ||
} | ||
return base64.StdEncoding.EncodeToString(jsonToken), nil | ||
} |
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13199" title="TT-13199" target="_blank">TT-13199</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Implement upstream basic authentication as a gateway middleware</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>-</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 Implement upstream basic authentication as a middleware. Now users can configure upstream authentication using basic auth in - `upstream_auth.basic_auth` in Tyk classic API def. - `upstream.authentication.basicAuth` in Tyk OAS API def. ## Related Issue Parent: https://tyktech.atlassian.net/browse/TT-13186 Subtask: https://tyktech.atlassian.net/browse/TT-13199 ## 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** - Implemented upstream basic authentication as a middleware, allowing users to configure authentication using basic auth in Tyk API definitions. - Added `UpstreamAuth` and `UpstreamBasicAuth` structs to manage authentication details. - Integrated upstream authentication into the OAS upstream configuration and reverse proxy handling. - Developed `UpstreamBasicAuth` middleware to handle basic authentication for upstream connections. - Added comprehensive tests to verify the functionality of the `UpstreamBasicAuth` middleware. ___ ### **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_definitions.go</strong><dd><code>Add upstream authentication structures and methods</code> </dd></summary> <hr> apidef/api_definitions.go <li>Added <code>UpstreamAuth</code> struct to store upstream authentication <br>information.<br> <li> Introduced <code>UpstreamBasicAuth</code> struct for basic authentication details.<br> <li> Added methods to check if upstream authentication is enabled.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+19/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>upstream.go</strong><dd><code>Integrate upstream authentication into OAS upstream configuration</code></dd></summary> <hr> apidef/oas/upstream.go <li>Added <code>Authentication</code> field to <code>Upstream</code> struct for upstream <br>authentication configuration.<br> <li> Implemented methods to fill and extract authentication data.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+78/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>ctx.go</strong><dd><code>Add context management for upstream authentication</code> </dd></summary> <hr> ctx/ctx.go <li>Added constants for upstream authentication header and value.<br> <li> Implemented functions to set and get upstream authentication header <br>and value.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-600f5f552779994b15324fda108549eec7e7be30b1d8a1a16ee8344243e0cbc7">+35/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>api_loader.go</strong><dd><code>Append UpstreamBasicAuth middleware to chain</code> </dd></summary> <hr> gateway/api_loader.go - Appended `UpstreamBasicAuth` middleware to the middleware chain. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-cdf0b7f176c9d18e1a314b78ddefc2cb3a94b3de66f1f360174692c915734c68">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_upstream_basic_auth.go</strong><dd><code>Implement UpstreamBasicAuth middleware for basic authentication</code></dd></summary> <hr> gateway/mw_upstream_basic_auth.go <li>Implemented <code>UpstreamBasicAuth</code> middleware for basic authentication.<br> <li> Added logic to inject basic auth info into request context.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-ba603a8b249fdf72522258e825b7f9c64064203129c167795b206d66e9ebcda7">+49/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>reverse_proxy.go</strong><dd><code>Integrate upstream authentication into reverse proxy</code> </dd></summary> <hr> gateway/reverse_proxy.go <li>Added method to add authentication info to outgoing requests.<br> <li> Integrated upstream authentication into request handling.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+16/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_upstream_basic_auth_test.go</strong><dd><code>Add tests for UpstreamBasicAuth middleware functionality</code> </dd></summary> <hr> gateway/mw_upstream_basic_auth_test.go <li>Added tests for <code>UpstreamBasicAuth</code> middleware.<br> <li> Verified basic authentication with default and custom headers.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-15f78fac7fd4c8c0a1dcbd86ac6068e5a1a39f948f40afba6a6081e5f90f0ecd">+143/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>http.go</strong><dd><code>Add TestCases type for test management</code> </dd></summary> <hr> test/http.go - Introduced `TestCases` type for managing multiple test cases. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6596/files#diff-a5530e34c740ce6fe2efe8dda5a356463c450696b39b97b91228f1be2491e05e">+1/-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
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13243" title="TT-13243" target="_blank">TT-13243</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Gateway CI improvements pass</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> 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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></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-13243 --------- Co-authored-by: Tit Petric <[email protected]>
…p inputs (#6601) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13139" title="TT-13139" target="_blank">TT-13139</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Request times out in some cases when sending input via http inputs</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 --> --- Cherry-picked stream caching feature from this branch: #6538 Two new integration tests have been added to test `input http -> output http` scenario. See this issue for the details: https://tyktech.atlassian.net/browse/TT-13139 Closing the previous one: #6592 ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Implemented stream caching and garbage collection in the `StreamingMiddleware` to manage inactive streams and improve performance. - Added new fields and methods to handle stream activity and caching efficiently. - Introduced a garbage collection routine to periodically clean up inactive stream managers. - Added integration tests for single and multiple client scenarios, focusing on HTTP server input and WebSocket output. - Verified message distribution and handling in the new tests to ensure correct functionality. ___ ### **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_streaming.go</strong><dd><code>Implement stream caching and garbage collection in StreamingMiddleware</code></dd></summary> <hr> gateway/mw_streaming.go <li>Introduced stream caching and garbage collection for inactive streams.<br> <li> Added new fields to manage stream activity and cache.<br> <li> Implemented a garbage collection routine for stream managers.<br> <li> Updated stream manager creation to utilize caching. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6601/files#diff-6f565750150d990575c808f1ca8f38483160dc6edf05f1534cd0bedb27c2e6c8">+98/-20</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_streaming_test.go</strong><dd><code>Add integration tests for HTTP server streaming scenarios</code></dd></summary> <hr> gateway/mw_streaming_test.go <li>Added tests for single and multiple client streaming scenarios.<br> <li> Implemented test for HTTP server input and WebSocket output.<br> <li> Verified message distribution and handling in tests. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6601/files#diff-a0d1bd0196a741537a3c850e340225c8993e49d709c838af0f1b48b9893af1da">+137/-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 --------- Co-authored-by: Leonid Bugaev <[email protected]>
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13238" title="TT-13238" target="_blank">TT-13238</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Data model cleanup on gateway</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> 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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- ### **User description** https://tyktech.atlassian.net/browse/TT-13238 ___ ### **PR Type** enhancement, bug fix ___ ### **Description** - Replaced all references to the `apidef` package with the `model` package across multiple files, enhancing the code structure and consistency. - Introduced new `MergedAPI` and `MergedAPIList` types in the `model` package, providing methods for managing and filtering APIs. - Updated health check and RPC storage handler logic to use the new `model` types, improving code maintainability. - Refactored tests to align with the changes in data structures, ensuring continued test coverage and reliability. ___ ### **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>health_check.go</strong><dd><code>Update health check to use model package</code> </dd></summary> <hr> gateway/health_check.go <li>Replaced <code>apidef</code> package references with <code>model</code> package.<br> <li> Updated health check logic to use <code>model</code> types. </details> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Refactor RPC storage handler to use model package</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Replaced <code>apidef</code> package references with <code>model</code> package.<br> <li> Updated RPC storage handler functions to use <code>model</code> types. </details> </td> </tr> <tr> <td> <details> <summary><strong>merged_apis.go</strong><dd><code>Introduce MergedAPI and MergedAPIList types</code> </dd></summary> <hr> internal/model/merged_apis.go <li>Added new <code>MergedAPI</code> and <code>MergedAPIList</code> types.<br> <li> Implemented methods for managing and filtering merged APIs. </details> </td> </tr> <tr> <td> <details> <summary><strong>rpc.go</strong><dd><code>Refactor rpc.go to use model package</code> </dd></summary> <hr> internal/model/rpc.go <li>Changed package name from <code>apidef</code> to <code>model</code>.<br> <li> Updated <code>NodeData</code> struct to use <code>HostDetails</code> from <code>model</code>. </details> </td> </tr> <tr> <td> <details> <summary><strong>synchronization_forcer.go</strong><dd><code>Update synchronization logic to use model package</code> </dd></summary> <hr> rpc/synchronization_forcer.go <li>Replaced <code>apidef</code> package references with <code>model</code> package.<br> <li> Updated synchronization logic to use <code>model</code> types. </details> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>rpc_storage_handler_test.go</strong><dd><code>Update RPC storage handler tests for model package</code> </dd></summary> <hr> gateway/rpc_storage_handler_test.go <li>Replaced <code>apidef</code> package references with <code>model</code> package in tests.<br> <li> Updated test cases to align with new <code>model</code> types. </details> </td> </tr> <tr> <td> <details> <summary><strong>rpc_test.go</strong><dd><code>Refactor RPC tests to use model package</code> </dd></summary> <hr> gateway/rpc_test.go <li>Replaced <code>apidef</code> package references with <code>model</code> package in RPC tests.<br> <li> Adjusted test logic to accommodate changes in data structures. </details> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>health_check.go</strong><dd><code>Rename package to model in health_check.go</code> </dd></summary> <hr> internal/model/health_check.go - Changed package name from `apidef` to `model`. </details> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
…6609) ### **User description** https://tyktech.atlassian.net/browse/TT-13242 ___ ### **PR Type** enhancement ___ ### **Description** - Refactored the API definition handling by replacing `nestedApiDefinition` with `model.MergedAPI` across the codebase. - Removed the `nestedApiDefinitionList` struct and its associated methods, replacing them with `MergedAPIList`. - Updated test files to accommodate the new `MergedAPI` model, ensuring compatibility and correctness. - Introduced a new file `merged_apis.go` in the `internal/model` package to define `MergedAPI` and `MergedAPIList` structs with relevant methods. ___ ### **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_definition.go</strong><dd><code>Refactor API definition handling to use MergedAPI model</code> </dd></summary> <hr> gateway/api_definition.go <li>Replaced <code>nestedApiDefinition</code> with <code>model.MergedAPI</code>.<br> <li> Removed <code>nestedApiDefinitionList</code> and related methods.<br> <li> Updated function calls to use <code>model.MergedAPIList</code>.<br> <li> Adjusted filtering logic to use <code>Filter</code> method from <code>MergedAPIList</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+9/-54</a> </td> </tr> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Update tracing logic for MergedAPI integration</code> </dd></summary> <hr> gateway/tracing.go - Modified trace handler to use `model.MergedAPI`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+2/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>merged_apis.go</strong><dd><code>Introduce MergedAPI and MergedAPIList models</code> </dd></summary> <hr> internal/model/merged_apis.go <li>Added <code>MergedAPIList</code> and <code>MergedAPI</code> structs.<br> <li> Implemented <code>SetClassic</code> and <code>Filter</code> methods for <code>MergedAPIList</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-5a6d3f1445d1f144d0e47db75a06cbc03ee8cf8ce3d24cac78c8fcb99900e12c">+61/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>api_definition_test.go</strong><dd><code>Update tests for MergedAPI model integration</code> </dd></summary> <hr> gateway/api_definition_test.go <li>Updated tests to use <code>model.MergedAPIList</code>.<br> <li> Replaced <code>nestedApiDefinition</code> with <code>model.MergedAPI</code>.<br> <li> Adjusted test logic to use <code>Filter</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-2394daab6fdc5f8dc234699c80c0548947ee3d68d2e33858258d73a8b5eb6f44">+16/-15</a> </td> </tr> <tr> <td> <details> <summary><strong>coprocess_id_extractor_test.go</strong><dd><code>Modify coprocess ID extractor tests for MergedAPI</code> </dd></summary> <hr> gateway/coprocess_id_extractor_test.go - Updated test setup to use `model.MergedAPI`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-077f3e65a150ce6b3b1c2ebc67e0482f1a5446ff6264754607d86c4691984375">+2/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>policy_test.go</strong><dd><code>Update policy tests for MergedAPI model</code> </dd></summary> <hr> gateway/policy_test.go <li>Replaced <code>nestedApiDefinition</code> with <code>model.MergedAPI</code> in mock data.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-40d701767204255c38c7dd64939d6bb8df621640c4bddfe5f56080380476a18a">+2/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>testutil.go</strong><dd><code>Adjust test utilities for MergedAPI model</code> </dd></summary> <hr> gateway/testutil.go - Updated utility function to use `model.MergedAPI`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6609/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+2/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13258" title="TT-13258" target="_blank">TT-13258</a></summary> <br /> <table> <tr> <th>Summary</th> <td>CI tooling: workflow-lint</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>Ready for Testing</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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- Triggered by: titpetric ~~~ Updating actions/setup-python@v4 to actions/setup-python@v5 in .github/workflows/ci-tests.yml Updating actions/checkout@v2 to actions/checkout@v4 in .github/workflows/codeql-analysis.yml Updating actions/checkout@v3 to actions/checkout@v4 in .github/workflows/plugin-compiler-build.yml ~~~ JIRA: https://tyktech.atlassian.net/browse/TT-13258 Co-authored-by: titpetric <[email protected]>
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13266" title="TT-13266" target="_blank">TT-13266</a></summary> <br /> <table> <tr> <th>Summary</th> <td>CI: Fix python tests</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> Task </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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></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-13266 --------- Co-authored-by: Tit Petric <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12897" title="TT-12897" target="_blank">TT-12897</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[Security]Path-Based Permissions permissions in policies are not preserved when policies are 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><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></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- PR uses custom policies to combine several policies with access rights set. Since a `map` was in the path, user API for custom policies needed an extension to preserve policy ID order. The existing function returning a map didn't handle json decode errors properly and go semantics when looping over maps don't preserve this order, but it's random so tests would fail. Verified with `task stress`. Issue: https://tyktech.atlassian.net/browse/TT-12897 ___ ### **PR Type** Bug fix, Enhancement, Tests ___ ### **Description** - Enhanced policy application logic by introducing `MergeAllowedURLs` to merge allowed URLs efficiently. - Refactored `Store` to use a slice for policies, and introduced `StoreMap` for unordered policy storage. - Improved custom policy handling by adding `GetCustomPolicies` to preserve policy order. - Updated tests to ensure proper application of policies and added new tests for `MergeAllowedURLs`. - Updated Taskfile to include a new `stress` task for running stress tests. ___ ### **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>apply.go</strong><dd><code>Enhance policy application logic and logging</code> </dd></summary> <hr> internal/policy/apply.go <li>Introduced <code>MergeAllowedURLs</code> function to merge allowed URLs.<br> <li> Updated <code>Logger</code> function to return a <code>logrus.Entry</code>.<br> <li> Changed <code>session.CustomPolicies()</code> to <code>session.GetCustomPolicies()</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-59b92e9d31f142f1d99b746eb3ff7db4e26bf6c3044c9b87b58034a947ee04d1">+9/-17</a> </td> </tr> <tr> <td> <details> <summary><strong>store.go</strong><dd><code>Refactor Store to use slice for policies</code> </dd></summary> <hr> internal/policy/store.go <li>Changed <code>Store</code> to use a slice for policies.<br> <li> Updated methods to accommodate slice-based storage. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-13dec7bc453c9ff99550c83d2f86a017bbf7fb863584dc30603af15d29ef9d3d">+20/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>store_map.go</strong><dd><code>Add StoreMap for unordered policy storage</code> </dd></summary> <hr> internal/policy/store_map.go <li>Introduced <code>StoreMap</code> for unordered policy storage.<br> <li> Implemented methods for <code>StoreMap</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-24a7a95a1cf4f14b59a3475127dc45541357638d6949323255faeeb2ed657d27">+46/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>util.go</strong><dd><code>Introduce MergeAllowedURLs and remove unused functions</code> </dd></summary> <hr> internal/policy/util.go <li>Added <code>MergeAllowedURLs</code> function for merging URL access specs.<br> <li> Removed <code>copyAllowedURLs</code> and <code>contains</code> functions. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-0323c3da13f08a9ccd340ac04208d680856354fd566dffcad925fa6645639955">+46/-70</a> </td> </tr> <tr> <td> <details> <summary><strong>custom_policies.go</strong><dd><code>Enhance custom policies handling with order preservation</code> </dd></summary> <hr> user/custom_policies.go <li>Added <code>GetCustomPolicies</code> to preserve policy order.<br> <li> Updated <code>CustomPolicies</code> to use <code>GetCustomPolicies</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-911674993eef6c43a04edc0e90ea1f2e6d595792eef840d23b2e3deb1c8265c5">+21/-7</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>apply_test.go</strong><dd><code>Update tests for policy application</code> </dd></summary> <hr> internal/policy/apply_test.go <li>Added initialization of <code>policy.Service</code> in tests.<br> <li> Ensured <code>Apply</code> method is tested with <code>assert.NoError</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-5af7e299a6b0ce11e22f8aa4a01854b1151f4b54dccc68f0cd1cbedee5aed7c8">+29/-28</a> </td> </tr> <tr> <td> <details> <summary><strong>util_test.go</strong><dd><code>Add tests for MergeAllowedURLs function</code> </dd></summary> <hr> internal/policy/util_test.go - Added tests for `MergeAllowedURLs` function. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-c750a1b8a01d19dacf02ba7512b8e2b987bf8147cf3345a4374504d9d5b3840e">+64/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Update Taskfile with stress test task</code> </dd></summary> <hr> internal/policy/Taskfile.yml <li>Added <code>stress</code> task for running stress tests.<br> <li> Updated <code>default</code> task to include <code>test</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6597/files#diff-e0f19d4dd27acb397e19ccb080f3142a09f5978699da5843bfc71e7ffa4bb775">+16/-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 --------- Co-authored-by: Tit Petric <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13262" title="TT-13262" target="_blank">TT-13262</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Optimize plugin-compiler size</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> 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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This optimizes a few things: - more runner space for plugin compiler build - less .git with fetch-depth: 1 - remove /root/.cache/go-build from final image https://tyktech.atlassian.net/browse/TT-13262 ___ ### **PR Type** enhancement, configuration changes ___ ### **Description** - Optimized the GitHub Actions runner setup by reclaiming space and reducing the .git directory size. - Enhanced Dockerfile by adding cache mounts and updating environment variable syntax for better build efficiency. - Modified Taskfile to separate cache and no-cache build tasks, providing more flexibility in build processes. ___ ### **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>plugin-compiler-build.yml</strong><dd><code>Optimize GitHub Actions runner setup for plugin compiler</code> </dd></summary> <hr> .github/workflows/plugin-compiler-build.yml <li>Added step to reclaim runner space by removing unnecessary <br>directories.<br> <li> Updated checkout step to use fetch-depth: 1 for a smaller .git <br>directory.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6623/files#diff-f3a95a900eb0ac23af6314e9cdea29fa16af0a9bcb61793a83a32ff13d4c4e79">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>Dockerfile</strong><dd><code>Optimize Dockerfile caching and environment variable setup</code></dd></summary> <hr> ci/images/plugin-compiler/Dockerfile <li>Added cache mount for <code>/root/.cache/go-build</code> to optimize build process.<br> <li> Updated environment variable syntax for <code>GITHUB_SHA</code> and <code>GITHUB_TAG</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6623/files#diff-0ded1ed63ca128bd2d22721b0bc19dc85e440e4922164f465ac647917321971e">+8/-4</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Update Taskfile with separate cache and no-cache build tasks</code></dd></summary> <hr> ci/images/plugin-compiler/Taskfile.yml <li>Removed <code>--no-cache</code> from the default build task.<br> <li> Added a new <code>build-nocache</code> task for building without cache.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6623/files#diff-fbedc1249f009f549af073bd882db5736099acedfb0b711e42a22465d8f28d08">+7/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
…t when parameters are specified on endpoint groups (#6618) <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13092" title="TT-13092" target="_blank">TT-13092</a></summary> <br /> <table> <tr> <th>Summary</th> <td>BE: fix IMPORT and PATCH behaviour</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>-</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 --> enable validate request middleware when parameters are specified on endpoint groups, not just on per endpoint. <!-- Describe your changes in detail --> ## Related Issue\ Parent: https://tyktech.atlassian.net/browse/TT-8004 Subtask: https://tyktech.atlassian.net/browse/TT-13092 ## 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
…#6631) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13199" title="TT-13199" target="_blank">TT-13199</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Implement upstream basic authentication as a gateway middleware</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 Test</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 Replace client request header when it is conflicting with upstream basic auth header. ## Related Issue Parent ticket: https://tyktech.atlassian.net/browse/TT-13186 Subtask: https://tyktech.atlassian.net/browse/TT-13199 ## 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** - Changed the method for setting the authentication header from `Add` to `Set` in the `UpstreamBasicAuthProvider` to ensure that existing headers are replaced rather than duplicated. - This change addresses potential conflicts with client request headers by ensuring that the upstream basic authentication header is correctly set. ___ ### **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_upstream_basic_auth.go</strong><dd><code>Replace existing auth headers during upstream basic auth</code> </dd></summary> <hr> gateway/mw_upstream_basic_auth.go <li>Changed the method from <code>Add</code> to <code>Set</code> for setting the authentication <br>header.<br> <li> Ensures that existing headers are replaced instead of adding <br>duplicates.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6631/files#diff-ba603a8b249fdf72522258e825b7f9c64064203129c167795b206d66e9ebcda7">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
…6634) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13280" title="TT-13280" target="_blank">TT-13280</a></summary> <br /> <table> <tr> <th>Summary</th> <td>golangci-lint: fix output format to enable github actions to pick up on golangci-lint reported issues</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> 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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></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-13280 ___ ### **PR Type** enhancement, configuration changes ___ ### **Description** - Added a new Go package `apidef` with a `TestChange` struct and a `Copy` method. - Updated GitHub Actions workflow to modify `golangci-lint` output format, improving integration with GitHub PRs. ___ ### **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>bad.go</strong><dd><code>Add TestChange struct with Copy method in Go package</code> </dd></summary> <hr> apidef/bad.go <li>Added a new Go package <code>apidef</code>.<br> <li> Introduced a struct <code>TestChange</code> with a <code>sync.Mutex</code>.<br> <li> Implemented a <code>Copy</code> method for <code>TestChange</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6634/files#diff-62e2fc9df5eff27d39d10a8f2ef85be72987435733e4b1d040be9905fe805fa5">+9/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>ci-tests.yml</strong><dd><code>Update golangci-lint configuration in GitHub Actions</code> </dd></summary> <hr> .github/workflows/ci-tests.yml <li>Modified <code>golangci-lint</code> command to include <code>golangcilint.xml</code> in output <br>format.<br> <li> Adjusted linting commands for both pull request and push events.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6634/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+2/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
…edge (#6629) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13130" title="TT-13130" target="_blank">TT-13130</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Tyk Cloud: Panic appears when a user tried to deploy GW before Control Plane is in deployed state </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%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 Moved the logic of waitgroup to be handled internally in the gorpc library. GW only have to wait until done() ## Related Issue TT-13130 ## 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 ___ ### **Description** - Refactored the connection dialing logic in `rpc_client.go` to remove manual `sync.WaitGroup` handling, leveraging the internal wait group management provided by the `gorpc` library. - Updated the `gorpc` library to a newer version in `go.mod` and `go.sum`, ensuring compatibility and leveraging improvements. ___ ### **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>Refactor connection dialing wait group handling</code> </dd></summary> <hr> rpc/rpc_client.go <li>Removed manual handling of <code>sync.WaitGroup</code> for connection dialing.<br> <li> Utilized <code>clientSingleton.ConnectionDialingWG</code> for managing connection <br>readiness.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6629/files#diff-3b88914c99bb9418e44e6389ce73579843562e8900730b380d7fff2e95c51033">+1/-7</a> </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update gorpc library version in go.mod</code> </dd></summary> <hr> go.mod - Updated `gorpc` library version to latest. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6629/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update go.sum for new gorpc version</code> </dd></summary> <hr> go.sum - Updated checksums for new `gorpc` library version. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6629/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+8/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: sredny buitrago <[email protected]>
…ication with upstream (#6633) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13184" title="TT-13184" target="_blank">TT-13184</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Implement OAuth 2.0 Client Credentials for API Gateway Authentication with Upstream Server</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 This PR introduces the OAuth 2.0 Client Credentials Flow into the Tyk API Gateway to enhance security and ensure authenticated communication between the Gateway and the Upstream server. This PR introduces the OAuth 2.0 Client Credentials Flow within the Tyk API Gateway to enhance security for communication with the Upstream server. The Gateway will now authenticate itself by obtaining access tokens from the OAuth Authorization Server using the Client ID and Client Secret. Key changes include: Token management: caching, refreshing, and handling expiration. Secure storage of access tokens (hashed in Redis). Improved error handling for token failures and upstream errors. Configurable OAuth scopes and permissions in API definitions. This ensures that only authorized requests are forwarded to the Upstream server. <!-- 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, Tests ___ ### **Description** - Implemented OAuth 2.0 Client Credentials Flow for API Gateway authentication with upstream servers. - Added `UpstreamOAuth` and `ClientCredentials` structs to manage OAuth2 configurations. - Integrated OAuth2 support into existing `UpstreamAuth` structures and methods. - Developed `UpstreamOAuth` middleware to handle OAuth2 authentication, including token caching and retrieval. - Added tests for the new OAuth2 middleware to ensure functionality. - Updated schema definitions to include OAuth2 properties. - Refactored secret handling logic for better code organization. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>10 files</summary><table> <tr> <td> <details> <summary><strong>api_definitions.go</strong><dd><code>Add OAuth2 support to UpstreamAuth configuration</code> </dd></summary> <hr> apidef/api_definitions.go <li>Added OAuth2 configuration to <code>UpstreamAuth</code>.<br> <li> Introduced <code>UpstreamOAuth</code> and <code>ClientCredentials</code> structs.<br> <li> Updated <code>IsEnabled</code> method to include OAuth2.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+43/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>upstream.go</strong><dd><code>Integrate OAuth2 configuration in OAS UpstreamAuth</code> </dd></summary> <hr> apidef/oas/upstream.go <li>Added OAuth2 configuration to <code>UpstreamAuth</code>.<br> <li> Implemented <code>Fill</code> and <code>ExtractTo</code> methods for OAuth2.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+98/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>schema.go</strong><dd><code>Extend schema to include OAuth2 properties</code> </dd></summary> <hr> apidef/schema.go - Added OAuth2 properties to the schema. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-f8a37bb370eb6fe20063786a5e6ea3d85a5c91d8e289f0b3e045830c4d322095">+34/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>api_loader.go</strong><dd><code>Append UpstreamOAuth middleware to API loader</code> </dd></summary> <hr> gateway/api_loader.go - Appended `UpstreamOAuth` middleware to the chain. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-cdf0b7f176c9d18e1a314b78ddefc2cb3a94b3de66f1f360174692c915734c68">+1/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>event_system.go</strong><dd><code>Add EventUpstreamOAuthMeta for OAuth events</code> </dd></summary> <hr> gateway/event_system.go - Added `EventUpstreamOAuthMeta` for OAuth events. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-d56e22d4f1b8d2e91bb643d30e678a3819691a18bfae8506b10e0af8dc279a0e">+6/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Implement emitUpstreamOAuthEvent method</code> </dd></summary> <hr> gateway/middleware.go - Added `emitUpstreamOAuthEvent` method for OAuth events. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+15/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_oauth2_auth.go</strong><dd><code>Implement UpstreamOAuth middleware for OAuth2 authentication</code></dd></summary> <hr> gateway/mw_oauth2_auth.go <li>Implemented <code>UpstreamOAuth</code> middleware for OAuth2 authentication.<br> <li> Added token caching and retrieval logic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-a90347c3ad28f06a7bd1c5554ce63448774cb486cf4e9961af2323423ce8209d">+244/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_backup_handlers.go</strong><dd><code>Refactor secret padding logic</code> </dd></summary> <hr> gateway/rpc_backup_handlers.go - Refactored secret padding logic into `getPaddedSecret`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-69d9cb8df2bd4296a8e5e5d769009a09bd61ca65b7dbcbf29751af92698bd9ce">+5/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>server.go</strong><dd><code>Add UpstreamOAuthCache to Gateway struct</code> </dd></summary> <hr> gateway/server.go - Added `UpstreamOAuthCache` to `Gateway` struct. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-4652d1bf175a0be8f5e61ef7177c9666f23e077d8626b73ac9d13358fa8b525b">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Extend X-Tyk-UpstreamAuthentication with OAuth2 configuration</code></dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json - Added OAuth2 configuration to `X-Tyk-UpstreamAuthentication`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+38/-1</a> </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>1 files</summary><table> <tr> <td> <details> <summary><strong>mw_oauth2_auth_test.go</strong><dd><code>Add tests for UpstreamOAuth middleware</code> </dd></summary> <hr> gateway/mw_oauth2_auth_test.go - Added tests for `UpstreamOAuth` middleware. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6633/files#diff-4bbf88199c7bb23cea3a299d25c6074d7c61c481a48e51b3fa7d5f999ab581a1">+127/-0</a> </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
…g issue (#6635) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12897" title="TT-12897" target="_blank">TT-12897</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[Security]Path-Based Permissions permissions in policies are not preserved when policies are 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><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%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 --> --- Subtask: https://tyktech.atlassian.net/browse/TT-13284 Parent: https://tyktech.atlassian.net/browse/TT-12897 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Fixed a bug in `applyPartitions` function to ensure `rights` map is filled with known APIs, ensuring policies with ACL rights are honored even if not first. - Improved merging logic for `RestrictedTypes`, `AllowedTypes`, and `FieldAccessRights` to handle empty cases and intersections correctly. - Added test cases to verify the correct application of ACL and rate limits from custom policies, ensuring the order of policies does not affect the outcome. ___ ### **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>apply.go</strong><dd><code>Fix policy merging and ordering issues in partitioned policies</code></dd></summary> <hr> internal/policy/apply.go <li>Ensure <code>rights</code> map is filled with known APIs to honor policies.<br> <li> Modify merging logic for <code>RestrictedTypes</code>, <code>AllowedTypes</code>, and <br><code>FieldAccessRights</code>.<br> <li> Fix ordering issue in policy application by using previously seen <br>rights.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6635/files#diff-59b92e9d31f142f1d99b746eb3ff7db4e26bf6c3044c9b87b58034a947ee04d1">+41/-21</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>apply_test.go</strong><dd><code>Add test cases for ACL and rate limit application</code> </dd></summary> <hr> internal/policy/apply_test.go <li>Add test cases for applying ACL from custom policies.<br> <li> Verify correct application of rate limits and access rights.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6635/files#diff-5af7e299a6b0ce11e22f8aa4a01854b1151f4b54dccc68f0cd1cbedee5aed7c8">+47/-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 Co-authored-by: Tit Petric <[email protected]>
…ies: false (#6640) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12814" title="TT-12814" target="_blank">TT-12814</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Make OAS JSON schema more flexible (do not enforce additionalProperties)</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 --> --- https://tyktech.atlassian.net/browse/TT-12814 ___ ### **PR Type** Enhancement ___ ### **Description** - Removed `additionalProperties: false` from multiple object definitions in the JSON schema to enhance flexibility. - This change allows additional properties in the schema, making it more compatible and less strict. ___ ### **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>x-tyk-api-gateway.json</strong><dd><code>Relax schema strictness by removing `additionalProperties: false`</code></dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <li>Removed <code>additionalProperties: false</code> from multiple object definitions.<br> <li> Enhanced flexibility of the JSON schema by allowing additional <br>properties.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6640/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+1/-73</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information Co-authored-by: Tit Petric <[email protected]>
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13130" title="TT-13130" target="_blank">TT-13130</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Tyk Cloud: Panic appears when a user tried to deploy GW before Control Plane is in deployed state </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%20Re_open%20ORDER%20BY%20created%20DESC" title="Re_open">Re_open</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></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 TT-13130 ## 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 ___ ### **Description** - Updated the `gorpc` library to a newer version in `go.mod` and `go.sum`. - Modified the RPC client connection handling by replacing `ConnectionDialingWG.Wait()` with `WaitForConnection()`, improving the connection logic. ___ ### **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>Update connection handling in RPC client</code> </dd></summary> <hr> rpc/rpc_client.go <li>Replaced <code>ConnectionDialingWG.Wait()</code> with <code>WaitForConnection()</code>.<br> <li> Improved connection handling logic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6644/files#diff-3b88914c99bb9418e44e6389ce73579843562e8900730b380d7fff2e95c51033">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update gorpc dependency version in go.mod</code> </dd></summary> <hr> go.mod - Updated `gorpc` dependency version. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6644/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update go.sum with new gorpc checksums</code> </dd></summary> <hr> go.sum - Added new checksum entries for updated `gorpc` version. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6644/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+2/-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 --------- Co-authored-by: sredny buitrago <[email protected]>
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13184" title="TT-13184" target="_blank">TT-13184</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Implement OAuth 2.0 Client Credentials for API Gateway Authentication with Upstream Server</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>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
…6651) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12990" title="TT-12990" target="_blank">TT-12990</a></summary> <br /> <table> <tr> <th>Summary</th> <td>API endpoint upstream rate limiting is not considering endpoint method</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 fixes a bug where upstream endpoint rate limit middleware doesn't consider endpoint method while generating redis key ## Related Issue https://tyktech.atlassian.net/browse/TT-12990 ## 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** - Fixed a bug in the rate limit middleware where the HTTP method was not considered in the rate limit key generation, potentially causing incorrect rate limiting. - Enhanced the rate limit tests to include HTTP method consideration, ensuring that rate limits are correctly applied per method. - Refactored test functions to support method-specific rate limits and added a regression test to verify the fix. ___ ### **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>mw_api_rate_limit.go</strong><dd><code>Include HTTP method in rate limit key generation</code> </dd></summary> <hr> gateway/mw_api_rate_limit.go <li>Added <code>fmt</code> package import.<br> <li> Modified rate limit key generation to include HTTP method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6651/files#diff-46326b04f936c839922e970db5c2924156cc797070948f3dc9c589d04661d6d2">+2/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>per_api_limit_test.go</strong><dd><code>Enhance rate limit tests to include HTTP method</code> </dd></summary> <hr> tests/rate/per_api_limit_test.go <li>Added HTTP method consideration in rate limit tests.<br> <li> Refactored test functions to support method-specific rate limits.<br> <li> Added regression test for per-method rate limiting.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6651/files#diff-81981a7ab606e7274913a4cf3030c12ef9d6856f2862420b6b069909f8175bd7">+61/-24</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** Extracts streaming middleware into internal/middleware/stream; Implements a number of interfaces to cover gateway/base middleware Implements `wrappedMiddleware` to allow middlewares with less coupling. I tried to update couplings along as I went, it's passing `go build` and `go test -c`. ___ ### **PR Type** enhancement, tests ___ ### **Description** - Refactored streaming middleware by introducing a new `Manager` for handling streams and updated the `StreamingMiddleware` to use this new structure. - Replaced various `apidef` types with `model` types across multiple files to improve modularity and reduce coupling. - Introduced `WrapMiddleware` functionality to allow middleware wrapping with less coupling. - Updated test cases to align with the new streaming middleware implementation and the use of the `model` package. - Added new interfaces in the `model` package to define common behaviors for Gateway and Middleware components. - Updated method calls to use the new `ReplaceTykVariables` function for consistency. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>22 files</summary><table> <tr> <td> <details> <summary><strong>api_loader.go</strong><dd><code>Integrate new streaming middleware and wrap functionality</code></dd></summary> <hr> gateway/api_loader.go <li>Added import for <code>internal/middleware/stream</code>.<br> <li> Replaced <code>StreamingMiddleware</code> with a new streaming middleware <br>implementation.<br> <li> Introduced <code>WrapMiddleware</code> for middleware wrapping. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-cdf0b7f176c9d18e1a314b78ddefc2cb3a94b3de66f1f360174692c915734c68">+9/-4</a> </td> </tr> <tr> <td> <details> <summary><strong>gateway.go</strong><dd><code>Update Gateway interface implementation</code> </dd></summary> <hr> gateway/gateway.go - Updated interface implementation to use `model.Gateway`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-17cb8b37eda9018fe1c6cdb5f96b3fc948fc8ba49bc516987b8269576db9fcd4">+2/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>health_check.go</strong><dd><code>Use model package for health check items</code> </dd></summary> <hr> gateway/health_check.go - Replaced `apidef.HealthCheckItem` with `model.HealthCheckItem`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-978a2d1427d9209765e541618af10683944c6396df1a6fb8b5221e4f16658a6a">+31/-30</a> </td> </tr> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Update TykMiddleware interface and constants</code> </dd></summary> <hr> gateway/middleware.go <li>Added <code>GetSpec</code> method to <code>TykMiddleware</code> interface.<br> <li> Changed constant <code>mwStatusRespond</code> to use <code>middleware.StatusRespond</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+10/-12</a> </td> </tr> <tr> <td> <details> <summary><strong>middleware_wrap.go</strong><dd><code>Introduce middleware wrapping functionality</code> </dd></summary> <hr> gateway/middleware_wrap.go <li>Introduced <code>wrapMiddleware</code> struct for middleware wrapping.<br> <li> Implemented <code>WrapMiddleware</code> function. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-1da43bd02220acad12bce8d8c5600b4acfee3c40f90c53825802747004c9fb0a">+51/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_auth_key.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/mw_auth_key.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-aeba053023a54c723dd9f83837e29ca0b2d9a212bc98fa6ad4bbb062669a1cf0">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_graphql.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/mw_graphql.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-c46e0f07348c8f519e5912f4394f048f43c1e3fb5063c27245272c8f645b4cab">+2/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_modify_headers.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/mw_modify_headers.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-061b7bd9b76abe91c660494762ad868c6cc6135fdf1e97465377df39e1eeac8e">+2/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_persist_graphql_operation.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/mw_persist_graphql_operation.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-ace7a721ebc7c7d61ce5a9f01b906cfe617aedf48364f08f40ccfde670685ca6">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_rate_limiting.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/mw_rate_limiting.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-4bf8ae01ccab67bb786468f793f6bb4324c8f6b950b0e98e203effebe763a630">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_transform.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/mw_transform.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-d7a3cdc3dcabd415dffee6c044ea27dbe877add0ddc42471e10943125693fc12">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_url_rewrite.go</strong><dd><code>Rename and document ReplaceTykVariables function</code> </dd></summary> <hr> gateway/mw_url_rewrite.go <li>Renamed <code>replaceTykVariables</code> to <code>ReplaceTykVariables</code> and added <br>documentation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-84a6a5c810334aaa8702669f2aebf0284f116d83e8a55ec9d1d5b8bae87f1be6">+6/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>res_handler_header_injector.go</strong><dd><code>Update variable replacement method call</code> </dd></summary> <hr> gateway/res_handler_header_injector.go - Updated method call to `ReplaceTykVariables`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-db30365a54a06d3fbf9f4aad3fe133de85dbb75fae2177d84ede3214407f31ca">+3/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Use model package for RPC storage handler types</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Replaced <code>apidef</code> types with <code>model</code> types for RPC storage handling. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-8875f75b602664c44b62b67a4da41d748124ad270573a44db4ec977ee5d68021">+24/-25</a> </td> </tr> <tr> <td> <details> <summary><strong>const.go</strong><dd><code>Add StatusRespond constant for middleware</code> </dd></summary> <hr> internal/middleware/const.go - Added constant `StatusRespond` for middleware processing. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-8a6d0644eb989a86bc580dcdcee0ac94316c7883c7516d3e11e55c66a833965a">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>stream_manager.go</strong><dd><code>Introduce Manager for stream management</code> </dd></summary> <hr> internal/middleware/stream/stream_manager.go <li>Introduced <code>Manager</code> struct for stream management.<br> <li> Implemented stream creation and removal functionalities. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-ed75e572397b02c39d91dcca90c9bfd84f527fa4b5522c0a08f7ee9e44585ef5">+133/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>streaming_middleware.go</strong><dd><code>Refactor StreamingMiddleware with new Manager</code> </dd></summary> <hr> internal/middleware/stream/streaming_middleware.go <li>Refactored <code>StreamingMiddleware</code> to use new <code>Manager</code>.<br> <li> Updated logging and stream management logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-99c21a93ded6b6c0fcfba1af1b9a2189df150da067ecdb08cf33b1aced9242e3">+62/-133</a></td> </tr> <tr> <td> <details> <summary><strong>health_check.go</strong><dd><code>Rename package to model</code> </dd></summary> <hr> internal/model/health_check.go - Renamed package from `apidef` to `model`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-44e3299d864d891747443f0c999d95e7d19410b67817fdfd1c5840c616fdcd64">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>interfaces.go</strong><dd><code>Add interfaces for Gateway and Middleware</code> </dd></summary> <hr> internal/model/interfaces.go - Introduced interfaces for Gateway and Middleware. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-43ba6dd4a8d193850dea32e8af5c361470cd62bfa390c580a39f7142a56bd391">+66/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc.go</strong><dd><code>Move RPC types to model package</code> </dd></summary> <hr> internal/model/rpc.go - Moved RPC-related types to `model` package. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-a9cdd23914e87a8671ec07c0a83257f8bbd12dc8939c5014cf368b796bf8ade4">+2/-6</a> </td> </tr> <tr> <td> <details> <summary><strong>apply.go</strong><dd><code>Use model.PolicyProvider in Service struct</code> </dd></summary> <hr> internal/policy/apply.go - Updated `Service` struct to use `model.PolicyProvider`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-59b92e9d31f142f1d99b746eb3ff7db4e26bf6c3044c9b87b58034a947ee04d1">+3/-10</a> </td> </tr> <tr> <td> <details> <summary><strong>synchronization_forcer.go</strong><dd><code>Use model package for GroupLoginRequest</code> </dd></summary> <hr> rpc/synchronization_forcer.go - Replaced `apidef.GroupLoginRequest` with `model.GroupLoginRequest`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-97417011065a292f63eeb6fb031afbcfffa75cb3fc7073f8431add277b250c98">+2/-2</a> </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3 files</summary><table> <tr> <td> <details> <summary><strong>mw_streaming_test.go</strong><dd><code>Update streaming test cases to use new package</code> </dd></summary> <hr> gateway/mw_streaming_test.go <li>Updated test cases to use <code>stream</code> package for streaming <br>functionalities. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-a0d1bd0196a741537a3c850e340225c8993e49d709c838af0f1b48b9893af1da">+8/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler_test.go</strong><dd><code>Update RPC storage handler tests to use model package</code> </dd></summary> <hr> gateway/rpc_storage_handler_test.go - Updated tests to use `model` package for RPC storage handler. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-69de989a02b3bc32ae376c514ee84633c609200db22385c0e16c361d6ea74cd6">+20/-23</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_test.go</strong><dd><code>Update RPC tests to use model package</code> </dd></summary> <hr> gateway/rpc_test.go - Updated RPC test cases to use `model` package for API definitions. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6593/files#diff-68d6d05f22702a24741c6e233a2cb1f227dacf0309d7d94f651038ac7b90f49e">+5/-5</a> </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]> Co-authored-by: Leonid Bugaev <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12702" title="TT-12702" target="_blank">TT-12702</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Regression in Gateway handling larger payloads (speed and memory usage)</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%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></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 reverts https://github.com/TykTechnologies/tyk/pull/5716/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01bL518 - causing high memory consumption when handling large response payloads even when detailed recording is not enabled. ## Related Issue https://tyktech.atlassian.net/browse/TT-12702 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested ### Benchmarks #### Master ``` goos: darwin goarch: arm64 pkg: github.com/TykTechnologies/tyk/gateway BenchmarkLargeResponsePayload-12 1 1733155792 ns/op 6423694584 B/op 170266 allocs/op BenchmarkLargeResponsePayload-12 1 1045400334 ns/op 6423182768 B/op 162467 allocs/op BenchmarkLargeResponsePayload-12 2 1056169500 ns/op 6150103228 B/op 81801 allocs/op BenchmarkLargeResponsePayload-12 2 582477250 ns/op 6150050508 B/op 81405 allocs/op BenchmarkLargeResponsePayload-12 2 544049688 ns/op 6150056996 B/op 81414 allocs/op BenchmarkLargeResponsePayload-12 3 406709014 ns/op 6059011672 B/op 54435 allocs/op BenchmarkLargeResponsePayload-12 3 408792639 ns/op 6059018274 B/op 54438 allocs/op BenchmarkLargeResponsePayload-12 3 409801597 ns/op 6059023178 B/op 54441 allocs/op BenchmarkLargeResponsePayload-12 3 432873930 ns/op 6059030749 B/op 54524 allocs/op BenchmarkLargeResponsePayload-12 3 419910931 ns/op 6059010736 B/op 54438 allocs/op BenchmarkLargeResponsePayload-12 3 441840542 ns/op 6059018002 B/op 54440 allocs/op BenchmarkLargeResponsePayload-12 3 404177667 ns/op 6059027448 B/op 54449 allocs/op BenchmarkLargeResponsePayload-12 3 408969153 ns/op 6059020826 B/op 54435 allocs/op BenchmarkLargeResponsePayload-12 3 442027917 ns/op 6059023066 B/op 54480 allocs/op BenchmarkLargeResponsePayload-12 3 425106861 ns/op 6059018101 B/op 54432 allocs/op BenchmarkLargeResponsePayload-12 3 532385903 ns/op 6059022578 B/op 54506 allocs/op BenchmarkLargeResponsePayload-12 3 426969986 ns/op 6059023218 B/op 54440 allocs/op BenchmarkLargeResponsePayload-12 3 413833320 ns/op 6059027762 B/op 54450 allocs/op BenchmarkLargeResponsePayload-12 3 451929514 ns/op 6237968360 B/op 54447 allocs/op BenchmarkLargeResponsePayload-12 3 397716597 ns/op 6059025890 B/op 54445 allocs/op PASS ok github.com/TykTechnologies/tyk/gateway 49.175s ``` #### PR branch ``` goos: darwin goarch: arm64 pkg: github.com/TykTechnologies/tyk/gateway BenchmarkLargeResponsePayload-12 1 1356068083 ns/op 4557237568 B/op 169981 allocs/op BenchmarkLargeResponsePayload-12 2 742401458 ns/op 4283642056 B/op 81542 allocs/op BenchmarkLargeResponsePayload-12 4 317117062 ns/op 4147070728 B/op 40949 allocs/op BenchmarkLargeResponsePayload-12 4 298472167 ns/op 4147074542 B/op 40935 allocs/op BenchmarkLargeResponsePayload-12 4 294437177 ns/op 4147072386 B/op 40935 allocs/op BenchmarkLargeResponsePayload-12 4 309100688 ns/op 4147068268 B/op 40904 allocs/op BenchmarkLargeResponsePayload-12 4 297184354 ns/op 4147070226 B/op 40925 allocs/op BenchmarkLargeResponsePayload-12 3 486690125 ns/op 4192594322 B/op 54475 allocs/op BenchmarkLargeResponsePayload-12 4 294243364 ns/op 4147069956 B/op 40900 allocs/op BenchmarkLargeResponsePayload-12 4 297884250 ns/op 4147069348 B/op 40902 allocs/op BenchmarkLargeResponsePayload-12 4 278709729 ns/op 4147068876 B/op 40887 allocs/op BenchmarkLargeResponsePayload-12 4 292365864 ns/op 4147069428 B/op 40895 allocs/op BenchmarkLargeResponsePayload-12 4 313283802 ns/op 4147065954 B/op 40902 allocs/op BenchmarkLargeResponsePayload-12 4 314389510 ns/op 4147065562 B/op 40907 allocs/op BenchmarkLargeResponsePayload-12 4 302698010 ns/op 4147069650 B/op 40905 allocs/op BenchmarkLargeResponsePayload-12 4 303036000 ns/op 4147068274 B/op 40929 allocs/op BenchmarkLargeResponsePayload-12 4 298318542 ns/op 4147065250 B/op 40897 allocs/op BenchmarkLargeResponsePayload-12 3 358369500 ns/op 4192571469 B/op 54383 allocs/op BenchmarkLargeResponsePayload-12 3 400718208 ns/op 4192586336 B/op 54380 allocs/op BenchmarkLargeResponsePayload-12 3 348493847 ns/op 4192581192 B/op 54387 allocs/op PASS ok github.com/TykTechnologies/tyk/gateway 55.063s ``` #### Benchstat ``` benchstat master.txt pr.txt goos: darwin goarch: arm64 pkg: github.com/TykTechnologies/tyk/gateway │ master.txt │ pr.txt │ │ sec/op │ sec/op vs base │ LargeResponsePayload-12 429.9m ± 24% 306.1m ± 14% -28.81% (p=0.000 n=20) │ master.txt │ pr.txt │ │ B/op │ B/op vs base │ LargeResponsePayload-12 5.643Gi ± 2% 3.862Gi ± 1% -31.56% (p=0.000 n=20) │ master.txt │ pr.txt │ │ allocs/op │ allocs/op vs base │ LargeResponsePayload-12 54.45k ± 0% 40.93k ± 33% -24.83% (p=0.000 n=20) ``` ## 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** - Reverted the `WrappedServeHTTP` function call to use the `recordDetail` function, addressing a regression issue in handling larger payloads. - This change is aimed at improving speed and memory usage in the Gateway. ___ ### **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>Revert WrappedServeHTTP to use recordDetail function</code> </dd></summary> <hr> gateway/reverse_proxy.go <li>Reverted the <code>WrappedServeHTTP</code> function call to use <code>recordDetail</code>.<br> <li> Modified the argument passed to <code>WrappedServeHTTP</code> for improved request <br>handling.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6654/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
…ot delete the Key (#6473) ### **User description** TASK: https://tyktech.atlassian.net/browse/TT-12710 Fixed case in which trying to apply a non-existing policy error would be swallowed when having partitioned keys. <!-- 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** - Fixed a bug where errors for non-existing policies were ignored if multiple policies were processed, ensuring that an error is returned immediately. - Improved error handling in the `Apply` method of the `Service` to prevent silent failures when policies are missing. ___ ### **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>apply.go</strong><dd><code>Fix error handling for non-existing policies in Apply method</code></dd></summary> <hr> internal/policy/apply.go <li>Removed logic that continued processing policies when a non-existing <br>policy was encountered.<br> <li> Ensured that an error is returned immediately if a policy is not <br>found.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6473/files#diff-59b92e9d31f142f1d99b746eb3ff7db4e26bf6c3044c9b87b58034a947ee04d1">+0/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
…kes it (#6744) <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13155" title="TT-13155" target="_blank">TT-13155</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[Regression] Gateway Debug logs starting v5.3 only logs AccessRightsCheck for most of the middlewares</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%20'24Bugsmash%20ORDER%20BY%20created%20DESC" title="'24Bugsmash">'24Bugsmash</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%202025lts%20ORDER%20BY%20created%20DESC" title="2025lts">2025lts</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</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></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- ### **PR Type** Enhancement PR: - implements per-middleware basemiddleware copy behaviour - reverts the logger+mutex on base middleware - touches coprocess/ to better handle grpc server startup, shutdown, conflicts on static port number - not to swallow errors when net.Listener fails ___ ### **Description** - Refactored the `BaseMiddleware` initialization process by introducing a `NewBaseMiddleware` function, encapsulating the creation logic. - Added a `Copy` method to `BaseMiddleware` to create scoped copies with a duplicated logger, ensuring middleware-specific logging. - Updated all middleware initialization in `gateway/api_loader.go` to use `baseMid.Copy()` for better isolation and logging scope. - Enhanced code readability and maintainability by centralizing `BaseMiddleware` creation logic and ensuring proper separation of concerns. --------- Co-authored-by: Tit Petric <[email protected]>
…pulled from rpc (#6740) ### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description The Oauth client was not being cached in the local redis when the gateway was running as an edge in an MDCB setup. This PR then: - Ensures that the first time that the oauthclient is pulled from RPC then we cache it in redis - Refactor code of the MDCB storage into multiple smaller functions so is eaasy to read the code and test - created mock for the storage handler interface...later we should remove all mentions to DummyStorage and use the mock instead - Created tests for the mdcb storage - Certificates caching doesnt works in the same way, as they depend on the certificate manager and secret set to encode the content ## 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 - Run MDCB setup with synchroniser disabled - Created api and policy via dashboard. - Protect the api using oauth 2.0 - Created an oauth client via dashboard api - Create a token in the edge node using the created oauth client - use the token to consume the api in that edge node - shut down mdcb - attempt to generate another token using the edge node - At this point you should be allowed to create that new token and use it against the api ## 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** - Refactored the `GetKey` method to separate local and RPC retrieval logic, improving maintainability. - Introduced caching mechanisms for OAuth clients and certificates, ensuring resources pulled from RPC are stored locally. - Added constants for resource types to improve code readability and maintainability. - Renamed callback function for certificate pull consistency. - Added extensive unit tests for new caching and retrieval logic, improving test coverage. - Generated a mock for the `Handler` interface using GoMock to facilitate isolated testing of storage interactions. ___ ### **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>manager.go</strong><dd><code>Rename callback function for certificate pull consistency</code></dd></summary> <hr> certs/manager.go <li>Renamed <code>CallbackonPullfromRPC</code> to <code>CallbackOnPullCertificateFromRPC</code> for <br>consistency.<br> <li> Updated the initialization of <code>mdcbStorage</code> with the renamed callback.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6740/files#diff-78e768b2719ac9f70038499f847de2843db20d8ca21a963ea63b82010d711039">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>mdcb_storage.go</strong><dd><code>Refactor key retrieval and add caching mechanisms</code> </dd></summary> <hr> storage/mdcb_storage.go <li>Added constants for resource types (<code>resourceOauthClient</code>, <br><code>resourceCertificate</code>, etc.).<br> <li> Refactored <code>GetKey</code> to separate local and RPC retrieval logic.<br> <li> Introduced caching mechanisms for OAuth clients and certificates.<br> <li> Added helper methods like <code>getFromRPCAndCache</code>, <code>cacheCertificate</code>, and <br><code>cacheOAuthClient</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6740/files#diff-c5739d542a422343ec22585ffa5e4ad7e2e91358db018a157dc23cb5096c04d2">+74/-32</a> </td> </tr> <tr> <td> <details> <summary><strong>storage.go</strong><dd><code>Add GoMock directive for Handler interface</code> </dd></summary> <hr> storage/storage.go <li>Added GoMock generation directive for the <code>Handler</code> interface.<br> <li> Prepared the file for mock generation to support testing.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6740/files#diff-2a93e444b612bd9853c32889fb82c4041760536f84356bb0db04738c19b62dde">+2/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>mdcb_storage_test.go</strong><dd><code>Add unit tests for caching and retrieval logic</code> </dd></summary> <hr> storage/mdcb_storage_test.go <li>Added test setup utility for mocking dependencies.<br> <li> Implemented unit tests for new caching and retrieval methods.<br> <li> Enhanced test coverage for resource type processing and error <br>handling.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6740/files#diff-6a40b704ea7dc3b61069eebd5d56464a66bb1c61095909aa9cc5e423c5c88422">+323/-4</a> </td> </tr> <tr> <td> <details> <summary><strong>storage.go</strong><dd><code>Add GoMock-generated mock for Handler interface</code> </dd></summary> <hr> storage/mock/storage.go <li>Added a generated mock for the <code>Handler</code> interface using GoMock.<br> <li> Enables testing of storage interactions in isolation.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6740/files#diff-0e75f439d0385d9272ea3afa9fc465dcae08554f19ff821e0743ad096325df40">+501/-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 --------- Co-authored-by: sredny buitrago <[email protected]> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Matias <[email protected]> Co-authored-by: Mladen Kolavcic <[email protected]>
### **User description** PR for https://tyktech.atlassian.net/browse/TT-13715 With this PR we upgrade Bento to v1.4.0 from v1.2.0(github.com/TykTechnologies/bento v0.0.0-20241108123210-93d1717c7171). We were maintaining our own fork to cherry-pick some commits from Bento's master branch. The changes released in v1.4.0 and Platform team has fixed this issue and upgrading v1.4.0 is unblocked. https://tyktech.atlassian.net/browse/TT-13518 ___ ### **PR Type** enhancement, dependencies ___ ### **Description** - Upgraded `github.com/warpstreamlabs/bento` from v1.2.0 to v1.4.0, removing the need for a custom fork. - Updated multiple dependencies to their latest versions, ensuring compatibility and leveraging new features or fixes. - Adjusted indirect dependencies and their checksums to align with the upgraded modules. - Removed the `replace` directive for the `bento` fork, simplifying dependency management. ___ ### **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>Upgrade Bento and other dependencies to newer versions.</code> </dd></summary> <hr> go.mod <li>Upgraded <code>github.com/warpstreamlabs/bento</code> from v1.2.0 to v1.4.0.<br> <li> Updated various dependencies to newer versions, including <br><code>golang.org/x/crypto</code>, <code>golang.org/x/net</code>, <code>google.golang.org/grpc</code>, and <br>others.<br> <li> Adjusted indirect dependencies to align with the new versions.<br> <li> Removed the <code>replace</code> directive for the <code>bento</code> fork.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6762/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+30/-32</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update dependency checksums for upgraded modules.</code> </dd></summary> <hr> go.sum <li>Updated checksums for dependencies upgraded in <code>go.mod</code>.<br> <li> Added new checksums for updated indirect dependencies.<br> <li> Removed checksums for deprecated or replaced dependencies.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6762/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+68/-67</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Matias <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13608" title="TT-13608" target="_blank">TT-13608</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Issues with custom scalar in query variable</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%20'24Bugsmash%20ORDER%20BY%20created%20DESC" title="'24Bugsmash">'24Bugsmash</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></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This PR updates graphql-go-tools dependency. Related PR: TykTechnologies/graphql-go-tools#434 ___ ### **PR Type** Bug fix, Dependencies ___ ### **Description** - Updated the `graphql-go-tools` dependency in `go.mod` to a newer version (`v1.6.2-0.20241212110213-7724a3b64bb2`). - Updated corresponding hash values in `go.sum` to reflect the new dependency version. - This update addresses issues with custom scalar handling in query variables. ___ ### **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 `graphql-go-tools` dependency version in `go.mod`.</code></dd></summary> <hr> go.mod <li>Updated the <code>graphql-go-tools</code> dependency to a newer version.<br> <li> Changed the version from <code>v1.6.2-0.20240926103032-6eca9f4b5e30</code> to <br><code>v1.6.2-0.20241212110213-7724a3b64bb2</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6766/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update dependency hash values in `go.sum`.</code> </dd></summary> <hr> go.sum <li>Updated hash values for the <code>graphql-go-tools</code> dependency to match the <br>new version.<br> <li> Replaced old hash values with those corresponding to the updated <br>version.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6766/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+2/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
…c4 (#6750) ### **User description** Adds a testing dockerfile to run gateway in a python env. Since introducing distroless, the package manager to install python wasn't available. The dockerfile solution is to add gateway to an image containing python. ```Dockerfile ARG BASE_IMAGE FROM ${BASE_IMAGE} AS base FROM python:3.11-bookworm COPY --from=base /opt/tyk-gateway/ /opt/tyk-gateway/ RUN pip install setuptools && pip install google && pip install 'protobuf==4.24.4' EXPOSE 8080 80 443 ENV PYTHON_VERSION=3.11 ENV PORT=8080 WORKDIR /opt/tyk-gateway/ ENTRYPOINT ["/opt/tyk-gateway/tyk" ] CMD [ "--conf=/opt/tyk-gateway/tyk.conf" ] ``` ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Introduced a new Dockerfile to create a Python environment for Tyk Gateway, enabling the installation of Python dependencies and running Tyk Gateway with a configuration file. - Added a Taskfile to automate the building and testing of the Dockerfile, including tasks to verify Python and Tyk Gateway versions. - Supported testing with multiple Tyk Gateway versions (5.3.0 and 5.3.6-rc4) to ensure compatibility. ___ ### **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>Dockerfile</strong><dd><code>Add Dockerfile for testing Tyk Gateway with Python environment</code></dd></summary> <hr> docs/plugins/python/Dockerfile <li>Added a new Dockerfile to create a Python environment for Tyk Gateway.<br> <li> Configured the Dockerfile to install Python dependencies such as <br><code>setuptools</code>, <code>google</code>, and <code>protobuf</code>.<br> <li> Defined environment variables and exposed necessary ports.<br> <li> Set up entrypoint and command for running Tyk Gateway with a <br>configuration file.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6750/files#diff-04aa0c9ea8439431d9cccd4427ca7ed04e5ea23b9185a33117ecd6d12527cbee">+16/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Add Taskfile for building and testing Dockerfile</code> </dd></summary> <hr> docs/plugins/python/Taskfile.yml <li>Added a Taskfile to build and test the Dockerfile for Tyk Gateway with <br>Python.<br> <li> Included tasks to build Docker images with specified base images and <br>platforms.<br> <li> Added commands to verify Python version and Tyk Gateway version in the <br>built image.<br> <li> Supported testing with multiple Tyk Gateway versions (5.3.0 and <br>5.3.6-rc4).<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6750/files#diff-83d3e8ea6db5ced12e49e2e8fab60545aa92ce4ae8e5b7b5a4b09749e139fb67">+34/-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 --------- Co-authored-by: Tit Petric <[email protected]>
### **User description** <!-- Provide a general summary of your changes in the Title above --> TASK: https://tyktech.atlassian.net/browse/TT-13021 ## 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 ___ ### **Description** - Fixed an issue with reading and resetting the request body in the URL rewrite middleware to ensure downstream handlers can process it correctly. - Enhanced regex matching logic in the URL rewrite middleware, including improved context data handling. - Extended the tracing functionality to support OAS definitions by adding a new field in the trace request structure and implementing extraction logic. - Improved error handling for malformed or incomplete trace requests. ___ ### **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>mw_url_rewrite.go</strong><dd><code>Improve request body handling and regex matching in URL rewrite </code><br><code>middleware</code></dd></summary> <hr> gateway/mw_url_rewrite.go <li>Added error handling for reading the request body.<br> <li> Reset the request body to allow downstream handlers to read it.<br> <li> Enhanced regex matching logic and updated context data handling.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6770/files#diff-84a6a5c810334aaa8702669f2aebf0284f116d83e8a55ec9d1d5b8bae87f1be6">+20/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Extend tracing functionality to support OAS definitions</code> </dd></summary> <hr> gateway/tracing.go <li>Extended trace request structure to include OAS definitions.<br> <li> Added logic to extract and log OAS definitions into API definitions.<br> <li> Improved error handling for missing or malformed trace requests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6770/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+8/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: lghiur <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-11711" title="TT-11711" target="_blank">TT-11711</a></summary> <br /> <table> <tr> <th>Summary</th> <td>`listen path` formatting can panic worker gateway</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%20'24Bugsmash%20ORDER%20BY%20created%20DESC" title="'24Bugsmash">'24Bugsmash</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Gold%20ORDER%20BY%20created%20DESC" title="Gold">Gold</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></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- PR adds listenpath validation using the mux library. ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added `listenPath` validation using `httputil.ValidatePath` to prevent invalid paths from causing panics. - Enhanced logging in `MakeSpec` and `loadHTTPService` to include more context for debugging. - Updated `loadHTTPService` to validate `listenPath` and return errors when validation fails. - Introduced `ValidatePath` function in `httputil` to centralize path validation logic. - Added comprehensive unit tests for `ValidatePath` to ensure correctness and robustness. - Added integration tests in `api_loader_test.go` to verify `listenPath` validation during API loading. ___ ### **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>Add <code>listenPath</code> validation and improve logging in API definition <br>loader.</code></dd></summary> <hr> gateway/api_definition.go <li>Added validation for <code>listenPath</code> using <code>httputil.ValidatePath</code> to prevent <br>invalid paths.<br> <li> Enhanced logging with additional context fields for better debugging.<br> <li> Ensured <code>MakeSpec</code> and <code>loadHTTPService</code> validate <code>listenPath</code> to avoid <br>panics.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6772/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+18/-10</a> </td> </tr> <tr> <td> <details> <summary><strong>api_loader.go</strong><dd><code>Validate `listenPath` in `loadHTTPService` and handle errors.</code></dd></summary> <hr> gateway/api_loader.go <li>Added <code>httputil.ValidatePath</code> validation in <code>loadHTTPService</code> to ensure <br>valid <code>listenPath</code>.<br> <li> Modified <code>loadHTTPService</code> to return an error when validation fails.<br> <li> Updated API loading logic to handle errors from <code>loadHTTPService</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6772/files#diff-cdf0b7f176c9d18e1a314b78ddefc2cb3a94b3de66f1f360174692c915734c68">+21/-5</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>Add test for `listenPath` validation in API loader.</code> </dd></summary> <hr> gateway/api_loader_test.go <li>Added a new test case <code>TestAPILoaderValidation</code> to ensure <code>listenPath</code> <br>validation works correctly.<br> <li> Verified that invalid <code>listenPath</code> values do not cause panics.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6772/files#diff-f696545a659f4d96421b253edef4bcc8da0e7f52120b8f8866d32cbbb7cc1afc">+39/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>mux_test.go</strong><dd><code>Add unit tests for `ValidatePath` function.</code> </dd></summary> <hr> internal/httputil/mux_test.go <li>Added unit tests for <code>ValidatePath</code> to verify its behavior with valid <br>and invalid paths.<br> <li> Covered edge cases such as invalid regex and missing leading slashes.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6772/files#diff-8f7ce1891e221d7adb9e68f2e951f33edfbde2128187abb6e837ac01952d7888">+24/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mux.go</strong><dd><code>Add `ValidatePath` function for `listenPath` validation.</code> </dd></summary> <hr> internal/httputil/mux.go <li>Introduced <code>ValidatePath</code> function to validate <code>listenPath</code> using mux <br>router.<br> <li> Ensures invalid paths are caught early to prevent runtime issues.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6772/files#diff-3d9ee5f5e946d72e6f2ae662ff03ee5253bbdc15203d2e4f6e9f46c13011ebf8">+7/-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 --------- Co-authored-by: Tit Petric <[email protected]>
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12495" title="TT-12495" target="_blank">TT-12495</a></summary> <br /> <table> <tr> <th>Summary</th> <td>JWT RSA PUB Improvement - Support RSAPSS</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><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20innersource%20ORDER%20BY%20created%20DESC" title="innersource">innersource</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- Adding support for the more secure RSA-PSS signed JWTS. ## Description allows for the use of the RSA-PSS signature algorithm commonly referred to as PS256, PS384, PS512. The change is invisible to existing RSA Public Keyuse cases. Simply - by using "RSA Public Key" signing algorithm, Tyk will now validate JWTs signed by both RS & PS Class algorithms using Public Keys. ## Motivation and Context RSA-PSS is considered more secure than PKCS1 v1.5 due to its probabilistic nature, which helps mitigate certain attacks (e.g., padding oracle attacks). RS256: Commonly used in legacy systems, JWT (JSON Web Tokens), and many existing protocols where backward compatibility is important. PS256: Recommended for new applications where higher security is desired. It is becoming more widely adopted in modern security protocols. ## How This Has Been Tested Unit tests have been added. Both positive + negative tests that test both RS class JWTs and PS class JWTs. - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13021" title="TT-13021" target="_blank">TT-13021</a></summary> <br /> <table> <tr> <th>Summary</th> <td>URL Rewrite with `Transfer-Encoding: chunked` Header removes the response payload body</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%20'24Bugsmash%20ORDER%20BY%20created%20DESC" title="'24Bugsmash">'24Bugsmash</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%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></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 TASK: https://tyktech.atlassian.net/browse/TT-13021 <!-- 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** - Fixed an issue where the request body was not properly reset after being read, which could cause issues in subsequent processing. - Updated `gateway/mw_url_rewrite.go` to use `io.NopCloser` and `bytes.NewBuffer` for resetting the request body after reading. - Updated `gateway/mw_validate_json.go` to ensure the request body is reset after reading for JSON validation. - Added `bytes` package imports in both files to support the changes. ___ ### **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>mw_url_rewrite.go</strong><dd><code>Fix request body handling in URL rewrite middleware</code> </dd></summary> <hr> gateway/mw_url_rewrite.go <li>Added <code>bytes</code> package import for handling request body.<br> <li> Ensured the request body is reset after reading it using <code>io.NopCloser</code> <br>and <code>bytes.NewBuffer</code>.<br> <li> Improved handling of request body to allow further processing after <br>reading.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6787/files#diff-84a6a5c810334aaa8702669f2aebf0284f116d83e8a55ec9d1d5b8bae87f1be6">+2/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>mw_validate_json.go</strong><dd><code>Fix request body handling in JSON validation middleware</code> </dd></summary> <hr> gateway/mw_validate_json.go <li>Added <code>bytes</code> package import for handling request body.<br> <li> Ensured the request body is reset after reading it using <code>io.NopCloser</code> <br>and <code>bytes.NewBuffer</code>.<br> <li> Improved request body handling for JSON validation.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6787/files#diff-0f0c6b9ac40c5e01908a5b24b1d03111c8d8b4dbc1ddc0251d17c3c1b5328ab5">+2/-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-13753" title="TT-13753" target="_blank">TT-13753</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update usage of upload-artifact</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> Task </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%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></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-13753 ___ ### **PR Type** Bug fix, Configuration changes ___ ### **Description** - Removed the step to reclaim runner space in the CI workflow, optimizing the process. - Updated file paths in the `Check reports existence` step to ensure proper validation of required files. - Adjusted SonarCloud configuration to use the correct paths for coverage and lint reports. - Improved the CI workflow to enhance compatibility with SonarCloud and ensure accurate coverage reporting. ___ ### **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>ci-tests.yml</strong><dd><code>Fix SonarCloud coverage and streamline CI workflow configuration</code></dd></summary> <hr> .github/workflows/ci-tests.yml <li>Removed redundant step to reclaim runner space.<br> <li> Updated file paths in <code>Check reports existence</code> step to ensure correct <br>file validation.<br> <li> Adjusted SonarCloud configuration to use updated coverage and lint <br>report paths.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6790/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+3/-5</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information Co-authored-by: Tit Petric <[email protected]>
…n key when using url rewrite (#6778) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12741" title="TT-12741" target="_blank">TT-12741</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Looped APIs wrongfully inherit the caller's Authentication key when using URL rewrite</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%20'24Bugsmash%20ORDER%20BY%20created%20DESC" title="'24Bugsmash">'24Bugsmash</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></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- PR to see CI/CD result, please don't merge it. ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Introduced a new context constant `SelfLooping` and methods `ctxSetSelfLooping` and `ctxSelfLooping` to manage self-looping state in requests. - Updated `ctxCheckLimits` to bypass rate limits and quotas for self-looping requests. - Modified API loader to set self-looping state for self-referencing requests. - Enhanced the test `TestQuotaNotAppliedWithURLRewrite` to include scenarios for self-looping and URL rewrite, ensuring proper 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>ctx.go</strong><dd><code>Add support for managing self-looping state in context</code> </dd></summary> <hr> ctx/ctx.go <li>Added a new constant <code>SelfLooping</code> to the context.<br> <li> Introduced new methods <code>ctxSetSelfLooping</code> and <code>ctxSelfLooping</code> for <br>managing self-looping state in requests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6778/files#diff-600f5f552779994b15324fda108549eec7e7be30b1d8a1a16ee8344243e0cbc7">+1/-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>Update rate limit and quota checks for self-looping requests</code></dd></summary> <hr> gateway/api.go <li>Modified <code>ctxCheckLimits</code> to skip rate limits and quotas for <br>self-looping requests.<br> <li> Added logic to check and set self-looping state in requests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6778/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+20/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>api_loader.go</strong><dd><code>Set self-looping state for self-referencing requests</code> </dd></summary> <hr> gateway/api_loader.go - Added logic to set self-looping state when the hostname is "self". </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6778/files#diff-cdf0b7f176c9d18e1a314b78ddefc2cb3a94b3de66f1f360174692c915734c68">+1/-0</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>Enhance tests to cover self-looping and URL rewrite scenarios</code></dd></summary> <hr> gateway/middleware_test.go <li>Updated <code>TestQuotaNotAppliedWithURLRewrite</code> to include extended paths <br>and self-looping scenarios.<br> <li> Added a loader to create a merged API spec for testing.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6778/files#diff-6a09a08e3f82cc5e9d8c6b5c8426d75ea1e5d85e15ab008fca1f512e7c49c1e6">+7/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]> Co-authored-by: Tit Petric <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13741" title="TT-13741" target="_blank">TT-13741</a></summary> <br /> <table> <tr> <th>Summary</th> <td>CVE checks for 5.3.9 and 5.7.1</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> 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>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- Triggered by: titpetric JIRA: https://tyktech.atlassian.net/browse/TT-13741 | IMPORT | VERSION | LATEST | WARNINGS | CVES | |:---|:---|:---|:---|:---| | getkin/kin-openapi | v0.115.0 | v0.128.0 | Held back from upgrade | | | pires/go-proxyproto | v0.7.0 | v0.8.0 | | 0 of 1 | | robertkrimen/otto | v0.4.0 | v0.5.1 | | | | stretchr/testify | v1.9.0 | v1.10.0 | | | | valyala/fasthttp | v1.55.0 | v1.58.0 | | 0 of 1 | | golang.org/x/crypto | v0.29.0 | v0.31.0 | | 0 of 11 | | golang.org/x/net | v0.31.0 | v0.33.0 | | 0 of 17 | | golang.org/x/sync | v0.9.0 | v0.10.0 | | | | google.golang.org/grpc | v1.67.1 | v1.69.2 | | 0 of 2 | | google.golang.org/protobuf | v1.35.1 | v1.36.0 | | 0 of 2 | | redis/go-redis/v9 | v9.6.1 | v9.7.0 | | | | IBM/sarama | v1.43.1 | v1.43.3 | | | | goccy/go-json | v0.10.3 | v0.10.4 | | | | nats-io/nats.go | v1.37.0 | v1.38.0 | | | | newrelic/go-agent | v2.13.0 +incompatible | v3.35.1+incompatible | Held back from upgrade | | | testcontainers/testcontainers-go | v0.33.0 | v0.34.0 | | | | testcontainers/testcontainers-go/modules/kafka | v0.33.0 | v0.34.0 | | | | testcontainers/testcontainers-go/modules/nats | v0.33.0 | v0.34.0 | | | | go.opentelemetry.io/otel | v1.32.0 | v1.33.0 | Held back from upgrade | | | go.opentelemetry.io/otel/trace | v1.32.0 | v1.33.0 | Held back from upgrade | | | go.uber.org/mock | v0.4.0 | v0.5.0 | | | | golang.org/x/oauth2 | v0.23.0 | v0.24.0 | | | <details> <summary>Steps performed</summary> ~~~ + go get github.com/pires/[email protected] go: downloading github.com/pires/go-proxyproto v0.8.0 go: upgraded github.com/pires/go-proxyproto v0.7.0 => v0.8.0 + go get github.com/robertkrimen/[email protected] go: downloading github.com/robertkrimen/otto v0.5.1 go: upgraded github.com/robertkrimen/otto v0.4.0 => v0.5.1 + go get github.com/stretchr/[email protected] go: downloading github.com/stretchr/testify v1.10.0 go: upgraded github.com/stretchr/testify v1.9.0 => v1.10.0 + go get github.com/valyala/[email protected] go: downloading github.com/valyala/fasthttp v1.58.0 go: upgraded github.com/valyala/fasthttp v1.55.0 => v1.58.0 + go get golang.org/x/[email protected] go: downloading golang.org/x/crypto v0.31.0 go: downloading golang.org/x/sync v0.10.0 go: downloading golang.org/x/sys v0.28.0 go: downloading golang.org/x/term v0.27.0 go: downloading golang.org/x/text v0.21.0 go: upgraded golang.org/x/crypto v0.29.0 => v0.31.0 go: upgraded golang.org/x/sync v0.9.0 => v0.10.0 go: upgraded golang.org/x/sys v0.27.0 => v0.28.0 go: upgraded golang.org/x/text v0.20.0 => v0.21.0 + go get golang.org/x/[email protected] go: downloading golang.org/x/net v0.33.0 go: upgraded golang.org/x/net v0.31.0 => v0.33.0 + go get golang.org/x/[email protected] + go get google.golang.org/[email protected] go: downloading google.golang.org/grpc v1.69.2 go: upgraded google.golang.org/grpc v1.67.1 => v1.69.2 + go get google.golang.org/[email protected] go: downloading google.golang.org/protobuf v1.36.0 go: upgraded google.golang.org/protobuf v1.35.1 => v1.36.0 + go get github.com/redis/go-redis/[email protected] go: downloading github.com/redis/go-redis/v9 v9.7.0 go: upgraded github.com/redis/go-redis/v9 v9.6.1 => v9.7.0 + go get github.com/IBM/[email protected] go: downloading github.com/IBM/sarama v1.43.3 go: downloading github.com/eapache/go-resiliency v1.7.0 go: upgraded github.com/IBM/sarama v1.43.1 => v1.43.3 go: upgraded github.com/eapache/go-resiliency v1.6.0 => v1.7.0 + go get github.com/goccy/[email protected] go: downloading github.com/goccy/go-json v0.10.4 go: upgraded github.com/goccy/go-json v0.10.3 => v0.10.4 + go get github.com/nats-io/[email protected] go: downloading github.com/nats-io/nats.go v1.38.0 go: downloading github.com/nats-io/nkeys v0.4.9 go: upgraded github.com/nats-io/nats.go v1.37.0 => v1.38.0 go: upgraded github.com/nats-io/nkeys v0.4.7 => v0.4.9 + go get github.com/testcontainers/[email protected] go: downloading github.com/testcontainers/testcontainers-go v0.34.0 go: downloading github.com/cpuguy83/dockercfg v0.3.2 go: upgraded github.com/cpuguy83/dockercfg v0.3.1 => v0.3.2 go: upgraded github.com/testcontainers/testcontainers-go v0.33.0 => v0.34.0 + go get github.com/testcontainers/testcontainers-go/modules/[email protected] go: module github.com/testcontainers/[email protected] found, but does not contain package github.com/testcontainers/testcontainers-go/modules/kafka + go get github.com/testcontainers/testcontainers-go/modules/[email protected] go: module github.com/testcontainers/[email protected] found, but does not contain package github.com/testcontainers/testcontainers-go/modules/nats + go get go.uber.org/[email protected] go: downloading go.uber.org/mock v0.5.0 go: upgraded go.uber.org/mock v0.4.0 => v0.5.0 + go get golang.org/x/[email protected] go: downloading golang.org/x/oauth2 v0.24.0 go: upgraded golang.org/x/oauth2 v0.23.0 => v0.24.0 ~~~ </details> <details> <summary>go mod tidy output</summary> ``` ``` </details> ___ ### **PR Type** dependencies ___ ### **Description** - Updated multiple dependencies in `go.mod` to their latest versions, including `github.com/pires/go-proxyproto`, `github.com/stretchr/testify`, `golang.org/x/crypto`, and others. - Improved compatibility, security, and functionality by upgrading libraries. - Updated `go.sum` to reflect the changes in `go.mod` and ensure dependency integrity. ___ ### **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>Dependency updates in go.mod for compatibility and security.</code></dd></summary> <hr> go.mod <li>Updated multiple dependencies to their latest versions.<br> <li> Improved compatibility and security by upgrading libraries like <br><code>github.com/pires/go-proxyproto</code>, <code>github.com/stretchr/testify</code>, and <br><code>golang.org/x/crypto</code>.<br> <li> Enhanced test and runtime libraries with newer versions.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6794/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+21/-21</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Updated go.sum checksums for dependency upgrades.</code> </dd></summary> <hr> go.sum <li>Updated checksums for the upgraded dependencies in <code>go.mod</code>.<br> <li> Ensured integrity and consistency of the dependency graph.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6794/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+46/-44</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information Co-authored-by: titpetric <[email protected]>
### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Add classic API def to OAS API def translation guide ## Related Issue https://tyktech.atlassian.net/browse/TT-13564 ## 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** Documentation ___ ### **Description** - Added a detailed guide for translating Tyk OAS API definitions to Tyk Classic API definitions and vice versa. - Included step-by-step instructions for struct definitions, field handling, and method implementation. - Provided patterns for `Fill` and `ExtractTo` methods to ensure proper conversion. - Added guidance for writing and updating tests for conversion functions. - Included instructions for maintaining and updating the JSON schema for `x-tyk-api-gateway`. ___ ### **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>apidef-oas.md</strong><dd><code>Add translation guide for Tyk OAS and Classic API definitions.</code></dd></summary> <hr> docs/dev/apidef-oas.md <li>Added a comprehensive guide for translating Tyk OAS API definitions to <br>Tyk Classic API definitions and vice versa.<br> <li> Included detailed steps for struct definitions, field handling, and <br>method implementation.<br> <li> Provided patterns for <code>Fill</code> and <code>ExtractTo</code> methods with examples.<br> <li> Added instructions for updating tests and JSON schema.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6774/files#diff-067fc0b618537556581e225ee0e78e4f402e65e9b2735a59db23f5cba881b444">+86/-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-13742" title="TT-13742" target="_blank">TT-13742</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update Tyk API documentation for 5.3.9/5.7.1 release</td> </tr> <tr> <th>Type</th> <td> <img alt="Task" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium" /> 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>-</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-13742 updates swagger version ___ ### **PR Type** enhancement ___ ### **Description** - Updated the Swagger API documentation to reflect the new version `5.7.1`. - This change ensures the API documentation is aligned with the latest release. ___ ### **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>swagger.yml</strong><dd><code>Update Swagger API version to 5.7.1</code> </dd></summary> <hr> swagger.yml <li>Updated the <code>version</code> field in the Swagger API documentation from <code>5.7.0</code> <br>to <code>5.7.1</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6803/files#diff-8f3c4cb253eee09ae2401daa7279a8bbfbfd4168bb579c3ac0ee5c672d63bb2c">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
<details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13761" title="TT-13761" target="_blank">TT-13761</a></summary> <br /> <table> <tr> <th>Summary</th> <td>add batch request to the latest open api specs</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 --> --- When the new Gateway Open Api spec was created. The Batch request endpoint was left out .This should be added to the gateway OAS. This pr also fixes an issue where the external OAS Url we were using now return error 404. This pr changes that to use a local copy of the external oas . I.e we have changed from : https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json to https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json Link: https://tyk.io/docs/5.5/tyk-gateway-api/ [TT-13761] [TT-13761]: https://tyktech.atlassian.net/browse/TT-13761?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: itachi sasuke <[email protected]>
…ompiler test with arm64 cross build (#6813) Merging to release-5.3: [TT-13769] Extend plugin compiler test with arm64 cross build (#6813) [TT-13769] Extend plugin compiler test with arm64 cross build (#6813) ### **PR Type** tests ___ ### **Description** - Extended the plugin compiler test script to include a cross-compilation step for the `arm64` architecture. - Added a Docker command with the `GOARCH=arm64` environment variable to enable arm64 builds. - Ensures compatibility and testing for arm64 architecture in the plugin compiler. ___ ### **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>test.sh</strong><dd><code>Add arm64 cross-compilation to plugin compiler test script</code></dd></summary> <hr> ci/tests/plugin-compiler/test.sh <li>Added a cross-compilation step for building the plugin for the <code>arm64</code> <br>architecture.<br> <li> Introduced the use of the <code>GOARCH=arm64</code> environment variable in the <br>Docker command.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6813/files#diff-2a616e71f9e61519f1e7fcd658f73d83a8ae561ef3108da000e7f5d77e38c244">+3/-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 --------- Co-authored-by: Tit Petric <[email protected]>
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13766" title="TT-13766" target="_blank">TT-13766</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Bump newrelic dependency</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><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20SESAP%20ORDER%20BY%20created%20DESC" title="SESAP">SESAP</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This PR bumps the dependency with supposedly minimal changes, following the extensive upgrading guide. Needs an e2e test with newrelic (see ticket). https://tyktech.atlassian.net/browse/TT-13766 ___ ### **PR Type** Enhancement, Dependencies ___ ### **Description** - Migrated New Relic integration to use the updated v3 library. - Introduced a new `internal/service/newrelic` package for centralized New Relic functionality. - Refactored middleware, server, and proxy muxer to use the new context-based transaction handling. - Removed the old `gateway/newrelic.go` file and its outdated implementation. - Updated `go.mod` and `go.sum` to include the new New Relic v3 library and `nrgorilla` integration. ___ ### **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>middleware.go</strong><dd><code>Refactor middleware to use updated New Relic context-based API</code></dd></summary> <hr> gateway/middleware.go <li>Replaced direct usage of <code>newrelic.Transaction</code> with a new context-based <br>approach using <code>newrelic.Context</code>.<br> <li> Updated middleware logic to use the new <code>StartSegment</code> method from the <br>updated New Relic library.<br> <li> Adjusted imports to use the new internal <code>service/newrelic</code> package.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+3/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>newrelic.go</strong><dd><code>Remove old New Relic setup and instrumentation logic</code> </dd></summary> <hr> gateway/newrelic.go <li>Removed the old implementation of New Relic setup and instrumentation.<br> <li> Deprecated the file as its functionality has been moved to the new <br><code>internal/service/newrelic</code> package.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-5e962a38f6108a1954500d7e078fdafe5d53f22c6ba058af7afa4dee4b99a1e2">+0/-100</a> </td> </tr> <tr> <td> <details> <summary><strong>proxy_muxer.go</strong><dd><code>Update proxy muxer to use new New Relic context handling</code> </dd></summary> <hr> gateway/proxy_muxer.go <li>Updated transaction handling to use the new <code>newrelic.Context</code> for <br>setting and retrieving transactions.<br> <li> Adjusted imports to use the new <code>service/newrelic</code> package.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-89fb6731880400cb95ba8860c935a308de5f55aaa41aa2c76abf3ee4773d7a87">+7/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>server.go</strong><dd><code>Refactor server New Relic setup to use updated library</code> </dd></summary> <hr> gateway/server.go <li>Refactored <code>SetupNewRelic</code> to use the updated New Relic library and <br>configuration options.<br> <li> Updated the global <code>NewRelicApplication</code> variable to use the new <br><code>*newrelic.Application</code> type.<br> <li> Integrated the new <code>service/newrelic</code> package for New Relic <br>functionality.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-4652d1bf175a0be8f5e61ef7177c9666f23e077d8626b73ac9d13358fa8b525b">+31/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>newrelic.go</strong><dd><code>Add new service package for New Relic integration</code> </dd></summary> <hr> internal/service/newrelic/newrelic.go <li>Introduced a new package for handling New Relic integration.<br> <li> Added context-based transaction management and logging utilities.<br> <li> Implemented a new sink for emitting custom events and metrics to New <br>Relic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-7c791ca90be92a2cab3f0b458e287d89da843e75aa60147f1cad613a5debb56e">+99/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Update dependencies for New Relic v3 and integrations</code> </dd></summary> <hr> go.mod <li>Updated New Relic dependency to version 3.<br> <li> Added <code>nrgorilla</code> integration for New Relic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+2/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.sum</strong><dd><code>Update dependency checksums for New Relic v3</code> </dd></summary> <hr> go.sum <li>Updated checksums for the new New Relic v3 and <code>nrgorilla</code> dependencies.<br> <br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6809/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+4/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
@@ -250,6 +250,16 @@ type AnalyticsConfigConfig struct { | |||
SerializerType string `json:"serializer_type"` | |||
} | |||
|
|||
// AccessLogsConfig defines the type of transactions logs printed to stdout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// AccessLogsConfig defines the type of transactions logs printed to stdout | |
// AccessLogsConfig defines the type of transactions logs printed to stdout. |
@@ -250,6 +250,16 @@ type AnalyticsConfigConfig struct { | |||
SerializerType string `json:"serializer_type"` | |||
} | |||
|
|||
// AccessLogsConfig defines the type of transactions logs printed to stdout | |||
type AccessLogsConfig struct { | |||
// Enable the transaction logs. Default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Enable the transaction logs. Default: false | |
// Enabled controls enabling the transaction logs. Default: false. |
// This setting defaults to empty which prints the default log. | ||
// Set this value to determine which fields will be printed in the access log. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This setting defaults to empty which prints the default log. | |
// Set this value to determine which fields will be printed in the access log. | |
// Template defaults to empty which prints the default log. | |
// Set this value to determine which fields will be printed in the access log. | |
// Example: ["..."]. |
Fill the example with a valid example value or hint where to get valid values from. Answer how to configure this value.
// You can configure the transaction logs to be turned on | ||
// If not set or left empty, it will default to 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// You can configure the transaction logs to be turned on | |
// If not set or left empty, it will default to 'false' | |
// AccessLogs configures the output for access logs. | |
// If not configured, the access log is disabled. |
Swagger Changes _ __ __
_| |_ _ / _|/ _| between swagger-prev.yml
/ _' | | | | |_| |_ and swagger-current.yml
\__,_|\__, |_| |_| returned no differences
| (_| | |_| | _| _| |
TT-2539
Reverts #6524
FR Jira Ticket
https://tyktech.atlassian.net/browse/TT-2539
Description
TYK_GW_ACCESSLOGS_ENABLED
Gateway config optionTYK_GW_ACCESSLOGS_ENABLED
is set totrue
then the Gateway will print access logs to STDOUTTYK_GW_ACCESSLOGS_ENABLED
is set tofalse
then the Gateway will not print access logs to STDOUTNote that this feature is off by default and that the
AccessLog
struct only contains the more common elements. Below are some examples of an access logRelated Issue
Motivation and Context
Today the Tyk Gateway does not print access logs for success API calls but instead only for error API calls. Providing access logs for both scenarios within the Tyk Gateway is extremely valuable especially if you are monitoring logs, capturing analytics or even debugging. Providing the option to turn on or off the Tyk Gateway access logs will provide clients more insights in for API calls in regards to success and error situations.
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist