FormLoginBuilder->FormLoginSpec

Issue: gh-4822
This commit is contained in:
Rob Winch 2017-11-13 15:59:37 -06:00
parent 83d4abb1c6
commit 7619556066
1 changed files with 12 additions and 12 deletions

View File

@ -107,7 +107,7 @@ public class ServerHttpSecurity {
private final RequestCacheSpec requestCache = new RequestCacheSpec(); private final RequestCacheSpec requestCache = new RequestCacheSpec();
private FormLoginBuilder formLogin; private FormLoginSpec formLogin;
private LogoutBuilder logout = new LogoutBuilder(); private LogoutBuilder logout = new LogoutBuilder();
@ -168,9 +168,9 @@ public class ServerHttpSecurity {
return this.httpBasic; return this.httpBasic;
} }
public FormLoginBuilder formLogin() { public FormLoginSpec formLogin() {
if(this.formLogin == null) { if(this.formLogin == null) {
this.formLogin = new FormLoginBuilder(); this.formLogin = new FormLoginSpec();
} }
return this.formLogin; return this.formLogin;
} }
@ -528,7 +528,7 @@ public class ServerHttpSecurity {
* @author Rob Winch * @author Rob Winch
* @since 5.0 * @since 5.0
*/ */
public class FormLoginBuilder { public class FormLoginSpec {
private final RedirectServerAuthenticationSuccessHandler defaultSuccessHandler = new RedirectServerAuthenticationSuccessHandler("/"); private final RedirectServerAuthenticationSuccessHandler defaultSuccessHandler = new RedirectServerAuthenticationSuccessHandler("/");
private RedirectServerAuthenticationEntryPoint defaultEntryPoint; private RedirectServerAuthenticationEntryPoint defaultEntryPoint;
@ -545,19 +545,19 @@ public class ServerHttpSecurity {
private ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler = this.defaultSuccessHandler; private ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler = this.defaultSuccessHandler;
public FormLoginBuilder authenticationManager(ReactiveAuthenticationManager authenticationManager) { public FormLoginSpec authenticationManager(ReactiveAuthenticationManager authenticationManager) {
this.authenticationManager = authenticationManager; this.authenticationManager = authenticationManager;
return this; return this;
} }
public FormLoginBuilder serverAuthenticationSuccessHandler( public FormLoginSpec serverAuthenticationSuccessHandler(
ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler) { ServerAuthenticationSuccessHandler serverAuthenticationSuccessHandler) {
Assert.notNull(serverAuthenticationSuccessHandler, "serverAuthenticationSuccessHandler cannot be null"); Assert.notNull(serverAuthenticationSuccessHandler, "serverAuthenticationSuccessHandler cannot be null");
this.serverAuthenticationSuccessHandler = serverAuthenticationSuccessHandler; this.serverAuthenticationSuccessHandler = serverAuthenticationSuccessHandler;
return this; return this;
} }
public FormLoginBuilder loginPage(String loginPage) { public FormLoginSpec loginPage(String loginPage) {
this.defaultEntryPoint = new RedirectServerAuthenticationEntryPoint(loginPage); this.defaultEntryPoint = new RedirectServerAuthenticationEntryPoint(loginPage);
this.serverAuthenticationEntryPoint = this.defaultEntryPoint; this.serverAuthenticationEntryPoint = this.defaultEntryPoint;
this.requiresAuthenticationMatcher = ServerWebExchangeMatchers.pathMatchers(HttpMethod.POST, loginPage); this.requiresAuthenticationMatcher = ServerWebExchangeMatchers.pathMatchers(HttpMethod.POST, loginPage);
@ -565,22 +565,22 @@ public class ServerHttpSecurity {
return this; return this;
} }
public FormLoginBuilder authenticationEntryPoint(ServerAuthenticationEntryPoint serverAuthenticationEntryPoint) { public FormLoginSpec authenticationEntryPoint(ServerAuthenticationEntryPoint serverAuthenticationEntryPoint) {
this.serverAuthenticationEntryPoint = serverAuthenticationEntryPoint; this.serverAuthenticationEntryPoint = serverAuthenticationEntryPoint;
return this; return this;
} }
public FormLoginBuilder requiresAuthenticationMatcher(ServerWebExchangeMatcher requiresAuthenticationMatcher) { public FormLoginSpec requiresAuthenticationMatcher(ServerWebExchangeMatcher requiresAuthenticationMatcher) {
this.requiresAuthenticationMatcher = requiresAuthenticationMatcher; this.requiresAuthenticationMatcher = requiresAuthenticationMatcher;
return this; return this;
} }
public FormLoginBuilder authenticationFailureHandler(ServerAuthenticationFailureHandler serverAuthenticationFailureHandler) { public FormLoginSpec authenticationFailureHandler(ServerAuthenticationFailureHandler serverAuthenticationFailureHandler) {
this.serverAuthenticationFailureHandler = serverAuthenticationFailureHandler; this.serverAuthenticationFailureHandler = serverAuthenticationFailureHandler;
return this; return this;
} }
public FormLoginBuilder securityContextRepository(ServerSecurityContextRepository serverSecurityContextRepository) { public FormLoginSpec securityContextRepository(ServerSecurityContextRepository serverSecurityContextRepository) {
this.serverSecurityContextRepository = serverSecurityContextRepository; this.serverSecurityContextRepository = serverSecurityContextRepository;
return this; return this;
} }
@ -619,7 +619,7 @@ public class ServerHttpSecurity {
http.addFilterAt(authenticationFilter, SecurityWebFiltersOrder.FORM_LOGIN); http.addFilterAt(authenticationFilter, SecurityWebFiltersOrder.FORM_LOGIN);
} }
private FormLoginBuilder() { private FormLoginSpec() {
} }
} }