From b8f10fb98899a89657fddb68b27f65f552cbc44f Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Mon, 12 Aug 2024 14:24:20 +0300 Subject: [PATCH] Merging to release-5.5.0: [DX-1599] Update ports_whitelist config documentation (#6454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [DX-1599] Update ports_whitelist config documentation (#6454) ### **User description** ## Description Update `ports_whitelist` based on customer feedback reported by @davegarvey. For further details please refer to the ticket below. [DX-1599](https://tyktech.atlassian.net/browse/DX-1599) This PR updates the description as follows: ``` // Defines the ports that will be available for the API services to bind to in the format // documented here https://tyk.io/docs/key-concepts/tcp-proxy/#allowing-specific-ports. // Ports can be configured per protocol, e.g. https, tls etc. // If configuring via environment variable `TYK_GW_PORTWHITELIST` then remember to escape // JSON strings. ``` ## Related Issue ## Motivation and Context ## How This Has Been Tested ## Screenshots (if appropriate) ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist - [x] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why [DX-1599]: https://tyktech.atlassian.net/browse/DX-1599?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** Documentation ___ ### **Description** - Updated the documentation for the `ports_whitelist` configuration in `config/config.go`. - Added details on configuring ports per protocol (e.g., https, tls). - Included a note on escaping JSON strings when configuring via the `TYK_GW_PORTWHITELIST` environment variable. - Provided a reference link to the relevant documentation on Tyk's website. ___ ### **Changes walkthrough** 📝
Relevant files
Documentation
config.go
Update `ports_whitelist` configuration documentation         

config/config.go
  • Updated the documentation for ports_whitelist configuration.
  • Added details on configuring ports per protocol.
  • Included a note on escaping JSON strings when using environment
    variables.
  • Provided a reference link to the relevant documentation.
  • +5/-3     
    ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Simon Pears --- config/config.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 864de4dfa83..2529752f353 100644 --- a/config/config.go +++ b/config/config.go @@ -697,9 +697,11 @@ type Config struct { // A policy can be defined in a file (Open Source installations) or from the same database as the Dashboard. Policies PoliciesConfig `json:"policies"` - // Defines the ports that will be available for the API services to bind to in the following format: `"{“":“”}"`. Remember to escape JSON strings. - // This is a map of protocol to PortWhiteList. This allows per protocol - // configurations. + // Defines the ports that will be available for the API services to bind to in the format + // documented here https://tyk.io/docs/key-concepts/tcp-proxy/#allowing-specific-ports. + // Ports can be configured per protocol, e.g. https, tls etc. + // If configuring via environment variable `TYK_GW_PORTWHITELIST` then remember to escape + // JSON strings. PortWhiteList PortsWhiteList `json:"ports_whitelist"` // Disable port whilisting, essentially allowing you to use any port for your API.