-
Notifications
You must be signed in to change notification settings - Fork 49
jwt api implementation #138
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
Changes from all commits
1390ab2
f5e8a5c
d0c29af
b2452ff
1323c41
b760ebc
a31cbe6
5309ce0
016785e
489f5cd
300d192
3af38fe
022f839
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,14 +22,18 @@ | |
| package com.iemr.common; | ||
|
|
||
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.AutoConfiguration; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| import org.springframework.boot.builder.SpringApplicationBuilder; | ||
| import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
| import org.springframework.data.redis.core.RedisTemplate; | ||
| import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; | ||
| import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
| import org.springframework.scheduling.annotation.EnableScheduling; | ||
| import org.springframework.web.client.RestTemplate; | ||
|
|
||
| import com.iemr.common.data.users.User; | ||
| import com.iemr.common.utils.IEMRApplBeans; | ||
|
|
||
| @SpringBootApplication | ||
|
|
@@ -41,11 +45,11 @@ public IEMRApplBeans instantiateBeans() { | |
| return new IEMRApplBeans(); | ||
| } | ||
|
|
||
| @Bean | ||
| public RestTemplate restTemplate() { | ||
| return new RestTemplate(); | ||
| } | ||
| @Bean | ||
| public RestTemplate restTemplate() { | ||
| return new RestTemplate(); | ||
| } | ||
|
|
||
| public static void main(String[] args) { | ||
| SpringApplication.run(CommonApplication.class, args); | ||
| } | ||
|
|
@@ -54,4 +58,19 @@ protected SpringApplicationBuilder configure(SpringApplicationBuilder applicatio | |
| return application.sources(new Class[] { CommonApplication.class }); | ||
| } | ||
|
|
||
| @Bean | ||
| public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) { | ||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | ||
| template.setConnectionFactory(factory); | ||
|
|
||
| // Use StringRedisSerializer for keys (userId) | ||
| template.setKeySerializer(new StringRedisSerializer()); | ||
|
|
||
| // Use Jackson2JsonRedisSerializer for values (Users objects) | ||
| Jackson2JsonRedisSerializer<User> serializer = new Jackson2JsonRedisSerializer<>(User.class); | ||
| template.setValueSerializer(serializer); | ||
|
|
||
| return template; | ||
| } | ||
|
Comment on lines
+61
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Promote type-safety in the Redis template. Although defining
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not required
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rate Limit Exceeded@indraniBan have exceeded the limit for the number of chat messages per hour. Please wait 0 minutes and 33 seconds before sending another message. |
||
|
|
||
| } | ||
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.
π‘ Codebase verification
π οΈ Refactor suggestion
Jersey dependencies need upgrade for Spring Boot 3.x compatibility
The project is using Spring Boot 3.2.2 which requires Jakarta EE, but the current Jersey dependencies (2.30.1) are using the older javax namespace. This is confirmed by:
The original review comment is correct. You should upgrade to Jersey 3.x as it's compatible with Jakarta EE and Spring Boot 3.x. Specifically:
π Analysis chain
Review Jersey dependency versions for compatibility
The Jersey dependencies are using version 2.30.1, which might be outdated compared to the project's Spring Boot version (3.2.2). Consider upgrading to a newer version that's compatible with Jakarta EE.
Consider upgrading Jersey dependencies to version 3.x to align with Jakarta EE:
The previous command didn't work well, so let's try to gather more context about the project's dependencies and Spring Boot version to make an informed decision about Jersey compatibility.
π Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 29
Script:
Length of output: 2470