-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Merging to release-5.10: [TT-15798] fix schema for jtiValidation (#7375) #7378
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.10: [TT-15798] fix schema for jtiValidation (#7375) #7378
Conversation
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-15798" title="TT-15798" target="_blank">TT-15798</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Custom claims validation not available in auto-suggest</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20regression-5.10.0%20ORDER%20BY%20created%20DESC" title="regression-5.10.0">regression-5.10.0</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20stability_refinement%20ORDER%20BY%20created%20DESC" title="stability_refinement">stability_refinement</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This PR fixes an issue with the schema of `jtiValidation`. ___ ### **PR Type** Bug fix ___ ### **Description** - Correct jtiValidation schema to object - Add required boolean property enabled - Update strict and non-strict OAS schemas ___ ### Diagram Walkthrough ```mermaid flowchart LR A["OAS Schema (non-strict)"] -- "jtiValidation array -> object" --> B["jtiValidation { enabled: boolean }"] C["OAS Schema (strict)"] -- "jtiValidation array -> object" --> B ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Convert jtiValidation to object with enabled</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <ul><li>Change jtiValidation from array to object<br> <li> Define boolean property <code>enabled</code><br> <li> Mark <code>enabled</code> as required</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7375/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+9/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.strict.json</strong><dd><code>Align strict schema: jtiValidation object enabled</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.strict.json <ul><li>Change jtiValidation from array to object<br> <li> Define boolean property <code>enabled</code><br> <li> Mark <code>enabled</code> as required</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7375/files#diff-39a62344d6b741814a58dfd2d219665ecdf962bbec8e755dbc61e1684bb4892a">+9/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ (cherry picked from commit d27eb4d)
PR Code Suggestions ✨Explore these optional code suggestions:
|
API Changes no api changes detected |
🔍 Code Analysis ResultsThe search result confirms my hypothesis.In // apidef/oas/security.go
// JTIValidation contains the configuration for the validation of the JWT ID.
// This field is a Tyk OAS only field and is only used in Tyk OAS APIs.
JTIValidation JTIValidation `bson:"jtiValidation,omitempty" json:"jtiValidation,omitempty"`
// ...
// JTIValidation contains the configuration for the validation of the JWT ID.
type JTIValidation struct {
// Enabled indicates whether JWT ID claim is required.
// When true, tokens must include a 'jti' claim.
Enabled bool `bson:"enabled,omitempty" json:"enabled,omitempty"`
} The Therefore, the PR is indeed a bug fix to align the OpenAPI schemas with the actual Go implementation. The change is correct and necessary. The impact is limited to schema validation and tooling that relies on it. There should be no change in the gateway's runtime behavior. Now I have all the information to create the final report. I will structure it as requested:
I will now generate the final response.<attempt_completion> Change Impact AnalysisThis pull request addresses a schema inconsistency for the AccomplishmentsThe PR successfully corrects the schema for Key Technical ChangesThe core change is the modification of the
This is a pure schema correction. The underlying Go code, specifically the Affected System Components
Architecture VisualizationThe change is a straightforward modification of a data structure within the API definition schema. A component diagram best illustrates the "before" and "after" states of the graph TD
subgraph "API Definition Schema (Before)"
direction LR
A["x-tyk-api-gateway.json"] --> B["jwtValidation: [ string ]"];
end
subgraph "API Definition Schema (After)"
direction LR
C["x-tyk-api-gateway.json"] --> D["jwtValidation: { enabled: boolean }"];
end
subgraph "Go Implementation (Unchanged)"
direction LR
E["apidef/oas/security.go"] --> F["struct JTIValidation {<br/> Enabled bool<br/>}"]
end
B -- "Incorrectly defined" --> F;
D -- "Correctly defines" --> F;
This diagram shows that the pull request modifies the JSON schema to correctly represent the data structure already expected by the Go codebase, thus resolving the inconsistency. Powered by Visor from Probelabs Last updated: 2025-09-26T12:15:17.352Z | Triggered by: opened | Commit: 2438cd0 |
🔍 Code Analysis Results✅ Security Check PassedNo security issues found – changes LGTM. ✅ Performance Check PassedNo performance issues found – changes LGTM. Quality Issues (1)
✅ Style Check PassedNo style issues found – changes LGTM. Dependency Issues (2)
Connectivity Issues (3)
Powered by Visor from Probelabs Last updated: 2025-09-26T12:15:18.201Z | Triggered by: opened | Commit: 2438cd0 |
|
User description
TT-15798 fix schema for jtiValidation (#7375)
User description
TT-15798
This PR fixes an issue with the schema of
jtiValidation
.PR Type
Bug fix
Description
Correct jtiValidation schema to object
Add required boolean property enabled
Update strict and non-strict OAS schemas
Diagram Walkthrough
File Walkthrough
x-tyk-api-gateway.json
Convert jtiValidation to object with enabled
apidef/oas/schema/x-tyk-api-gateway.json
enabled
enabled
as requiredx-tyk-api-gateway.strict.json
Align strict schema: jtiValidation object enabled
apidef/oas/schema/x-tyk-api-gateway.strict.json
enabled
enabled
as requiredPR Type
Bug fix
Description
Fix jtiValidation schema to object
Add required boolean property enabled
Update strict and non-strict OAS schemas
Diagram Walkthrough
File Walkthrough
x-tyk-api-gateway.json
Convert jtiValidation to object with required enabled
apidef/oas/schema/x-tyk-api-gateway.json
enabled
enabled
as requiredx-tyk-api-gateway.strict.json
Align strict schema for jtiValidation object
apidef/oas/schema/x-tyk-api-gateway.strict.json
enabled
enabled
as required