Use parenthesis with single-arg lambdas
Use regular expression search/replace to ensure all single-arg lambdas have parenthesis. This aligns with the style used in Spring Boot and ensure that single-arg and multi-arg lambdas are consistent. Issue gh-8945
This commit is contained in:
+3
-3
@@ -43,14 +43,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
protected void configure(
|
||||
HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests(authorizeRequests ->
|
||||
.authorizeRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(withDefaults())
|
||||
.sessionManagement(sessionManagement ->
|
||||
.sessionManagement((sessionManagement) ->
|
||||
sessionManagement
|
||||
.sessionConcurrency(sessionConcurrency ->
|
||||
.sessionConcurrency((sessionConcurrency) ->
|
||||
sessionConcurrency
|
||||
.maximumSessions(1)
|
||||
.expiredUrl("/login?expired")
|
||||
|
||||
+3
-3
@@ -30,17 +30,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests(authorizeRequests ->
|
||||
.authorizeRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.antMatchers("/resources/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(formLogin ->
|
||||
.formLogin((formLogin) ->
|
||||
formLogin
|
||||
.loginPage("/login")
|
||||
.permitAll()
|
||||
)
|
||||
.logout(logout ->
|
||||
.logout((logout) ->
|
||||
logout
|
||||
.permitAll()
|
||||
);
|
||||
|
||||
+12
-12
@@ -32,64 +32,64 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests(authorizeRequests ->
|
||||
.authorizeRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.antMatchers("/resources/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.openidLogin(openidLogin ->
|
||||
.openidLogin((openidLogin) ->
|
||||
openidLogin
|
||||
.loginPage("/login")
|
||||
.permitAll()
|
||||
.authenticationUserDetailsService(new CustomUserDetailsService())
|
||||
.attributeExchange(googleExchange ->
|
||||
.attributeExchange((googleExchange) ->
|
||||
googleExchange
|
||||
.identifierPattern("https://www.google.com/.*")
|
||||
.attribute(emailAttribute ->
|
||||
.attribute((emailAttribute) ->
|
||||
emailAttribute
|
||||
.name("email")
|
||||
.type("https://axschema.org/contact/email")
|
||||
.required(true)
|
||||
)
|
||||
.attribute(firstnameAttribute ->
|
||||
.attribute((firstnameAttribute) ->
|
||||
firstnameAttribute
|
||||
.name("firstname")
|
||||
.type("https://axschema.org/namePerson/first")
|
||||
.required(true)
|
||||
)
|
||||
.attribute(lastnameAttribute ->
|
||||
.attribute((lastnameAttribute) ->
|
||||
lastnameAttribute
|
||||
.name("lastname")
|
||||
.type("https://axschema.org/namePerson/last")
|
||||
.required(true)
|
||||
)
|
||||
)
|
||||
.attributeExchange(yahooExchange ->
|
||||
.attributeExchange((yahooExchange) ->
|
||||
yahooExchange
|
||||
.identifierPattern(".*yahoo.com.*")
|
||||
.attribute(emailAttribute ->
|
||||
.attribute((emailAttribute) ->
|
||||
emailAttribute
|
||||
.name("email")
|
||||
.type("https://axschema.org/contact/email")
|
||||
.required(true)
|
||||
)
|
||||
.attribute(fullnameAttribute ->
|
||||
.attribute((fullnameAttribute) ->
|
||||
fullnameAttribute
|
||||
.name("fullname")
|
||||
.type("https://axschema.org/namePerson")
|
||||
.required(true)
|
||||
)
|
||||
)
|
||||
.attributeExchange(myopenidExchange ->
|
||||
.attributeExchange((myopenidExchange) ->
|
||||
myopenidExchange
|
||||
.identifierPattern(".*myopenid.com.*")
|
||||
.attribute(emailAttribute ->
|
||||
.attribute((emailAttribute) ->
|
||||
emailAttribute
|
||||
.name("email")
|
||||
.type("https://schema.openid.net/contact/email")
|
||||
.required(true)
|
||||
)
|
||||
.attribute(fullnameAttribute ->
|
||||
.attribute((fullnameAttribute) ->
|
||||
fullnameAttribute
|
||||
.name("fullname")
|
||||
.type("https://schema.openid.net/namePerson")
|
||||
|
||||
+2
-2
@@ -27,12 +27,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests(authorizeRequests ->
|
||||
.authorizeRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.antMatchers("/login", "/resources/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.jee(jee ->
|
||||
.jee((jee) ->
|
||||
jee
|
||||
.mappableRoles("USER", "ADMIN")
|
||||
);
|
||||
|
||||
+2
-2
@@ -42,12 +42,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests(authorizeRequests ->
|
||||
.authorizeRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.antMatchers("/resources/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(formLogin ->
|
||||
.formLogin((formLogin) ->
|
||||
formLogin
|
||||
.loginPage("/login")
|
||||
.permitAll()
|
||||
|
||||
+3
-3
@@ -57,11 +57,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
return RelyingPartyRegistration.withRegistrationId(registrationId)
|
||||
.entityId(localEntityIdTemplate)
|
||||
.assertionConsumerServiceLocation(acsUrlTemplate)
|
||||
.signingX509Credentials(c -> c.add(signingCredential))
|
||||
.assertingPartyDetails(config -> config
|
||||
.signingX509Credentials((c) -> c.add(signingCredential))
|
||||
.assertingPartyDetails((config) -> config
|
||||
.entityId(idpEntityId)
|
||||
.singleSignOnServiceLocation(webSsoEndpoint)
|
||||
.verificationX509Credentials(c -> c.add(idpVerificationCertificate)))
|
||||
.verificationX509Credentials((c) -> c.add(idpVerificationCertificate)))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class SecurityConfigTests {
|
||||
Saml2WebSsoAuthenticationFilter filter = (Saml2WebSsoAuthenticationFilter) filters
|
||||
.stream()
|
||||
.filter(
|
||||
f -> f instanceof Saml2WebSsoAuthenticationFilter
|
||||
(f) -> f instanceof Saml2WebSsoAuthenticationFilter
|
||||
)
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests(authorizeRequests ->
|
||||
.authorizeRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user