Modify formatting.

This commit is contained in:
tschiman 2016-10-24 21:26:14 -06:00
parent b48cf1e1ce
commit e6b8446dd3
2 changed files with 24 additions and 29 deletions

View File

@ -36,11 +36,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
//no order tag means this is the last security filter to be evaluated //no order tag means this is the last security filter to be evaluated
public static class AdminSecurityConfig extends WebSecurityConfigurerAdapter { public static class AdminSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication();
}
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http http

View File

@ -14,34 +14,34 @@ import javax.servlet.http.HttpSession;
@Component @Component
public class SessionSavingZuulPreFilter extends ZuulFilter { public class SessionSavingZuulPreFilter extends ZuulFilter {
private Logger log = LoggerFactory.getLogger(this.getClass()); private Logger log = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SessionRepository repository; private SessionRepository repository;
@Override public boolean shouldFilter() { @Override
return true; public boolean shouldFilter() {
} return true;
}
@Override @Override
public Object run() { public Object run() {
RequestContext context = RequestContext.getCurrentContext(); RequestContext context = RequestContext.getCurrentContext();
HttpSession httpSession = context.getRequest().getSession();
Session session = repository.getSession(httpSession.getId());
HttpSession httpSession = context.getRequest().getSession(); context.addZuulRequestHeader("Cookie", "SESSION=" + httpSession.getId());
Session session = repository.getSession(httpSession.getId()); log.info("ZuulPreFilter session proxy: {}", session.getId());
return null;
}
context.addZuulRequestHeader("Cookie", "SESSION=" + httpSession.getId()); @Override
public String filterType() {
return "pre";
}
log.info("ZuulPreFilter session proxy: {}", session.getId()); @Override
public int filterOrder() {
return null; return 0;
} }
@Override public String filterType() {
return "pre";
}
@Override public int filterOrder() {
return 0;
}
} }