Skip to content

Commit eff5e90

Browse files
authored
Merging to release-5.8: [TT-14829] Added External OAuth Deprecated mark in godoc (#7050)
[TT-14829] Added External OAuth Deprecated mark in godoc (#7050) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14829" title="TT-14829" target="_blank">TT-14829</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Add deprecated go doc to External Oauth field in API Definition</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>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ### **PR Type** documentation ___ ### **Description** - Added deprecation notice to `ExternalOAuthType` constant. - Updated GoDoc for `ExternalOAuth` to indicate deprecation. - Provided migration guidance to use JWT instead. - Linked to documentation for further details. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>api_definitions.go</strong><dd><code>Add deprecation notice to ExternalOAuthType constant</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> apidef/api_definitions.go <li>Added deprecation GoDoc to <code>ExternalOAuthType</code> constant.<br> <li> Explained deprecation and recommended JWT as alternative.<br> <li> Linked to relevant documentation for migration. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7050/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+11/-6</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>security.go</strong><dd><code>Add deprecation notice to ExternalOAuth struct documentation</code></dd></summary> <hr> apidef/oas/security.go <li>Added deprecation GoDoc to <code>ExternalOAuth</code> struct.<br> <li> Provided migration advice and documentation link. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7050/files#diff-15e7d47137452ca4f3f6139aa8c007cdb426152c41846f712f8bf5dfb607afcc">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
1 parent 9c002c9 commit eff5e90

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

apidef/api_definitions.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,23 @@ const (
111111
DefaultAPIVersionKey = "x-api-version"
112112
HeaderBaseAPIID = "x-tyk-base-api-id"
113113

114-
AuthTokenType = "authToken"
115-
JWTType = "jwt"
116-
HMACType = "hmac"
117-
BasicType = "basic"
118-
CoprocessType = "coprocess"
119-
OAuthType = "oauth"
114+
AuthTokenType = "authToken"
115+
JWTType = "jwt"
116+
HMACType = "hmac"
117+
BasicType = "basic"
118+
CoprocessType = "coprocess"
119+
OAuthType = "oauth"
120+
// ExternalOAuthType holds configuration for an external OAuth provider.
121+
// Deprecated: ExternalOAuth support has been deprecated from 5.7.0.
122+
// To avoid any disruptions, we recommend that you use JSON Web Token (JWT) instead,
123+
// as explained in https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/ext-oauth-middleware/.
120124
ExternalOAuthType = "externalOAuth"
121-
OIDCType = "oidc"
125+
// OIDCType holds configuration for OpenID Connect.
126+
// Deprecated: OIDC support has been deprecated from 5.7.0.
127+
// To avoid any disruptions, we recommend that you use JSON Web Token (JWT) instead,
128+
// as explained in https://tyk.io/docs/api-management/client-authentication/#integrate-with-openid-connect-deprecated.
129+
130+
OIDCType = "oidc"
122131

123132
// OAuthAuthorizationTypeClientCredentials is the authorization type for client credentials flow.
124133
OAuthAuthorizationTypeClientCredentials = "clientCredentials"

apidef/oas/security.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ func (c *IntrospectionCache) ExtractTo(cache *apidef.IntrospectionCache) {
634634
}
635635

636636
// ExternalOAuth holds configuration for an external OAuth provider.
637-
// ExternalOAuth support will be deprecated starting from 5.7.0.
637+
// Deprecated: ExternalOAuth support has been deprecated from 5.7.0.
638638
// To avoid any disruptions, we recommend that you use JSON Web Token (JWT) instead,
639639
// as explained in https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/ext-oauth-middleware/.
640640
type ExternalOAuth struct {
@@ -853,7 +853,10 @@ func resetSecuritySchemes(api *apidef.APIDefinition) {
853853
// External OAuth
854854
api.ExternalOAuth = apidef.ExternalOAuth{}
855855

856-
// OIDC
856+
// OIDC holds configuration for OpenID Connect.
857+
// Deprecated: OIDC support has been deprecated from 5.7.0.
858+
// To avoid any disruptions, we recommend that you use JSON Web Token (JWT) instead,
859+
// as explained in https://tyk.io/docs/api-management/client-authentication/#integrate-with-openid-connect-deprecated.
857860
api.UseOpenID = false
858861
api.Scopes.OIDC = apidef.ScopeClaim{}
859862
api.OpenIDOptions = apidef.OpenIDOptions{}

0 commit comments

Comments
 (0)