diff --git a/ovara-backend/src/main/scala/fi/oph/ovara/backend/security/CasConfig.scala b/ovara-backend/src/main/scala/fi/oph/ovara/backend/security/SecurityConfig.scala similarity index 94% rename from ovara-backend/src/main/scala/fi/oph/ovara/backend/security/CasConfig.scala rename to ovara-backend/src/main/scala/fi/oph/ovara/backend/security/SecurityConfig.scala index 0e33b7a..f42aea5 100644 --- a/ovara-backend/src/main/scala/fi/oph/ovara/backend/security/CasConfig.scala +++ b/ovara-backend/src/main/scala/fi/oph/ovara/backend/security/SecurityConfig.scala @@ -22,7 +22,7 @@ import org.springframework.security.web.authentication.HttpStatusEntryPoint @Configuration @EnableWebSecurity -class CasConfig { +class SecurityConfig { @Value("${cas.url}") val cas_url: String = null @@ -116,6 +116,16 @@ class CasConfig { .build() } + @Bean + @Order(3) + def healthcheckFilterChain(http: HttpSecurity): SecurityFilterChain = { + http + .securityMatcher("/api/healthcheck") + .authorizeHttpRequests(requests => requests.anyRequest.permitAll) + .csrf(c => c.disable) + .build() + } + @Bean @Order(1) def csrfFilterChain(http: HttpSecurity): SecurityFilterChain = {