Skip to content

Commit

Permalink
Korjauksia
Browse files Browse the repository at this point in the history
  • Loading branch information
augustk committed Dec 3, 2024
1 parent 7b2801a commit 7bc5a62
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>httpclient</artifactId>
<version>0.4.1-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.asynchttpclient</groupId>
Expand Down Expand Up @@ -282,7 +282,7 @@
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>opintopolku-cas-servlet-filter</artifactId>
<version>0.1.2-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
2 changes: 1 addition & 1 deletion valintaperusteet-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>java-properties</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.asynchttpclient</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;

@Profile("!dev")
Expand Down Expand Up @@ -117,25 +118,35 @@ public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
@Bean
public SecurityFilterChain filterChain(
HttpSecurity http, CasAuthenticationFilter casAuthenticationFilter) throws Exception {
http.headers(headers -> headers.disable())
.csrf(csrf -> csrf.disable())
.authorizeRequests()
.requestMatchers(
"/buildversion.txt",
"/actuator/health",
"/v3/api-docs",
"/v3/api-docs/**",
"/swagger",
"/swagger/**",
"/swagger-ui/**",
"/swagger-ui.html",
"/webjars/swagger-ui/**",
"/index.html",
"/")
.permitAll()
.anyRequest()
.authenticated()
.and()
http.headers(AbstractHttpConfigurer::disable)
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(
(authorizeHttpRequests) ->
authorizeHttpRequests
.requestMatchers("/buildversion.txt")
.permitAll()
.requestMatchers("/actuator/health")
.permitAll()
.requestMatchers("/v3/api-docs")
.permitAll()
.requestMatchers("/v3/api-docs/**")
.permitAll()
.requestMatchers("/swagger")
.permitAll()
.requestMatchers("/swagger**")
.permitAll()
.requestMatchers("/swagger-ui/**")
.permitAll()
.requestMatchers("/swagger-ui.html")
.permitAll()
.requestMatchers("/webjars/swagger-ui/**")
.permitAll()
.requestMatchers("/index.html")
.permitAll()
.requestMatchers("/")
.permitAll()
.anyRequest()
.authenticated())
.addFilter(casAuthenticationFilter)
.exceptionHandling(eh -> eh.authenticationEntryPoint(casAuthenticationEntryPoint()))
.addFilterBefore(singleSignOutFilter(), CasAuthenticationFilter.class);
Expand Down

0 comments on commit 7bc5a62

Please sign in to comment.