-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[TT-15856] [PoC] Unify path matching algorithm for all middleware #7525
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
base: master
Are you sure you want to change the base?
[TT-15856] [PoC] Unify path matching algorithm for all middleware #7525
Conversation
|
API Changes --- prev.txt 2025-11-13 12:48:08.151673522 +0000
+++ current.txt 2025-11-13 12:47:58.083591464 +0000
@@ -12249,6 +12249,9 @@
GoPlugin
PersistGraphQL
RateLimit
+
+ OasMock
+ OasValidate
)
Enums representing the various statuses for a VersionInfo Path match during
a proxy request |
🔍 Code Analysis ResultsThis PR is a Proof of Concept (PoC) aimed at unifying the path matching algorithm for all middleware within the Tyk gateway. It refactors the OAS-based mock response and request validation middlewares to use a new, centralized path matching and parameter extraction engine. This change is intended to improve consistency, reduce code duplication, and simplify the implementation of path-based middleware. A new package, Files Changed Analysis
Architecture & Impact AssessmentWhat this PR accomplishesThis PR establishes an architectural pattern for a unified path-matching system. By centralizing this logic, it aims to create a more cohesive gateway core where all path-based middleware is handled consistently. This PoC validates the approach using the OAS mock and validation middlewares as the initial candidates for this new model. Key technical changes introduced
Affected system components
VisualizationThis diagram illustrates the architectural shift from multiple, independent path-matching mechanisms to a single, unified model. graph TD
subgraph "Before"
A[Request] --> B{Gateway Core};
B --> C1[Mock Middleware];
C1 --> D1["findOperation() logic (OAS Router)"];
B --> C2[Validate Middleware];
C2 --> D2["findOperation() logic (OAS Router)"];
B --> C3[Other Middleware];
C3 --> D3["Regex Path Matching"];
end
subgraph "After (This PR)"
F[Request] --> G{Gateway Core};
G --> H{Unified Regex Path Matching};
H -- "Matched URLSpec (OAS Mock)" --> I[Mock Middleware];
H -- "Matched URLSpec (OAS Validate)" --> K[Validate Middleware];
K -- "Uses paramextractor" --> L[Extracts Params];
H -- "Matched URLSpec (Other)" --> M[Other Middleware];
end
Scope Discovery & Context ExpansionThe title, "Unify path matching algorithm for all middleware," clearly indicates that this PoC is the first step of a larger and more ambitious initiative. The pattern established here is intended to be extended to other path-based middlewares to create a more consistent and maintainable gateway core. However, this PoC introduces several critical issues that must be addressed before this pattern can be adopted more widely:
Future work must focus on resolving these performance and architectural issues. Once addressed, this unified pattern could be rolled out to other middlewares to realize its full benefits of improved consistency and maintainability. Metadata
Powered by Visor from Probelabs Last updated: 2025-11-13T12:52:51.156Z | Triggered by: synchronize | Commit: 0a03320 💡 TIP: You can chat with Visor using |
🔍 Code Analysis Results✅ Security Check PassedNo security issues found – changes LGTM. Architecture Issues (3)
Performance Issues (3)
Quality Issues (3)
Dependency Issues (4)
✅ Connectivity Check PassedNo connectivity issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-11-13T12:52:52.346Z | Triggered by: synchronize | Commit: 0a03320 💡 TIP: You can chat with Visor using |
eae4ba9 to
a76c087
Compare
|



Description
POC
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Ticket Details
TT-15856
Generated at: 2025-11-13 12:47:43