-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix Jwts usage to get rid of the deprecation warning #11500
Fix Jwts usage to get rid of the deprecation warning #11500
Conversation
The changes are trivial but I'm afraid I'll need some guidance to comply with the requirements. |
@@ -100,8 +100,9 @@ public class TokenProvider { | |||
} | |||
|
|||
public Authentication getAuthentication(String token) { | |||
Claims claims = Jwts.parser() | |||
Claims claims = Jwts.parserBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you want to reuse the parser parserBuilder()...build()
when possible. (and only incur the cost of construction once)
Maybe stick it in the PostConstruct above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right @bdemers, I guess I was too focused in the deprecation warning and absolutely not in the performance.
nit: |
The performance point is very interesting! Indeed |
@dschulz is that fine to make this PR "ready for review"? It's currently in draft mode. |
@pascalgrimaud We should consider this PR for this build? |
@DanielFran : not for this build, but for this release, you mean ? In this case, yes, I'm short on time to test everything but I'll trust on the daily builds this night |
Yes, for the release of course 😴😂 |
@jdubois Did you test this changes? |
jjwt project has deprecated the
Jwts.parser()
method in favor ofJwts.parserBuilder()
some months ago. This patch corrects the relevant code to use the updated versions and avoids the deprecation warning.More info: jwtk/jjwt#499