-
Notifications
You must be signed in to change notification settings - Fork 41
middleware added through FilterConfig for JWT Token Validation. #87
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
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 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -218,6 +218,40 @@ | |||||||||||||||||||||
| <artifactId>spring-web</artifactId> | ||||||||||||||||||||||
| <version>6.1.12</version> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <!-- Jersey JSON Processing --> | ||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||
| <groupId>org.glassfish.jersey.media</groupId> | ||||||||||||||||||||||
| <artifactId>jersey-media-json-processing</artifactId> | ||||||||||||||||||||||
| <version>2.30.1</version> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <!-- JAXB Runtime Implementation --> | ||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||
| <groupId>org.glassfish.jaxb</groupId> | ||||||||||||||||||||||
| <artifactId>jaxb-runtime</artifactId> | ||||||||||||||||||||||
| <version>2.3.1</version> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
|
Comment on lines
+230
to
+234
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 Update JAXB Runtime version for compatibility. The project is using JAXB Runtime 2.3.1, which is quite old and may not be fully compatible with Jakarta EE in Spring Boot 3.x. Spring Boot 3 uses Jakarta EE 9+ which requires newer JAXB versions. Consider updating to a newer version that aligns with Jakarta EE: <dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
- <version>2.3.1</version>
+ <version>4.0.0</version>
</dependency>π Committable suggestion
Suggested change
|
||||||||||||||||||||||
| <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api --> | ||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||
| <groupId>io.jsonwebtoken</groupId> | ||||||||||||||||||||||
| <artifactId>jjwt-api</artifactId> | ||||||||||||||||||||||
| <version>0.12.6</version> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
| <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-impl --> | ||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||
| <groupId>io.jsonwebtoken</groupId> | ||||||||||||||||||||||
| <artifactId>jjwt-impl</artifactId> | ||||||||||||||||||||||
| <version>0.12.6</version> | ||||||||||||||||||||||
| <scope>runtime</scope> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
| <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-jackson --> | ||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||
| <groupId>io.jsonwebtoken</groupId> | ||||||||||||||||||||||
| <artifactId>jjwt-jackson</artifactId> | ||||||||||||||||||||||
| <version>0.12.6</version> | ||||||||||||||||||||||
| <scope>runtime</scope> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
| <!--END NEW DEPENDENCIES ADDED--> | ||||||||||||||||||||||
| </dependencies> | ||||||||||||||||||||||
| <profiles> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.iemr.common.identity.config; | ||
|
|
||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
|
||
| @Configuration | ||
| public class CorsConfig implements WebMvcConfigurer { | ||
|
|
||
| @Value("${cors.allowed-origins}") | ||
| private String allowedOrigins; | ||
|
|
||
| @Override | ||
| public void addCorsMappings(CorsRegistry registry) { | ||
| registry.addMapping("/**") | ||
| .allowedOrigins(allowedOrigins.split(",")) | ||
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") | ||
| .allowedHeaders("*") | ||
| .exposedHeaders("Authorization", "Jwttoken") // Explicitly expose headers if needed | ||
| .allowCredentials(true) | ||
| .maxAge(3600) | ||
| ; | ||
| } | ||
| } |
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.
π οΈ Refactor suggestion
Update Jersey JSON Processing version for compatibility.
The version of jersey-media-json-processing (2.30.1) is outdated and may have compatibility issues with Spring Boot 3.x and Jakarta EE.
Consider updating to a version that supports Jakarta EE:
<dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-json-processing</artifactId> - <version>2.30.1</version> + <version>3.1.3</version> </dependency>π Committable suggestion