-
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-13271, fix for token metadata not being cached #6689
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-01 11:44:59.856077740 +0000
+++ current.txt 2024-11-01 11:44:53.239953337 +0000
@@ -11374,6 +11374,11 @@
Form map[string]string
}
+type TokenData struct {
+ Token string `json:"token"`
+ ExtraMetadata map[string]interface{} `json:"extra_metadata"`
+}
+
type TraceMiddleware struct {
TykMiddleware
} |
Quality Gate failedFailed conditions |
User description
Currently when the token is cached into redis we are not cacheing the extra metadata so only the initial request gets populated with the requiered fields.
TT-13271
Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
enhancement, bug fix
Description
TokenData
struct to encapsulate token and extra metadata, improving the structure and readability of the code.createTokenDataBytes
andunmarshalTokenData
to handle JSON marshaling and unmarshaling of token data, enhancing the robustness of data handling.Changes walkthrough 📝
mw_oauth2_auth.go
Improve token caching and metadata handling in OAuth2
gateway/mw_oauth2_auth.go
TokenData
struct to handle token and metadata.