[TT-11991]: added request_headers_rewrite#6257
Conversation
|
API Changes --- prev.txt 2024-05-06 09:43:23.580620002 +0000
+++ current.txt 2024-05-06 09:43:20.752612305 +0000
@@ -735,7 +735,22 @@
"properties": {
"auth_headers": {
"type": ["object", "null"]
- }
+ },
+ "request_headers_rewrite": {
+ "type": ["object", "null"],
+ "additionalProperties": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "remove": {
+ "type": "boolean"
+ }
+ },
+ "required": ["value", "remove"]
+ }
+ }
}
},
"subgraph": {
@@ -1336,10 +1351,11 @@
which will be hosted alongside the api.
type GraphQLProxyConfig struct {
- AuthHeaders map[string]string `bson:"auth_headers" json:"auth_headers"`
- SubscriptionType SubscriptionType `bson:"subscription_type" json:"subscription_type,omitempty"`
- RequestHeaders map[string]string `bson:"request_headers" json:"request_headers"`
- UseResponseExtensions GraphQLResponseExtensions `bson:"use_response_extensions" json:"use_response_extensions"`
+ AuthHeaders map[string]string `bson:"auth_headers" json:"auth_headers"`
+ SubscriptionType SubscriptionType `bson:"subscription_type" json:"subscription_type,omitempty"`
+ RequestHeaders map[string]string `bson:"request_headers" json:"request_headers"`
+ UseResponseExtensions GraphQLResponseExtensions `bson:"use_response_extensions" json:"use_response_extensions"`
+ RequestHeadersRewrite map[string]RequestHeadersRewriteConfig `json:"request_headers_rewrite" bson:"request_headers_rewrite"`
}
type GraphQLResponseExtensions struct {
@@ -1629,6 +1645,11 @@
Value string `bson:"value" json:"value"`
}
+type RequestHeadersRewriteConfig struct {
+ Value string `json:"value" bson:"value"`
+ Remove bool `json:"remove" bson:"remove"`
+}
+
type RequestInputType string
type RequestSigningMeta struct { |
|
PR Description updated to latest commit (5e08d0c) |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
329a343 to
be1a82d
Compare
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
|
## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description [TT-11991](https://tyktech.atlassian.net/browse/TT-11991) <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why [TT-11991]: https://tyktech.atlassian.net/browse/TT-11991?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ## **Type** enhancement ___ ## **Description** - Introduced new configuration options for rewriting request headers in the GraphQL proxy settings. - Added `RequestHeadersRewrite` field to `GraphQLProxyConfig` with a corresponding `RequestHeadersRewriteConfig` struct. - Updated the JSON schema to support the new `request_headers_rewrite` configuration, including necessary validations. ___ ## **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 Request Headers Rewrite Configuration to GraphQL Proxy</code></dd></summary> <hr> apidef/api_definitions.go <li>Added a new field <code>RequestHeadersRewrite</code> in <code>GraphQLProxyConfig</code> struct.<br> <li> Introduced <code>RequestHeadersRewriteConfig</code> struct with fields <code>Value</code> and <br><code>Remove</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6257/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+10/-4</a> </td> </tr> <tr> <td> <details> <summary><strong>schema.go</strong><dd><code>Update Schema for Request Headers Rewrite</code> </dd></summary> <hr> apidef/schema.go <li>Updated JSON schema to include <code>request_headers_rewrite</code> with properties <br><code>value</code> and <code>remove</code>.<br> <li> Added validation requirements for the new properties in the schema.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6257/files#diff-f8a37bb370eb6fe20063786a5e6ea3d85a5c91d8e289f0b3e045830c4d322095">+16/-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
## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description [TT-11991](https://tyktech.atlassian.net/browse/TT-11991) <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why [TT-11991]: https://tyktech.atlassian.net/browse/TT-11991?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ## **Type** enhancement ___ ## **Description** - Introduced new configuration options for rewriting request headers in the GraphQL proxy settings. - Added `RequestHeadersRewrite` field to `GraphQLProxyConfig` with a corresponding `RequestHeadersRewriteConfig` struct. - Updated the JSON schema to support the new `request_headers_rewrite` configuration, including necessary validations. ___ ## **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 Request Headers Rewrite Configuration to GraphQL Proxy</code></dd></summary> <hr> apidef/api_definitions.go <li>Added a new field <code>RequestHeadersRewrite</code> in <code>GraphQLProxyConfig</code> struct.<br> <li> Introduced <code>RequestHeadersRewriteConfig</code> struct with fields <code>Value</code> and <br><code>Remove</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6257/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+10/-4</a> </td> </tr> <tr> <td> <details> <summary><strong>schema.go</strong><dd><code>Update Schema for Request Headers Rewrite</code> </dd></summary> <hr> apidef/schema.go <li>Updated JSON schema to include <code>request_headers_rewrite</code> with properties <br><code>value</code> and <code>remove</code>.<br> <li> Added validation requirements for the new properties in the schema.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6257/files#diff-f8a37bb370eb6fe20063786a5e6ea3d85a5c91d8e289f0b3e045830c4d322095">+16/-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




User description
Description
TT-11991
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Type
enhancement
Description
RequestHeadersRewritefield toGraphQLProxyConfigwith a correspondingRequestHeadersRewriteConfigstruct.request_headers_rewriteconfiguration, including necessary validations.Changes walkthrough
api_definitions.go
Add Request Headers Rewrite Configuration to GraphQL Proxyapidef/api_definitions.go
RequestHeadersRewriteinGraphQLProxyConfigstruct.RequestHeadersRewriteConfigstruct with fieldsValueandRemove.schema.go
Update Schema for Request Headers Rewriteapidef/schema.go
request_headers_rewritewith propertiesvalueandremove.