Skip to content

Conversation

buger
Copy link
Member

@buger buger commented Sep 24, 2025

User description

Triggered by: lghiur

Included:

Tyk Gateway: true
Tyk Dashboard: false
Tyk MDCB false
Tyk Pump false

Intended for: master
Changes sourced from: release-5.10.0
Config info generator branch: main

Note: Gateway - Docs updates for 5.10.0 (branch suffix: docs)

JIRA: https://tyktech.atlassian.net/browse/TT-15719


PR Type

Documentation


Description

  • Add JWK cache invalidation endpoints

  • Document certificate expiry monitoring config

  • Expand OAS security and JWT fields

  • Clarify external service proxy/mTLS config


Diagram Walkthrough

flowchart LR
  Swagger["Gateway Swagger (OpenAPI)"]
  Config["Gateway Config (shared)"]
  OAS["x-tyk-gateway (OAS extensions)"]

  Swagger -- "add /tyk/cache/jwks endpoints" --> Swagger
  Config -- "certificate_expiry_monitor settings" --> Config
  OAS -- "security processing + JWT/JWKS fields" --> OAS
Loading

File Walkthrough

Relevant files
Documentation
gateway-swagger.yml
Introduce JWK cache invalidation API endpoints                     

tyk-docs/assets/others/gateway-swagger.yml

  • Add DELETE /tyk/cache/jwks/{apiID} endpoint.
  • Add DELETE /tyk/cache/jwks endpoint for all APIs.
  • Define responses and tags for JWK cache invalidation.
  • Provide examples and status schemas.
+60/-0   
gateway-config.md
Document certificate expiry monitor and external services

tyk-docs/content/shared/gateway-config.md

  • Add certificate_expiry_monitor section and sub-options.
  • Document env vars and defaults for thresholds/cooldowns.
  • Add external_services config description for proxy/mTLS.
  • Minor heading additions around HTTP server context.
+30/-0   
x-tyk-gateway.md
Expand OAS security and JWT/JWKS configuration docs           

tyk-docs/content/shared/x-tyk-gateway.md

  • Add SecurityProcessingMode and vendor security requirements.
  • Expand JWT/JWKS docs: JWK struct, jwksURIs link, subject/base policy
    claims.
  • Add JWT validations: issuers, audiences, subjects, JTI, custom claim
    validation.
  • Add scope/claims mapping and field clarifications.
+112/-1 

Copy link
Contributor

⚠️ Deploy preview for PR #6969 did not become live after 3 attempts.
Please check Netlify or try manually: Preview URL

Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

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

Consistency

Tag names for the new JWKS endpoints use "JWK cache invalidation" while summary/descriptions say "JWK". Consider aligning tag capitalization and pluralization with existing conventions to keep Swagger grouping consistent.

    tags:
      - JWK cache invalidation
/tyk/cache/jwks:
  delete:
    description: Invalidate JWK cache for all APIs.
    operationId: invalidateJWKCacheForAllAPIs
    responses:
      "200":
        content:
          application/json:
            example:
              message: cache invalidated
              status: ok
            schema:
              $ref: '#/components/schemas/ApiStatusMessage'
        description: Cache invalidated.
      "403":
        content:
          application/json:
            example:
              message: Attempted administrative access with invalid or missing key!
              status: error
            schema:
              $ref: '#/components/schemas/ApiStatusMessage'
        description: Forbidden
    summary: Invalidate JWK cache for all APIs
    tags:
      - JWK cache invalidation
Typo/Type Leak

The type for allowedValues in CustomClaimValidationConfig appears to include an internal Go AST type signature instead of a user-facing type hint; this likely needs to be documented as a generic list/array (e.g., any/[]interface{}) with supported primitives.

**Field: `allowedValues` (`[]&ast.InterfaceType{Interface:195124, Methods:(*ast.FieldList)(0xc0003b1170), Incomplete:false}`)**
AllowedValues contains the values that Tyk will use to validate the claim for "exact_match" and "contains" validation types.
Not used for "required" validation type.
Supports string, number, boolean, and array values.
For arrays, validation succeeds if any array element matches any allowed value.
Clarity

SecurityProcessingMode description mentions OR logic across requirements; consider clarifying how multiple schemes within a single requirement (AND semantics) are handled to avoid ambiguity for readers implementing complex security.

**Field: `securityProcessingMode` (`string`)**
SecurityProcessingMode controls how multiple security requirements are processed.
- "legacy" (default): Only first security requirement processed, uses BaseIdentityProvider
- "compliant": All security requirements processed with OR logic, dynamic identity provider

Tyk classic API definition: `security_processing_mode`.

