ru.vyukov.anotherliverefresh.autoconfigure.AnotherLiveRefreshSpringSecurityAutoConfiguration Maven / Gradle / Ivy
package ru.vyukov.anotherliverefresh.autoconfigure;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.WebSecurityConfigurer;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import lombok.extern.slf4j.Slf4j;
import ru.vyukov.anotherliverefresh.ws.LiveRefreshConnectionHandler;
@Configuration
@ConditionalOnClass(WebSecurityConfigurer.class)
@ConditionalOnBean(LiveRefreshConnectionHandler.class)
@Slf4j
public class AnotherLiveRefreshSpringSecurityAutoConfiguration implements WebSecurityConfigurer {
@Override
public void init(WebSecurity builder) throws Exception {
;//
}
@Override
public void configure(WebSecurity builder) throws Exception {
log.debug("/refresh.js add ignore spring security");
builder.ignoring().antMatchers("/alr/refresh.js", "/alr/help.html", "/alr/refresh");
}
}