Add noformat blocks around auth config
Find `auth` config using a regex search of `^\s*auths*$` and protect them against formatting. Issue gh-8945
This commit is contained in:
+2
-2
@@ -48,13 +48,13 @@ public class WithMockUserParentTests extends WithMockUserParent {
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@ComponentScan(basePackageClasses = HelloMessageService.class)
|
||||
static class Config {
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -77,13 +77,13 @@ public class WithMockUserTests {
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@ComponentScan(basePackageClasses = HelloMessageService.class)
|
||||
static class Config {
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -77,13 +77,13 @@ public class WithUserDetailsTests {
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@ComponentScan(basePackageClasses = HelloMessageService.class)
|
||||
static class Config {
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.userDetailsService(myUserDetailsService());
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
@Bean
|
||||
public UserDetailsService myUserDetailsService() {
|
||||
|
||||
+2
-2
@@ -82,13 +82,13 @@ public class SecurityMockMvcRequestPostProcessorsAuthenticationStatelessTests {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication();
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
@RestController
|
||||
static class Controller {
|
||||
|
||||
+2
-2
@@ -82,13 +82,13 @@ public class SecurityMockMvcRequestPostProcessorsTestSecurityContextStatelessTes
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication();
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
@RestController
|
||||
static class Controller {
|
||||
|
||||
+2
-2
@@ -75,13 +75,13 @@ public class CsrfShowcaseTests {
|
||||
protected void configure(HttpSecurity http) {
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -83,14 +83,14 @@ public class CustomCsrfShowcaseTests {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
@Bean
|
||||
public CsrfTokenRepository repo() {
|
||||
|
||||
+2
-2
@@ -70,13 +70,13 @@ public class DefaultCsrfShowcaseTests {
|
||||
protected void configure(HttpSecurity http) {
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -97,13 +97,13 @@ public class DefaultfSecurityRequestsTests {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -115,14 +115,14 @@ public class SecurityRequestsTests {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
@Override
|
||||
@Bean
|
||||
|
||||
+2
-2
@@ -99,13 +99,13 @@ public class WithUserAuthenticationTests {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -99,13 +99,13 @@ public class WithUserClassLevelAuthenticationTests {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -97,14 +97,14 @@ public class WithUserDetailsAuthenticationTests {
|
||||
return super.userDetailsServiceBean();
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER").and()
|
||||
.withUser("admin").password("password").roles("USER", "ADMIN");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -97,14 +97,14 @@ public class WithUserDetailsClassLevelAuthenticationTests {
|
||||
return super.userDetailsServiceBean();
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
.inMemoryAuthentication()
|
||||
.withUser("user").password("password").roles("USER").and()
|
||||
.withUser("admin").password("password").roles("USER", "ADMIN");
|
||||
// @formatter:on
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user