Closed buger closed 4 weeks ago
API Changes
--- prev.txt 2024-10-31 14:27:41.398260857 +0000
+++ current.txt 2024-10-31 14:27:38.490272916 +0000
@@ -1593,6 +1593,10 @@
Providers []OIDProviderConfig `bson:"providers" json:"providers"`
SegregateByClient bool `bson:"segregate_by_client" json:"segregate_by_client"`
}
+ OpenID Connect middleware support will be deprecated
+ starting from 5.7.0. To avoid any disruptions, we recommend
+ that you use JSON Web Token (JWT) instead, as explained in
+ https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/openid-connect/.
type PersistGraphQLMeta struct {
Path string `bson:"path" json:"path"`
@@ -3485,7 +3489,10 @@
// Scopes contains the defined scope claims.
Scopes *Scopes `bson:"scopes,omitempty" json:"scopes,omitempty"`
}
- OIDC contains configuration for the OIDC authentication mode.
+ OIDC contains configuration for the OIDC authentication mode. OIDC
+ support will be deprecated starting from 5.7.0. To avoid any disruptions,
+ we recommend that you use JSON Web Token (JWT) instead, as explained in
+ https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/openid-connect/.
func (o *OIDC) ExtractTo(api *apidef.APIDefinition)
ExtractTo extracts *OIDC to *apidef.APIDefinition.
Here are some key observations to aid the review process:
**๐ซ Ticket compliance analysis โ ** **[6686](https://github.com/TykTechnologies/tyk/issues/6686) - Fully compliant** Fully compliant requirements: - Add warning message in GW logs, schema, and go docs for deprecating OIDC middleware. - Recommend using JSON Web Token (JWT) as an alternative. |
โฑ๏ธ Estimated effort to review: 2 ๐ต๐ตโชโชโช |
๐งช No relevant tests |
๐ No security concerns identified |
โก Recommended focus areas for review Deprecation Notice Ensure the deprecation notice for OpenID Connect middleware is clear and provides all necessary information for migration to JWT. Deprecation Notice Verify the deprecation notice for OIDC authentication mode is accurate and guides users effectively towards using JWT. Log Warning Check the log warning for deprecated OpenID Connect Middleware to ensure it's triggered under the correct conditions and is informative. Schema Update Confirm the schema update includes a clear deprecation notice for external OAuth Middleware and directs users appropriately to JWT. |
Explore these optional code suggestions:
Category | Suggestion | Score |
Possible issue |
Add a return statement to halt further execution after a deprecation warning if OpenID Connect Middleware is enabled___ **Consider adding a return statement after logging the deprecation warning to preventfurther execution when OpenID Connect Middleware is enabled.** [gateway/mw_openid.go [34-36]](https://github.com/TykTechnologies/tyk/pull/6687/files#diff-a389c2a490b728d3bf6ed64f974b227117fb451aa2da8ce8df8c859e7cdc718aR34-R36) ```diff if k.Spec.UseOpenID { log.Warn("Support for OpenID Connect Middleware will be deprecated starting from 5.7.0. To avoid any disruptions, we recommend that you use JSON Web Token (JWT) instead, as explained in https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/openid-connect/") + return false } ``` Suggestion importance[1-10]: 8Why: The suggestion to add a return statement after logging the deprecation warning is valid and impactful. It prevents further execution when OpenID Connect Middleware is enabled, aligning with the deprecation notice and encouraging users to switch to JWT, thus avoiding potential issues with deprecated functionality. | 8 |
Failed conditions
50.0% Coverage on New Code (required โฅ 80%)
C Reliability Rating on New Code (required โฅ A)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension SonarLint
User description
[TT-11426/TT-13322]add deprecation notice for oidc middleware (#6686)
User description
TT-13322
Description
Related Issue
Parent: https://tyktech.atlassian.net/browse/TT-11426 Subtask: https://tyktech.atlassian.net/browse/TT-13322
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
documentation, enhancement
Description
Changes walkthrough ๐
api_definitions.go
Add deprecation notice for OpenID Connect middleware
apidef/api_definitions.go
authentication.go
Add deprecation notice for OIDC authentication mode
apidef/oas/authentication.go
x-tyk-api-gateway.json
Add deprecation notice for external OAuth Middleware
apidef/oas/schema/x-tyk-api-gateway.json
mw_openid.go
Add log warning for deprecated OpenID Connect Middleware
gateway/mw_openid.go
PR Type
Documentation, Enhancement
Description
Changes walkthrough ๐
api_definitions.go
Add deprecation notice for OpenID Connect middleware
apidef/api_definitions.go
authentication.go
Add deprecation notice for OIDC authentication mode
apidef/oas/authentication.go
x-tyk-api-gateway.json
Add deprecation notice for external OAuth Middleware
apidef/oas/schema/x-tyk-api-gateway.json
mw_openid.go
Add log warning for deprecated OpenID Connect Middleware
gateway/mw_openid.go