-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[TT-15683] Add JWKS cache flush to the Dashboard API and MDCB #7523
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
Conversation
1e0c8f8 to
f496005
Compare
🎯 Recommended Merge TargetsBased on JIRA ticket TT-15683: Add JWKS cache flush to the Dashboard API and MDCB Fix Version: Tyk 5.11.0
Required:
📋 Workflow
|
|
API Changes --- prev.txt 2025-11-14 12:28:12.031183591 +0000
+++ current.txt 2025-11-14 12:28:02.574202432 +0000
@@ -10930,8 +10930,9 @@
KeySpaceUpdateNotification NotificationCommand = "KeySpaceUpdateNotification"
OAuthPurgeLapsedTokens NotificationCommand = "OAuthPurgeLapsedTokens"
// NoticeDeleteAPICache is the command with which event is emitted from dashboard to invalidate cache for an API.
- NoticeDeleteAPICache NotificationCommand = "DeleteAPICache"
- NoticeUserKeyReset NotificationCommand = "UserKeyReset"
+ NoticeDeleteAPICache NotificationCommand = "DeleteAPICache"
+ NoticeUserKeyReset NotificationCommand = "UserKeyReset"
+ NoticeInvalidateJWKSCacheForAPI NotificationCommand = "InvalidateJWKSCacheForAPI"
)
func (n NotificationCommand) String() string
|
🔍 Code Analysis ResultsThis PR introduces a mechanism to flush the JSON Web Key Set (JWKS) cache for a specific API, triggerable either through a direct API call or via a Multi-Data Center Bridge (MDCB) notification. The core change refactors the cache flushing logic into a new standalone function, Files Changed Analysis
Architecture & Impact AssessmentWhat this PR accomplishesThis PR provides a way to manually invalidate the JWKS cache for a specific API. This is critical in scenarios where keys at a JWKS URL are rotated, allowing administrators to force the gateway to fetch the new keys immediately rather than waiting for the cache to expire. Key technical changes introduced
Affected system components
VisualizationThe following diagram illustrates the two flows for JWKS cache invalidation: graph TD
subgraph Direct API Call
Admin -- "POST /tyk/apis/{apiID}/jwks-cache/flush" --> A[Gateway API Endpoint]
A --> B(invalidateJWKSCacheForAPIID handler)
end
subgraph MDCB Notification
Dashboard -- "Publishes event" --> D[Redis Pub/Sub]
D -- "NoticeInvalidateJWKSCacheForAPI" --> E[Gateway Redis Listener]
E --> F(handleRedisEvent)
end
B --> C{invalidateJWKSCacheByAPIID}
F --> C
C --> G([JWKS Cache for API ID])
G -- "Flush()" --> H((Cache Flushed))
Scope Discovery & Context ExpansionThe changes are well-contained within the gateway's JWT handling and Redis signaling modules. The introduction of the The existing API endpoint is part of the gateway's internal management API, ensuring that both the direct API call and the new MDCB notification use the same underlying cache flush logic for consistent behavior. This enhancement improves the gateway's manageability in a distributed architecture where configuration and state changes must be propagated efficiently. Metadata
Powered by Visor from Probelabs Last updated: 2025-11-14T12:31:11.353Z | Triggered by: synchronize | Commit: cde4503 💡 TIP: You can chat with Visor using |
🔍 Code Analysis Results✅ Security Check PassedNo security issues found – changes LGTM. Architecture Issues (1)
✅ Performance Check PassedNo performance issues found – changes LGTM. Quality Issues (1)
Dependency Issues (1)
Connectivity Issues (2)
Powered by Visor from Probelabs Last updated: 2025-11-14T12:31:12.339Z | Triggered by: synchronize | Commit: cde4503 💡 TIP: You can chat with Visor using |
f496005 to
670aaa5
Compare
670aaa5 to
cde4503
Compare
|
|
/release to release-5.11 |
|
|



PR for https://tyktech.atlassian.net/browse/TT-15683
Ticket Details
TT-15683
Generated at: 2025-11-14 12:27:29