Commit 73c412f4 authored by cizek's avatar cizek
Browse files

fixed auth on static files

parent b8cf7414
...@@ -10,6 +10,7 @@ import org.springframework.security.authentication.AuthenticationCredentialsNotF ...@@ -10,6 +10,7 @@ import org.springframework.security.authentication.AuthenticationCredentialsNotF
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
...@@ -20,10 +21,7 @@ import org.springframework.web.filter.CorsFilter; ...@@ -20,10 +21,7 @@ import org.springframework.web.filter.CorsFilter;
import java.util.Optional; import java.util.Optional;
import static cz.fi.muni.pa165.flea.market.manager.config.PathsConfig.MARKET_EVENT; import static cz.fi.muni.pa165.flea.market.manager.config.PathsConfig.*;
import static cz.fi.muni.pa165.flea.market.manager.config.PathsConfig.SESSION;
import static cz.fi.muni.pa165.flea.market.manager.config.PathsConfig.STAND;
import static cz.fi.muni.pa165.flea.market.manager.config.PathsConfig.USER;
/** /**
* Security configuration for the app * Security configuration for the app
...@@ -63,7 +61,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -63,7 +61,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.GET, API_DOCS).permitAll() .antMatchers(HttpMethod.GET, API_DOCS).permitAll()
.antMatchers(HttpMethod.GET, MARKET_EVENT + "/list").permitAll() .antMatchers(HttpMethod.GET, MARKET_EVENT + "/list").permitAll()
.antMatchers(HttpMethod.GET, STAND).permitAll() .antMatchers(HttpMethod.GET, STAND).permitAll()
.anyRequest().authenticated() .antMatchers(REST_ROOT).authenticated()
.and() .and()
.addFilterBefore(authFilter, UsernamePasswordAuthenticationFilter.class); .addFilterBefore(authFilter, UsernamePasswordAuthenticationFilter.class);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment