@ -60,7 +60,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
private final AuthorizationEventPublisher publisher ;
private final AuthorizationEventPublisher publisher ;
private final AuthorizationManagerFactory < RequestAuthorizationContext > authorizationManagerFactory ;
private final AuthorizationManagerFactory < ? super RequestAuthorizationContext > authorizationManagerFactory ;
private ObjectPostProcessor < AuthorizationManager < HttpServletRequest > > postProcessor = ObjectPostProcessor
private ObjectPostProcessor < AuthorizationManager < HttpServletRequest > > postProcessor = ObjectPostProcessor
. identity ( ) ;
. identity ( ) ;
@ -85,7 +85,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
provider . ifUnique ( ( postProcessor ) - > this . postProcessor = postProcessor ) ;
provider . ifUnique ( ( postProcessor ) - > this . postProcessor = postProcessor ) ;
}
}
private AuthorizationManagerFactory < RequestAuthorizationContext > getAuthorizationManagerFactory (
private AuthorizationManagerFactory < ? super RequestAuthorizationContext > getAuthorizationManagerFactory (
ApplicationContext context ) {
ApplicationContext context ) {
ResolvableType authorizationManagerFactoryType = ResolvableType
ResolvableType authorizationManagerFactoryType = ResolvableType
. forClassWithGenerics ( AuthorizationManagerFactory . class , RequestAuthorizationContext . class ) ;
. forClassWithGenerics ( AuthorizationManagerFactory . class , RequestAuthorizationContext . class ) ;
@ -134,7 +134,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
}
}
private AuthorizationManagerRequestMatcherRegistry addMapping ( List < ? extends RequestMatcher > matchers ,
private AuthorizationManagerRequestMatcherRegistry addMapping ( List < ? extends RequestMatcher > matchers ,
AuthorizationManager < RequestAuthorizationContext > manager ) {
AuthorizationManager < ? super RequestAuthorizationContext > manager ) {
for ( RequestMatcher matcher : matchers ) {
for ( RequestMatcher matcher : matchers ) {
this . registry . addMapping ( matcher , manager ) ;
this . registry . addMapping ( matcher , manager ) ;
}
}
@ -166,13 +166,15 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
setApplicationContext ( context ) ;
setApplicationContext ( context ) ;
}
}
private void addMapping ( RequestMatcher matcher , AuthorizationManager < RequestAuthorizationContext > manager ) {
private void addMapping ( RequestMatcher matcher ,
AuthorizationManager < ? super RequestAuthorizationContext > manager ) {
this . unmappedMatchers = null ;
this . unmappedMatchers = null ;
this . managerBuilder . add ( matcher , manager ) ;
this . managerBuilder . add ( matcher , manager ) ;
this . mappingCount + + ;
this . mappingCount + + ;
}
}
private void addFirst ( RequestMatcher matcher , AuthorizationManager < RequestAuthorizationContext > manager ) {
private void addFirst ( RequestMatcher matcher ,
AuthorizationManager < ? super RequestAuthorizationContext > manager ) {
this . unmappedMatchers = null ;
this . unmappedMatchers = null ;
this . managerBuilder . mappings ( ( m ) - > m . add ( 0 , new RequestMatcherEntry < > ( matcher , manager ) ) ) ;
this . managerBuilder . mappings ( ( m ) - > m . add ( 0 , new RequestMatcherEntry < > ( matcher , manager ) ) ) ;
this . mappingCount + + ;
this . mappingCount + + ;
@ -220,7 +222,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
private final List < ? extends RequestMatcher > matchers ;
private final List < ? extends RequestMatcher > matchers ;
private AuthorizationManagerFactory < RequestAuthorizationContext > authorizationManagerFactory ;
private AuthorizationManagerFactory < ? super RequestAuthorizationContext > authorizationManagerFactory ;
private boolean not ;
private boolean not ;
@ -231,7 +233,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
* creating instances of { @link AuthorizationManager }
* creating instances of { @link AuthorizationManager }
* /
* /
AuthorizedUrl ( List < ? extends RequestMatcher > matchers ,
AuthorizedUrl ( List < ? extends RequestMatcher > matchers ,
AuthorizationManagerFactory < RequestAuthorizationContext > authorizationManagerFactory ) {
AuthorizationManagerFactory < ? super RequestAuthorizationContext > authorizationManagerFactory ) {
this . matchers = matchers ;
this . matchers = matchers ;
this . authorizationManagerFactory = authorizationManagerFactory ;
this . authorizationManagerFactory = authorizationManagerFactory ;
}
}
@ -241,7 +243,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
}
}
void setAuthorizationManagerFactory (
void setAuthorizationManagerFactory (
AuthorizationManagerFactory < RequestAuthorizationContext > authorizationManagerFactory ) {
AuthorizationManagerFactory < ? super RequestAuthorizationContext > authorizationManagerFactory ) {
this . authorizationManagerFactory = authorizationManagerFactory ;
this . authorizationManagerFactory = authorizationManagerFactory ;
}
}
@ -403,7 +405,7 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
* customizations
* customizations
* /
* /
public AuthorizationManagerRequestMatcherRegistry access (
public AuthorizationManagerRequestMatcherRegistry access (
AuthorizationManager < RequestAuthorizationContext > manager ) {
AuthorizationManager < ? super RequestAuthorizationContext > manager ) {
Assert . notNull ( manager , "manager cannot be null" ) ;
Assert . notNull ( manager , "manager cannot be null" ) ;
return ( this . not )
return ( this . not )
? AuthorizeHttpRequestsConfigurer . this . addMapping ( this . matchers , AuthorizationManagers . not ( manager ) )
? AuthorizeHttpRequestsConfigurer . this . addMapping ( this . matchers , AuthorizationManagers . not ( manager ) )