-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[TT-13422] Do not allow empty string in upstream auth configuration strings #6699
Conversation
Knock Knock! 🔍 Just thought I'd let you know that your PR title and story title look quite different. PR titles that closely resemble the story title make it easier for reviewers to understand the context of the PR. An easy-to-understand PR title a day makes the reviewer review away! 😛⚡️
Check out this guide to learn more about PR best-practices. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
API Changes --- prev.txt 2024-11-08 13:05:12.007205887 +0000
+++ current.txt 2024-11-08 13:05:03.027118847 +0000
@@ -3515,9 +3515,6 @@
TokenURL string `bson:"tokenUrl" json:"tokenUrl"`
// Scopes specifies optional requested permissions.
Scopes []string `bson:"scopes,omitempty" json:"scopes,omitempty"`
- // HeaderName is the custom header name to be used for OAuth client credential flow authentication.
- // Defaults to `Authorization`.
- HeaderName string `bson:"headerName" json:"headerName"`
// ExtraMetadata holds the keys that we want to extract from the token and pass to the upstream.
ExtraMetadata []string `bson:"extraMetadata" json:"extraMetadata,omitempty"`
} |
dc55397
to
8d0454e
Compare
Quality Gate passedIssues Measures |
…in upstream auth configuration strings" (#6702) (#6703) ### **User description** Revert "[TT-13422] Do not allow empty string in upstream auth configuration strings" (#6702) Reverts #6699 temporary revert with common change for AuthSource [TT-13422]: https://tyktech.atlassian.net/browse/TT-13422?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** enhancement, bug fix ___ ### **Description** - Reverted the enforcement of non-empty strings for certain fields in the OpenAPI Specification (OAS) schema. - Introduced a new definition `X-Tyk-UpstreamAuthSource` to replace `X-Tyk-AuthSource` in specific schema fields. - Updated schema references to use `X-Tyk-UpstreamAuthSource` instead of `X-Tyk-AuthSource`. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Revert non-empty string enforcement and update auth source references</code></dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <li>Reverted the use of <code>X-Tyk-NonEmptyString</code> for certain fields.<br> <li> Introduced a new definition <code>X-Tyk-UpstreamAuthSource</code>.<br> <li> Updated references from <code>X-Tyk-AuthSource</code> to <code>X-Tyk-UpstreamAuthSource</code>.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6703/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+15/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information Co-authored-by: Jeffy Mathew <[email protected]>
…g in upstream auth configuration strings" (#6702) (#6704) ### **User description** Revert "[TT-13422] Do not allow empty string in upstream auth configuration strings" (#6702) Reverts #6699 temporary revert with common change for AuthSource [TT-13422]: https://tyktech.atlassian.net/browse/TT-13422?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** enhancement, bug fix ___ ### **Description** - Reverted changes that enforced non-empty strings in the OpenAPI Specification (OAS) schema, specifically for the `name` property in `X-Tyk-AuthSource`. - Adjusted references for `header` properties in various authentication objects to use `X-Tyk-UpstreamAuthSource`. - Reintroduced the `X-Tyk-UpstreamAuthSource` definition to align with previous configurations. ___ ### **Changes walkthrough** 📝 <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>Revert non-empty string enforcement and adjust AuthSource references</code></dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <li>Reverted the <code>name</code> property in <code>X-Tyk-AuthSource</code> to use <code>type: string</code> <br>instead of <code>X-Tyk-NonEmptyString</code>.<br> <li> Changed <code>$ref</code> for <code>header</code> in <code>X-Tyk-UpstreamBasicAuthentication</code> and other <br>sections to <code>X-Tyk-UpstreamAuthSource</code>.<br> <li> Reintroduced <code>X-Tyk-UpstreamAuthSource</code> definition with <code>name</code> as a string <br>type.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6704/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+15/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information Co-authored-by: Jeffy Mathew <[email protected]>
User description
TT-13422
Description
This PR updates OAS schema to not allow empty string in string data type configurations.
It also removes unused
headerName
field from upstream OAuth client credentials.Related Issue
https://tyktech.atlassian.net/browse/TT-13422
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
enhancement, bug fix
Description
HeaderName
field from theClientCredentials
struct inupstream.go
.X-Tyk-NonEmptyString
.X-Tyk-NonEmptyString
to relevant fields in the schema to prevent empty string configurations.Changes walkthrough 📝
upstream.go
Remove unused HeaderName field from ClientCredentials struct
apidef/oas/upstream.go
HeaderName
field from theClientCredentials
struct.x-tyk-api-gateway.json
Enforce non-empty strings in OAS schema
apidef/oas/schema/x-tyk-api-gateway.json
X-Tyk-NonEmptyString
for string fields.X-Tyk-NonEmptyString
to enforce non-emptystrings.