@ -104,9 +104,9 @@ public class DefaultPermissionFactory implements PermissionFactory {
@@ -104,9 +104,9 @@ public class DefaultPermissionFactory implements PermissionFactory {
// Ensure no existing Permission uses this integer or code
@ -42,7 +42,7 @@ final class GlobalMethodSecuritySelector implements ImportSelector {
@@ -42,7 +42,7 @@ final class GlobalMethodSecuritySelector implements ImportSelector {
@ -278,7 +278,9 @@ public final class WebSecurity extends
@@ -278,7 +278,9 @@ public final class WebSecurity extends
protectedFilterperformBuild()throwsException{
Assert.state(
!securityFilterChainBuilders.isEmpty(),
"At least one SecurityBuilder<? extends SecurityFilterChain> needs to be specified. Typically this done by adding a @Configuration that extends WebSecurityConfigurerAdapter. More advanced users can invoke "
()->"At least one SecurityBuilder<? extends SecurityFilterChain> needs to be specified. "
+"Typically this done by adding a @Configuration that extends WebSecurityConfigurerAdapter. "
@ -220,7 +220,7 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
@@ -220,7 +220,7 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
privatestaticStringhasRole(Stringrole){
Assert.isTrue(
!role.startsWith("ROLE_"),
role
()->role
+" should not start with ROLE_ since ROLE_ is automatically prepended when using hasRole. Consider using hasAuthority or access instead.");
@ -103,7 +103,7 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
@@ -103,7 +103,7 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
@ -49,7 +49,7 @@ public class CachingUserDetailsService implements UserDetailsService {
@@ -49,7 +49,7 @@ public class CachingUserDetailsService implements UserDetailsService {
@ -512,7 +512,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
@@ -512,7 +512,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
synchronized(delegateMonitor){
if(delegate==null){
Assert.state(beanFactory!=null,
"BeanFactory must be set to resolve "+authMgrBean);
()->"BeanFactory must be set to resolve "+authMgrBean);
@ -54,7 +54,7 @@ public class SecuredAnnotationSecurityMetadataSource extends
@@ -54,7 +54,7 @@ public class SecuredAnnotationSecurityMetadataSource extends
@ -136,18 +136,18 @@ public abstract class AbstractSecurityInterceptor implements InitializingBean,
@@ -136,18 +136,18 @@ public abstract class AbstractSecurityInterceptor implements InitializingBean,
"An SecurityMetadataSource is required");
Assert.isTrue(this.obtainSecurityMetadataSource()
.supports(getSecureObjectClass()),
"SecurityMetadataSource does not support secure object class: "
()->"SecurityMetadataSource does not support secure object class: "
@ -95,7 +95,7 @@ public class AfterInvocationProviderManager implements AfterInvocationManager,
@@ -95,7 +95,7 @@ public class AfterInvocationProviderManager implements AfterInvocationManager,
@ -123,7 +123,7 @@ public class MapBasedMethodSecurityMetadataSource extends
@@ -123,7 +123,7 @@ public class MapBasedMethodSecurityMetadataSource extends
}
StringmethodName=name.substring(lastDotIndex+1);
Assert.hasText(methodName,"Method not found for '"+name+"'");
Assert.hasText(methodName,()->"Method not found for '"+name+"'");
@ -126,7 +126,7 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements
@@ -126,7 +126,7 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements
@ -158,8 +158,9 @@ public class JaasAuthenticationProvider extends AbstractJaasAuthenticationProvid
@@ -158,8 +158,9 @@ public class JaasAuthenticationProvider extends AbstractJaasAuthenticationProvid
// the superclass is not called because it does additional checks that are
// non-passive
Assert.hasLength(getLoginContextName(),
"loginContextName must be set on "+getClass());
Assert.notNull(this.loginConfig,"loginConfig must be set on "+getClass());
()->"loginContextName must be set on "+getClass());
@ -100,7 +100,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
@@ -100,7 +100,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
@ -433,7 +433,7 @@ public class User implements UserDetails, CredentialsContainer {
@@ -433,7 +433,7 @@ public class User implements UserDetails, CredentialsContainer {
List<GrantedAuthority>authorities=newArrayList<>(
roles.length);
for(Stringrole:roles){
Assert.isTrue(!role.startsWith("ROLE_"),role
Assert.isTrue(!role.startsWith("ROLE_"),()->role
+" cannot start with ROLE_ (it is automatically added)");
@ -92,7 +92,7 @@ public class ChannelDecisionManagerImpl implements ChannelDecisionManager,
@@ -92,7 +92,7 @@ public class ChannelDecisionManagerImpl implements ChannelDecisionManager,
@ -67,7 +67,7 @@ public final class ExpressionBasedFilterInvocationSecurityMetadataSource
@@ -67,7 +67,7 @@ public final class ExpressionBasedFilterInvocationSecurityMetadataSource
.entrySet()){
RequestMatcherrequest=entry.getKey();
Assert.isTrue(entry.getValue().size()==1,
"Expected a single expression attribute for "+request);
()->"Expected a single expression attribute for "+request);
@ -76,7 +76,7 @@ public class ExceptionMappingAuthenticationFailureHandler extends
@@ -76,7 +76,7 @@ public class ExceptionMappingAuthenticationFailureHandler extends
"Exception key must be a String (the exception classname).");
Assert.isInstanceOf(String.class,url,"URL must be a String");
@ -41,8 +41,8 @@ public class ForwardAuthenticationFailureHandler implements AuthenticationFailur
@@ -41,8 +41,8 @@ public class ForwardAuthenticationFailureHandler implements AuthenticationFailur
@ -41,8 +41,8 @@ public class ForwardAuthenticationSuccessHandler implements AuthenticationSucces
@@ -41,8 +41,8 @@ public class ForwardAuthenticationSuccessHandler implements AuthenticationSucces
@ -123,8 +123,8 @@ public class SimpleUrlAuthenticationFailureHandler implements
@@ -123,8 +123,8 @@ public class SimpleUrlAuthenticationFailureHandler implements
@ -42,8 +42,8 @@ public class ForwardLogoutSuccessHandler implements LogoutSuccessHandler {
@@ -42,8 +42,8 @@ public class ForwardLogoutSuccessHandler implements LogoutSuccessHandler {
@ -35,7 +35,7 @@ public class MatcherSecurityWebFilterChain implements SecurityWebFilterChain {
@@ -35,7 +35,7 @@ public class MatcherSecurityWebFilterChain implements SecurityWebFilterChain {
@ -93,7 +93,7 @@ public class ConcurrentSessionFilter extends GenericFilterBean {
@@ -93,7 +93,7 @@ public class ConcurrentSessionFilter extends GenericFilterBean {