-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-11997] Backend logic for request_headers_rewrite (#6306)
### **User description** See https://tyktech.atlassian.net/browse/TT-11997 for details of the request headers rewrite rules. ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Added tests for request headers rewrite rules in GraphQL middleware. - Integrated request headers rewrite logic into the reverse proxy handler. - Added `RequestHeadersRewrite` to `ReverseProxyParams` struct. - Passed `RequestHeadersRewrite` to the GraphQL engine transport for both v1 and v2. - Implemented logic to apply request headers rewrite rules in the GraphQL engine transport, covering three different rewrite scenarios. ___ ### **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>mw_graphql_test.go</strong><dd><code>Add tests for request headers rewrite rules in GraphQL middleware.</code></dd></summary> <hr> gateway/mw_graphql_test.go <li>Added tests for request headers rewrite rules.<br> <li> Implemented three test cases for different rewrite scenarios.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6306/files#diff-72c11b8efcaceccfbbd87e75565353706443bf56420d3fdba6b5bf5f632f4b33">+137/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement </strong></td><td><table> <tr> <td> <details> <summary><strong>reverse_proxy.go</strong><dd><code>Integrate request headers rewrite logic in reverse proxy handler.</code></dd></summary> <hr> gateway/reverse_proxy.go <li>Integrated request headers rewrite logic into the reverse proxy <br>handler.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6306/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+8/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>engine.go</strong><dd><code>Add RequestHeadersRewrite to ReverseProxyParams struct.</code> </dd></summary> <hr> internal/graphengine/engine.go - Added `RequestHeadersRewrite` to `ReverseProxyParams` struct. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6306/files#diff-9d1ef4ec1b59d708ed86c7cc348b73bd0b619ef034094b5fbd4b138e11ccde6e">+8/-7</a> </td> </tr> <tr> <td> <details> <summary><strong>graphql_go_tools_v1.go</strong><dd><code>Pass RequestHeadersRewrite to GraphQL engine transport (v1).</code></dd></summary> <hr> internal/graphengine/graphql_go_tools_v1.go - Passed `RequestHeadersRewrite` to the GraphQL engine transport. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6306/files#diff-e592cc8ca6ac39e7574765d7f2bbf19193f173791a1b0930d4dde7f9412dc882">+1/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>graphql_go_tools_v2.go</strong><dd><code>Pass RequestHeadersRewrite to GraphQL engine transport (v2).</code></dd></summary> <hr> internal/graphengine/graphql_go_tools_v2.go - Passed `RequestHeadersRewrite` to the GraphQL engine transport. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6306/files#diff-2e41b60f046c2947fbedb8fb841b5c3c962798e3ba8211c7144f326436ffabe3">+1/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>transport.go</strong><dd><code>Implement request headers rewrite logic in GraphQL engine transport.</code></dd></summary> <hr> internal/graphengine/transport.go <li>Added logic to apply request headers rewrite rules in the GraphQL <br>engine transport.<br> <li> Implemented three rewrite rules for request headers.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6306/files#diff-564061c9b29366529eb1f6f10fe39671d2ac738a4731ffd2c8b04dcc0a8cd610">+96/-1</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
- Loading branch information
1 parent
f7cda28
commit 00a815f
Showing
6 changed files
with
251 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters