Skip to content
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

Merging to release-5.8.0: TT-14170 adjusted godoc for gw config (#6938) #6945

Conversation

buger
Copy link
Member

@buger buger commented Mar 12, 2025

User description

TT-14170 adjusted godoc for gw config (#6938)

User description

TT-14170
Summary Update docs for Gateway changes
Type Story Story
Status In Code Review
Points N/A
Labels -

Updated GW config godocs


PR Type

  • Documentation

Description

  • Updated access log documentation for Gateway.

  • Revised TLS version and SSL ciphers documentation links.

  • Modified control API port comment and link.

  • Updated KV store and secrets documentation references.


Changes walkthrough 📝

Relevant files
Documentation
config.go
Update godoc comments for Gateway configuration.                 

config/config.go

  • Updated AccessLogsConfig comments to clarify log generation.
  • Revised TLS version and custom SSL ciphers links in
    HttpServerOptionsConfig.
  • Modified ControlAPIPort comment for updated self-managed doc link.
  • Updated KV store and secrets documentation links.
  • +8/-8     

    Need help?
  • Type /help how to
  • ... in the comments thread for any questions about PR-Agent
    usage.

  • Check out the documentation
    for more information.

  • PR Type

    • Documentation

    Description

    • Updated access logs doc comment wording.

    • Revised TLS and SSL doc URLs.

    • Modified control API port and KV store links.

    • Refined godoc comments for Gateway configuration.


    Changes walkthrough 📝

    Relevant files
    Documentation
    config.go
    Revise godoc comments and documentation URLs.                       

    config/config.go

  • Updated access logs config comments.
  • Revised TLS version and SSL ciphers URLs.
  • Modified control API port comment and link.
  • Updated KV store and secrets documentation URLs.
  • +12/-12 

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-14170"
    title="TT-14170" target="_blank">TT-14170</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
          <td>Update docs for Gateway changes</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Story"
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium"
    />
            Story
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Code Review</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
          <td>-</td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    Updated GW config godocs
    
    
    ___
    
    ### **PR Type**
    - Documentation
    
    
    
    ___
    
    ### **Description**
    - Updated access log documentation for Gateway.
    
    - Revised TLS version and SSL ciphers documentation links.
    
    - Modified control API port comment and link.
    
    - Updated KV store and secrets documentation references.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>config.go</strong><dd><code>Update godoc comments for
    Gateway configuration.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    config/config.go
    
    <li>Updated AccessLogsConfig comments to clarify log generation.<br>
    <li> Revised TLS version and custom SSL ciphers links in
    <br>HttpServerOptionsConfig.<br> <li> Modified ControlAPIPort comment
    for updated self-managed doc link.<br> <li> Updated KV store and secrets
    documentation links.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6938/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+8/-8</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    (cherry picked from commit 1f55db2)
    Copy link
    Contributor

    API Changes

    --- prev.txt	2025-03-12 10:51:14.026417687 +0000
    +++ current.txt	2025-03-12 10:51:10.136377395 +0000
    @@ -5533,11 +5533,11 @@
     TYPES
     
     type AccessLogsConfig struct {
    -	// Enabled controls enabling the transaction logs. Default: false.
    +	// Enabled controls the generation of access logs by the Gateway. Default: false.
     	Enabled bool `json:"enabled"`
     
    -	// Template configures which fields to log into the access log.
    -	// If unconfigured, all fields listed will be logged.
    +	// Template configures which fields to include in the access log.
    +	// If no template is configured, all available fields will be logged.
     	//
     	// Example: ["client_ip", "path"].
     	//
    @@ -5676,7 +5676,7 @@
     	// Custom hostname for the Control API
     	ControlAPIHostname string `json:"control_api_hostname"`
     
    -	// Set this to expose the Tyk Gateway API on a separate port. You can protect it behind a firewall if needed. Please make sure you follow this guide when setting the control port https://tyk.io/docs/planning-for-production/#change-your-control-port.
    +	// Set this to expose the Tyk Gateway API on a separate port. You can protect it behind a firewall if needed. Please make sure you follow this guide when setting the control port https://tyk.io/docs/tyk-self-managed/#change-your-control-port.
     	ControlAPIPort int `json:"control_api_port"`
     
     	// This should be changed as soon as Tyk is installed on your system.
    @@ -5749,7 +5749,7 @@
     	Policies PoliciesConfig `json:"policies"`
     
     	// 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.
    +	// documented here https://tyk.io/docs/api-management/non-http-protocols/#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.
    @@ -6024,7 +6024,7 @@
     
     	NewRelic NewRelicConfig `json:"newrelic"`
     
    -	// Enable debugging of your Tyk Gateway by exposing profiling information through https://tyk.io/docs/troubleshooting/tyk-gateway/profiling/
    +	// Enable debugging of your Tyk Gateway by exposing profiling information through https://tyk.io/docs/api-management/troubleshooting-debugging
     	HTTPProfile bool `json:"enable_http_profiler"`
     
     	// Enables the real-time Gateway log view in the Dashboard.
    @@ -6083,7 +6083,7 @@
     	GlobalSessionLifetime int64 `bson:"global_session_lifetime" json:"global_session_lifetime"`
     
     	// This section enables the use of the KV capabilities to substitute configuration values.
    -	// See more details https://tyk.io/docs/tyk-configuration-reference/kv-store/
    +	// See more details https://tyk.io/docs/tyk-self-managed/#store-configuration-with-key-value-store
     	KV struct {
     		Consul ConsulConfig `json:"consul"`
     		Vault  VaultConfig  `json:"vault"`
    @@ -6099,7 +6099,7 @@
     	// The secret value may be used as `secrets://key1` from the API definition.
     	// In versions before gateway 5.3, only `listen_path` and `target_url` fields
     	// have had the secrets replaced.
    -	// See more details https://tyk.io/docs/tyk-configuration-reference/kv-store/#how-to-access-the-externally-stored-data
    +	// See more details https://tyk.io/docs/tyk-self-managed/#how-to-access-the-externally-stored-data
     	Secrets map[string]string `json:"secrets"`
     
     	// Override the default error code and or message returned by middleware.
    @@ -6126,7 +6126,7 @@
     	// ```
     	OverrideMessages map[string]TykError `bson:"override_messages" json:"override_messages"`
     
    -	// Cloud flag indicates that the Gateway is deployed in a Tyk Cloud data plane.
    +	// Cloud flag shows the Gateway runs in Tyk Cloud.
     	Cloud bool `json:"cloud"`
     
     	// Skip TLS verification for JWT JWKs url validation
    @@ -6352,7 +6352,7 @@
     	// Start your Gateway HTTP server on specific server name
     	ServerName string `json:"server_name"`
     
    -	// Minimum TLS version. Possible values: https://tyk.io/docs/basic-config-and-security/security/tls-and-ssl/#values-for-tls-versions
    +	// Minimum TLS version. Possible values: https://tyk.io/docs/api-management/certificates#supported-tls-versions
     	MinVersion uint16 `json:"min_version"`
     
     	// Maximum TLS version.
    @@ -6374,7 +6374,7 @@
     	// Disable automatic character escaping, allowing to path original URL data to the upstream.
     	SkipTargetPathEscaping bool `json:"skip_target_path_escaping"`
     
    -	// Custom SSL ciphers. See list of ciphers here https://tyk.io/docs/basic-config-and-security/security/tls-and-ssl/#specify-tls-cipher-suites-for-tyk-gateway--tyk-dashboard
    +	// Custom SSL ciphers applicable when using TLS version 1.2. See the list of ciphers here https://tyk.io/docs/api-management/certificates#supported-tls-cipher-suites
     	Ciphers []string `json:"ssl_ciphers"`
     
     	// MaxRequestBodySize configures a maximum size limit for request body size (in bytes) for all APIs on the Gateway.
    @@ -6388,7 +6388,7 @@
     	// A value of zero (default) means that no maximum is set and API requests will not be tested.
     	//
     	// See more information about setting request size limits here:
    -	// https://tyk.io/docs/basic-config-and-security/control-limit-traffic/request-size-limits/#maximum-request-sizes
    +	// https://tyk.io/docs/api-management/traffic-transformation/#request-size-limits
     	MaxRequestBodySize int64 `json:"max_request_body_size"`
     }
     

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis 🔶

    6938 - Partially compliant

    Compliant requirements:

    • Updated access logs documentation with clearer descriptions.
    • Revised TLS and SSL ciphers links.
    • Updated Control API port comment with new guide link.
    • Updated KV store and secrets documentation references.

    Non-compliant requirements:

    []

    Requires further human verification:

    []

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Doc Link Consistency

    Review all updated documentation links across TLS, SSL ciphers, request size limits, and other config sections for consistency against the style guide and ensure the URLs are correct.

    // SSL certificates used by your Gateway server. A list of certificate IDs or path to files.
    SSLCertificates []string `json:"ssl_certificates"`
    
    // Start your Gateway HTTP server on specific server name
    ServerName string `json:"server_name"`
    
    // Minimum TLS version. Possible values: https://tyk.io/docs/api-management/certificates#supported-tls-versions
    MinVersion uint16 `json:"min_version"`
    
    // Maximum TLS version.
    MaxVersion uint16 `json:"max_version"`
    
    // When mTLS enabled, this option allows to skip client CA announcement in the TLS handshake.
    // This option is useful when you have a lot of ClientCAs and you want to reduce the handshake overhead, as some clients can hit TLS handshake limits.
    // This option does not give any hints to the client, on which certificate to pick (but this is very rare situation when it is required)
    SkipClientCAAnnouncement bool `json:"skip_client_ca_announcement"`
    
    // Set this to the number of seconds that Tyk uses to flush content from the proxied upstream connection to the open downstream connection.
    // This option needed be set for streaming protocols like Server Side Events, or gRPC streaming.
    FlushInterval int `json:"flush_interval"`
    
    // Allow the use of a double slash in a URL path. This can be useful if you need to pass raw URLs to your API endpoints.
    // For example: `http://myapi.com/get/http://example.com`.
    SkipURLCleaning bool `json:"skip_url_cleaning"`
    
    // Disable automatic character escaping, allowing to path original URL data to the upstream.
    SkipTargetPathEscaping bool `json:"skip_target_path_escaping"`
    
    // Custom SSL ciphers applicable when using TLS version 1.2. See the list of ciphers here https://tyk.io/docs/api-management/certificates#supported-tls-cipher-suites
    Ciphers []string `json:"ssl_ciphers"`
    
    // MaxRequestBodySize configures a maximum size limit for request body size (in bytes) for all APIs on the Gateway.
    //
    // Tyk Gateway will evaluate all API requests against this size limit and will respond with HTTP 413 status code if the body of the request is larger.
    //
    // Two methods are used to perform the comparison:
    //  - If the API Request contains the `Content-Length` header, this is directly compared against `MaxRequestBodySize`.
    //  - If the `Content-Length` header is not provided, the Request body is read in chunks to compare total size against `MaxRequestBodySize`.
    //
    // A value of zero (default) means that no maximum is set and API requests will not be tested.
    //
    // See more information about setting request size limits here:
    // https://tyk.io/docs/api-management/traffic-transformation/#request-size-limits
    MaxRequestBodySize int64 `json:"max_request_body_size"`
    ControlAPIPort Clarity

    Verify that the updated comment for ControlAPIPort clearly explains its use and points to the correct guide for self-managed deployments.

    // Setting this value will change the port that Tyk listens on. Default: 8080.
    ListenPort int `json:"listen_port"`
    
    // Custom hostname for the Control API
    ControlAPIHostname string `json:"control_api_hostname"`
    
    // Set this to expose the Tyk Gateway API on a separate port. You can protect it behind a firewall if needed. Please make sure you follow this guide when setting the control port https://tyk.io/docs/tyk-self-managed/#change-your-control-port.
    ControlAPIPort int `json:"control_api_port"`
    KV & Secrets Docs

    Confirm that the new documentation links for the KV section and Secrets are accurate and align with the updated Tyk self-managed documentation.

    // This section enables the use of the KV capabilities to substitute configuration values.
    // See more details https://tyk.io/docs/tyk-self-managed/#store-configuration-with-key-value-store
    KV struct {
    	Consul ConsulConfig `json:"consul"`
    	Vault  VaultConfig  `json:"vault"`
    } `json:"kv"`
    
    // Secrets configures a list of key/value pairs for the gateway.
    // When configuring it via environment variable, the expected value
    // is a comma separated list of key-value pairs delimited with a colon.
    //
    // Example: `TYK_GW_SECRETS=key1:value1,key2:/value2`
    // Produces: `{"key1": "value1", "key2": "/value2"}`
    //
    // The secret value may be used as `secrets://key1` from the API definition.
    // In versions before gateway 5.3, only `listen_path` and `target_url` fields
    // have had the secrets replaced.
    // See more details https://tyk.io/docs/tyk-self-managed/#how-to-access-the-externally-stored-data
    Secrets map[string]string `json:"secrets"`

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @lghiur lghiur merged commit 5b6d589 into release-5.8.0 Mar 12, 2025
    26 of 37 checks passed
    @lghiur lghiur deleted the merge/release-5.8.0/1f55db2512a762bf408e49aa8f4ca3c9d771dbbf branch March 12, 2025 12:03
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants