jwt_authn refactory: move threadlocal from JwksCache into JwksDataImpl#16109
Merged
lizan merged 3 commits intoenvoyproxy:mainfrom Apr 23, 2021
Merged
jwt_authn refactory: move threadlocal from JwksCache into JwksDataImpl#16109lizan merged 3 commits intoenvoyproxy:mainfrom
lizan merged 3 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
Contributor
Author
|
@yangminzhu @nareddyt @TAOXUY could you help to review this PR? |
TAOXUY
approved these changes
Apr 22, 2021
nareddyt
approved these changes
Apr 22, 2021
lizan
approved these changes
Apr 23, 2021
Merged
htuch
reviewed
Apr 26, 2021
| // Set jwks shared_ptr to all threads. | ||
| void setJwksToAllThreads(::google::jwt_verify::JwksPtr&& jwks, | ||
| std::chrono::steady_clock::time_point expire) { | ||
| JwksSharedPtr shared_jwks(jwks.release()); |
Member
There was a problem hiding this comment.
@qiwzhang how come this isn't a const shared pointer?
Contributor
Author
There was a problem hiding this comment.
It should be. I will update it in the next pr. Thanks.
gokulnair
pushed a commit
to gokulnair/envoy
that referenced
this pull request
May 6, 2021
envoyproxy#16109) This change will not change the functionality, it just changes the internal implementation detail. JwKsCache holds both config and cache. Currently, the whole JwksCache object is in the thread local slot, but actually, only the cache data needs to be in in the thread local. This change will move the thread local data inside JwksDataImpl, only stores its {jwks, and expire} into thread local. Move JwksCache object out of thread local. This change is in preparation to support async fetch of remote_jwks proposed in envoyproxy#14556 (comment). Detail changes: * Created `tls` for {jwks, expire} inside JwksDataImpl * Removed `tls` for JwksCache in FilterConfigImpl * Removed `enable_shared_from_this` from FilterConfigImpl Risk Level: Low Testing: Unit-tested. Docs Changes: None Release Notes: None Signed-off-by: Wayne Zhang <qiwzhang@google.com> Signed-off-by: Gokul Nair <gnair@twitter.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change will not change the functionality, it just changes the internal implementation detail.
JwKsCache holds both config and cache. Currently, the whole JwksCache object is in the thread local slot, but actually, only the cache data needs to be in in the thread local.
This change will move the thread local data inside JwksDataImpl, only stores its {jwks, and expire} into thread local. Move JwksCache object out of thread local.
This change is in preparation to support async fetch of remote_jwks proposed in #14556 (comment).
Detail changes:
tlsfor {jwks, expire} inside JwksDataImpltlsfor JwksCache in FilterConfigImplenable_shared_from_thisfrom FilterConfigImplRisk Level: Low
Testing: Unit-tested.
Docs Changes: None
Release Notes: None