-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-214: [feat] Change ports for easy testability and include actuator…
… endpoint in all services.
- Loading branch information
1 parent
aa172ec
commit fea6dc4
Showing
11 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
40 changes: 40 additions & 0 deletions
40
...ervices/email-service/src/main/java/app/sportahub/emailservice/config/SecurityConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package app.sportahub.emailservice.config; | ||
|
||
|
||
import lombok.SneakyThrows; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@EnableWebSecurity | ||
@EnableMethodSecurity(prePostEnabled = true) | ||
public class SecurityConfig { | ||
|
||
@Bean | ||
public JwtAuthenticationConverter jwtAuthenticationConverter() { | ||
return KeycloakJwtAuthenticationConverter.jwtAuthenticationConverter(); | ||
} | ||
|
||
@SneakyThrows | ||
@Bean | ||
public SecurityFilterChain securityFilterChain(HttpSecurity http) { | ||
return http | ||
.authorizeHttpRequests(authorizeRequests -> authorizeRequests | ||
.requestMatchers( | ||
"/swagger-ui.html", | ||
"/api-docs", | ||
"/api-docs/**", | ||
"/swagger-ui/**", | ||
"/webjars/**", | ||
"/actuator/**") | ||
.permitAll() | ||
.anyRequest().authenticated()) | ||
.csrf(AbstractHttpConfigurer::disable) | ||
.oauth2Login(Customizer.withDefaults()) | ||
.oauth2ResourceServer(oauth2 -> oauth2 | ||
.jwt(jwt -> jwt | ||
.jwtAuthenticationConverter( | ||
jwtAuthenticationConverter()))) | ||
.build(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
Microservices/email-service/src/main/resources/application.properties
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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