**Field: `security` (`[][]string`)**
Security contains Tyk vendor extension security requirements for proprietary auth methods.
This is concatenated with OpenAPI security requirements when SecurityProcessingMode is "compliant".

Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Correct incorrect type rendering

Fix the rendered type for allowedValues; it currently shows a Go AST debug type,
which is confusing and incorrect for users. Replace it with a clear, user-facing
type description, e.g., "[]any" or "[]interface{}".

tyk-docs/content/shared/x-tyk-gateway.md [2234-2239]

-**Field: `allowedValues` (`[]&ast.InterfaceType{Interface:195124, Methods:(*ast.FieldList)(0xc0003b1170), Incomplete:false}`)**
+**Field: `allowedValues` (`[]any`)**
 AllowedValues contains the values that Tyk will use to validate the claim for "exact_match" and "contains" validation types.
 Not used for "required" validation type.
 Supports string, number, boolean, and array values.
 For arrays, validation succeeds if any array element matches any allowed value.
Suggestion importance[1-10]: 8

__

Why: The rendered type shows an internal Go AST debug string, which is clearly incorrect for docs; replacing with a user-facing type like []any significantly improves accuracy and clarity.

Medium
General
Add 404 not-found response

Add a "404" response to document behavior when the provided apiID does not exist.
This prevents clients from misinterpreting missing APIs as successful invalidations
and aligns with typical REST error patterns.

tyk-docs/assets/others/gateway-swagger.yml [1606-1639]

 /tyk/cache/jwks/{apiID}:
   delete:
     description: Invalidate JWK cache for the given API.
     operationId: invalidateJWKCache
     parameters:
       - description: The API ID.
         example: ae67bb862a3241a49117508e0f9ee839
         in: path
         name: apiID
         required: true
         schema:
           type: string
     responses:
       "200":
         content:
           application/json:
             example:
               message: cache invalidated
               status: ok
             schema:
               $ref: '#/components/schemas/ApiStatusMessage'
         description: Cache invalidated.
       "403":
         content:
           application/json:
             example:
               message: Attempted administrative access with invalid or missing key!
               status: error
             schema:
               $ref: '#/components/schemas/ApiStatusMessage'
         description: Forbidden
+      "404":
+        content:
+          application/json:
+            example:
+              message: API not found
+              status: error
+            schema:
+              $ref: '#/components/schemas/ApiStatusMessage'
+        description: API ID not found.
     summary: Invalidate cache for given API ID.
     tags:
       - JWK cache invalidation
Suggestion importance[1-10]: 6

__

Why: The existing path lacks a 404 response for unknown apiID, and documenting it would improve client expectations; however, it's speculative without confirmation of backend behavior.

Low
Ensure unique operationId

Add an "operationId" uniqueness check by renaming to avoid potential collisions with
similarly named operations. Ensure operationId strings are unique across the spec to
prevent client generation conflicts.

tyk-docs/assets/others/gateway-swagger.yml [1640-1665]

 /tyk/cache/jwks:
   delete:
     description: Invalidate JWK cache for all APIs.
-    operationId: invalidateJWKCacheForAllAPIs
+    operationId: invalidateJWKCacheAll
     responses:
       "200":
         content:
           application/json:
             example:
               message: cache invalidated
               status: ok
             schema:
               $ref: '#/components/schemas/ApiStatusMessage'
         description: Cache invalidated.
       "403":
         content:
           application/json:
             example:
               message: Attempted administrative access with invalid or missing key!
               status: error
             schema:
               $ref: '#/components/schemas/ApiStatusMessage'
         description: Forbidden
     summary: Invalidate JWK cache for all APIs
     tags:
       - JWK cache invalidation
Suggestion importance[1-10]: 4

__

Why: Uniqueness of operationId is important, but the suggestion arbitrarily renames it without evidence of a collision in this spec; impact is minor unless a conflict is proven.

Low

Copy link

netlify bot commented Sep 24, 2025

PS. Add to the end of url /docs/nightly

Name Link
🔨 Latest commit c177ebc
🔍 Latest deploy log https://app.netlify.com/projects/tyk-docs/deploys/68d3cff3d0be770008d76bf5
😎 Deploy Preview https://deploy-preview-6969--tyk-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Sep 24, 2025

PS. Add to the end of url /docs/nightly

Name Link
🔨 Latest commit 1cf195e
🔍 Latest deploy log https://app.netlify.com/projects/tyk-docs/deploys/68d51c6a5cf7cd000863457a
😎 Deploy Preview https://deploy-preview-6969--tyk-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@lghiur lghiur changed the title [TT-15719] Update documentation for master [TT-15719] Dash - Update documentation for master - 5.10.0 Sep 24, 2025
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