commit
c1db1aad91
|
@ -41,14 +41,14 @@ class AclClassIdUtils {
|
|||
|
||||
private ConversionService conversionService;
|
||||
|
||||
public AclClassIdUtils() {
|
||||
AclClassIdUtils() {
|
||||
GenericConversionService genericConversionService = new GenericConversionService();
|
||||
genericConversionService.addConverter(String.class, Long.class, new StringToLongConverter());
|
||||
genericConversionService.addConverter(String.class, UUID.class, new StringToUUIDConverter());
|
||||
this.conversionService = genericConversionService;
|
||||
}
|
||||
|
||||
public AclClassIdUtils(ConversionService conversionService) {
|
||||
AclClassIdUtils(ConversionService conversionService) {
|
||||
Assert.notNull(conversionService, "conversionService must not be null");
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
|
|
@ -559,7 +559,7 @@ public class BasicLookupStrategy implements LookupStrategy {
|
|||
private final Map<Serializable, Acl> acls;
|
||||
private final List<Sid> sids;
|
||||
|
||||
public ProcessResultSet(Map<Serializable, Acl> acls, List<Sid> sids) {
|
||||
ProcessResultSet(Map<Serializable, Acl> acls, List<Sid> sids) {
|
||||
Assert.notNull(acls, "ACLs cannot be null");
|
||||
this.acls = acls;
|
||||
this.sids = sids; // can be null
|
||||
|
@ -683,7 +683,7 @@ public class BasicLookupStrategy implements LookupStrategy {
|
|||
private static class StubAclParent implements Acl {
|
||||
private final Long id;
|
||||
|
||||
public StubAclParent(Long id) {
|
||||
StubAclParent(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,8 +55,8 @@ class AssertionImplMixin {
|
|||
* @param attributes the key/value pairs for this attribute.
|
||||
*/
|
||||
@JsonCreator
|
||||
public AssertionImplMixin(@JsonProperty("principal") AttributePrincipal principal,
|
||||
AssertionImplMixin(@JsonProperty("principal") AttributePrincipal principal,
|
||||
@JsonProperty("validFromDate") Date validFromDate, @JsonProperty("validUntilDate") Date validUntilDate,
|
||||
@JsonProperty("authenticationDate") Date authenticationDate, @JsonProperty("attributes") Map<String, Object> attributes){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ class AttributePrincipalImplMixin {
|
|||
* @param proxyRetriever the ProxyRetriever implementation to call back to the CAS server.
|
||||
*/
|
||||
@JsonCreator
|
||||
public AttributePrincipalImplMixin(@JsonProperty("name") String name, @JsonProperty("attributes") Map<String, Object> attributes,
|
||||
AttributePrincipalImplMixin(@JsonProperty("name") String name, @JsonProperty("attributes") Map<String, Object> attributes,
|
||||
@JsonProperty("proxyGrantingTicket") String proxyGrantingTicket,
|
||||
@JsonProperty("proxyRetriever") ProxyRetriever proxyRetriever) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ class CasAuthenticationTokenMixin {
|
|||
* principal and how to obtain a proxy ticket for the user.
|
||||
*/
|
||||
@JsonCreator
|
||||
public CasAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
|
||||
CasAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
|
||||
@JsonProperty("credentials") Object credentials,
|
||||
@JsonProperty("authorities") Collection<? extends GrantedAuthority> authorities,
|
||||
@JsonProperty("userDetails") UserDetails userDetails, @JsonProperty("assertion") Assertion assertion) {
|
||||
|
|
|
@ -415,7 +415,7 @@ public class CasAuthenticationFilter extends AbstractAuthenticationProcessingFil
|
|||
private class CasAuthenticationFailureHandler implements AuthenticationFailureHandler {
|
||||
private final AuthenticationFailureHandler serviceTicketFailureHandler;
|
||||
|
||||
public CasAuthenticationFailureHandler(AuthenticationFailureHandler failureHandler) {
|
||||
CasAuthenticationFailureHandler(AuthenticationFailureHandler failureHandler) {
|
||||
Assert.notNull(failureHandler, "failureHandler");
|
||||
this.serviceTicketFailureHandler = failureHandler;
|
||||
}
|
||||
|
@ -432,4 +432,4 @@ public class CasAuthenticationFilter extends AbstractAuthenticationProcessingFil
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -414,7 +414,7 @@ public class CasAuthenticationProviderTests {
|
|||
private class MockTicketValidator implements TicketValidator {
|
||||
private boolean returnTicket;
|
||||
|
||||
public MockTicketValidator(boolean returnTicket) {
|
||||
MockTicketValidator(boolean returnTicket) {
|
||||
this.returnTicket = returnTicket;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBui
|
|||
private final LinkedHashMap<Class<? extends SecurityConfigurer<O, B>>, List<SecurityConfigurer<O, B>>> configurers = new LinkedHashMap<>();
|
||||
private final List<SecurityConfigurer<O, B>> configurersAddedInInitializing = new ArrayList<>();
|
||||
|
||||
private final Map<Class<? extends Object>, Object> sharedObjects = new HashMap<>();
|
||||
private final Map<Class<?>, Object> sharedObjects = new HashMap<>();
|
||||
|
||||
private final boolean allowConfigurersOfSameType;
|
||||
|
||||
|
@ -174,7 +174,7 @@ public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBui
|
|||
* Gets the shared objects
|
||||
* @return the shared Objects
|
||||
*/
|
||||
public Map<Class<? extends Object>, Object> getSharedObjects() {
|
||||
public Map<Class<?>, Object> getSharedObjects() {
|
||||
return Collections.unmodifiableMap(this.sharedObjects);
|
||||
}
|
||||
|
||||
|
@ -409,7 +409,7 @@ public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBui
|
|||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
private static enum BuildState {
|
||||
private enum BuildState {
|
||||
/**
|
||||
* This is the state before the {@link Builder#build()} is invoked
|
||||
*/
|
||||
|
|
|
@ -110,7 +110,7 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|||
*/
|
||||
private static final class CompositeObjectPostProcessor implements
|
||||
ObjectPostProcessor<Object> {
|
||||
private List<ObjectPostProcessor<? extends Object>> postProcessors = new ArrayList<>();
|
||||
private List<ObjectPostProcessor<?>> postProcessors = new ArrayList<>();
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public Object postProcess(Object object) {
|
||||
|
@ -131,7 +131,7 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|||
* @return true if the {@link ObjectPostProcessor} was added, else false
|
||||
*/
|
||||
private boolean addObjectPostProcessor(
|
||||
ObjectPostProcessor<? extends Object> objectPostProcessor) {
|
||||
ObjectPostProcessor<?> objectPostProcessor) {
|
||||
boolean result = this.postProcessors.add(objectPostProcessor);
|
||||
postProcessors.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||
return result;
|
||||
|
|
|
@ -193,7 +193,7 @@ public class AuthenticationConfiguration {
|
|||
private static final Log logger = LogFactory
|
||||
.getLog(EnableGlobalAuthenticationAutowiredConfigurer.class);
|
||||
|
||||
public EnableGlobalAuthenticationAutowiredConfigurer(ApplicationContext context) {
|
||||
EnableGlobalAuthenticationAutowiredConfigurer(ApplicationContext context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class InitializeAuthenticationProviderBeanManagerConfigurer
|
|||
/**
|
||||
* @param context the ApplicationContext to look up beans.
|
||||
*/
|
||||
public InitializeAuthenticationProviderBeanManagerConfigurer(
|
||||
InitializeAuthenticationProviderBeanManagerConfigurer(
|
||||
ApplicationContext context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
@ -83,4 +83,4 @@ class InitializeAuthenticationProviderBeanManagerConfigurer
|
|||
.getBean(userDetailsBeanNames[0], type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class InitializeUserDetailsBeanManagerConfigurer
|
|||
/**
|
||||
* @param context
|
||||
*/
|
||||
public InitializeUserDetailsBeanManagerConfigurer(ApplicationContext context) {
|
||||
InitializeUserDetailsBeanManagerConfigurer(ApplicationContext context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ final class AutowireBeanFactoryObjectPostProcessor
|
|||
private final List<DisposableBean> disposableBeans = new ArrayList<>();
|
||||
private final List<SmartInitializingSingleton> smartSingletons = new ArrayList<>();
|
||||
|
||||
public AutowireBeanFactoryObjectPostProcessor(
|
||||
AutowireBeanFactoryObjectPostProcessor(
|
||||
AutowireCapableBeanFactory autowireBeanFactory) {
|
||||
Assert.notNull(autowireBeanFactory, "autowireBeanFactory cannot be null");
|
||||
this.autowireBeanFactory = autowireBeanFactory;
|
||||
|
|
|
@ -241,7 +241,7 @@ public class GlobalMethodSecurityConfiguration
|
|||
* @return the {@link AccessDecisionManager} to use
|
||||
*/
|
||||
protected AccessDecisionManager accessDecisionManager() {
|
||||
List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
|
||||
List<AccessDecisionVoter<?>> decisionVoters = new ArrayList<>();
|
||||
ExpressionBasedPreInvocationAdvice expressionAdvice = new ExpressionBasedPreInvocationAdvice();
|
||||
expressionAdvice.setExpressionHandler(getExpressionHandler());
|
||||
if (prePostEnabled()) {
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.springframework.util.ClassUtils;
|
|||
*/
|
||||
final class GlobalMethodSecuritySelector implements ImportSelector {
|
||||
|
||||
public final String[] selectImports(AnnotationMetadata importingClassMetadata) {
|
||||
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
|
||||
Class<EnableGlobalMethodSecurity> annoType = EnableGlobalMethodSecurity.class;
|
||||
Map<String, Object> annotationAttributes = importingClassMetadata
|
||||
.getAnnotationAttributes(annoType.getName(), false);
|
||||
|
|
|
@ -137,11 +137,11 @@ public final class HttpSecurity extends
|
|||
@SuppressWarnings("unchecked")
|
||||
public HttpSecurity(ObjectPostProcessor<Object> objectPostProcessor,
|
||||
AuthenticationManagerBuilder authenticationBuilder,
|
||||
Map<Class<? extends Object>, Object> sharedObjects) {
|
||||
Map<Class<?>, Object> sharedObjects) {
|
||||
super(objectPostProcessor);
|
||||
Assert.notNull(authenticationBuilder, "authenticationBuilder cannot be null");
|
||||
setSharedObject(AuthenticationManagerBuilder.class, authenticationBuilder);
|
||||
for (Map.Entry<Class<? extends Object>, Object> entry : sharedObjects
|
||||
for (Map.Entry<Class<?>, Object> entry : sharedObjects
|
||||
.entrySet()) {
|
||||
setSharedObject((Class<Object>) entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ final class AutowiredWebSecurityConfigurersIgnoreParents {
|
|||
|
||||
private final ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
public AutowiredWebSecurityConfigurersIgnoreParents(
|
||||
AutowiredWebSecurityConfigurersIgnoreParents(
|
||||
ConfigurableListableBeanFactory beanFactory) {
|
||||
Assert.notNull(beanFactory, "beanFactory cannot be null");
|
||||
this.beanFactory = beanFactory;
|
||||
|
|
|
@ -201,7 +201,7 @@ public abstract class WebSecurityConfigurerAdapter implements
|
|||
AuthenticationManager authenticationManager = authenticationManager();
|
||||
authenticationBuilder.parentAuthenticationManager(authenticationManager);
|
||||
authenticationBuilder.authenticationEventPublisher(eventPublisher);
|
||||
Map<Class<? extends Object>, Object> sharedObjects = createSharedObjects();
|
||||
Map<Class<?>, Object> sharedObjects = createSharedObjects();
|
||||
|
||||
http = new HttpSecurity(objectPostProcessor, authenticationBuilder,
|
||||
sharedObjects);
|
||||
|
@ -412,8 +412,8 @@ public abstract class WebSecurityConfigurerAdapter implements
|
|||
*
|
||||
* @return the shared Objects
|
||||
*/
|
||||
private Map<Class<? extends Object>, Object> createSharedObjects() {
|
||||
Map<Class<? extends Object>, Object> sharedObjects = new HashMap<>();
|
||||
private Map<Class<?>, Object> createSharedObjects() {
|
||||
Map<Class<?>, Object> sharedObjects = new HashMap<>();
|
||||
sharedObjects.putAll(localConfigureAuthenticationBldr.getSharedObjects());
|
||||
sharedObjects.put(UserDetailsService.class, userDetailsService());
|
||||
sharedObjects.put(ApplicationContext.class, context);
|
||||
|
|
|
@ -108,7 +108,7 @@ abstract class AbstractInterceptUrlConfigurer<C extends AbstractInterceptUrlConf
|
|||
* @return the {@link AccessDecisionVoter} instances used to create the default
|
||||
* {@link AccessDecisionManager}
|
||||
*/
|
||||
abstract List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http);
|
||||
abstract List<AccessDecisionVoter<?>> getDecisionVoters(H http);
|
||||
|
||||
abstract class AbstractInterceptUrlRegistry<R extends AbstractInterceptUrlRegistry<R, T>, T>
|
||||
extends AbstractConfigAttributeRequestMatcherRegistry<T> {
|
||||
|
@ -195,4 +195,4 @@ abstract class AbstractInterceptUrlConfigurer<C extends AbstractInterceptUrlConf
|
|||
securityInterceptor.afterPropertiesSet();
|
||||
return securityInterceptor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,8 +183,8 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) {
|
||||
List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
|
||||
List<AccessDecisionVoter<?>> getDecisionVoters(H http) {
|
||||
List<AccessDecisionVoter<?>> decisionVoters = new ArrayList<>();
|
||||
WebExpressionVoter expressionVoter = new WebExpressionVoter();
|
||||
expressionVoter.setExpressionHandler(getExpressionHandler(http));
|
||||
decisionVoters.add(expressionVoter);
|
||||
|
@ -192,7 +192,7 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
|
|||
}
|
||||
|
||||
@Override
|
||||
final ExpressionBasedFilterInvocationSecurityMetadataSource createMetadataSource(
|
||||
ExpressionBasedFilterInvocationSecurityMetadataSource createMetadataSource(
|
||||
H http) {
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = REGISTRY
|
||||
.createRequestMap();
|
||||
|
|
|
@ -172,8 +172,8 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
|
|||
*/
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) {
|
||||
List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
|
||||
List<AccessDecisionVoter<?>> getDecisionVoters(H http) {
|
||||
List<AccessDecisionVoter<?>> decisionVoters = new ArrayList<>();
|
||||
decisionVoters.add(new RoleVoter());
|
||||
decisionVoters.add(new AuthenticatedVoter());
|
||||
return decisionVoters;
|
||||
|
|
|
@ -159,7 +159,7 @@ public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer extends
|
|||
MessageExpressionVoter<Object> voter = new MessageExpressionVoter<>();
|
||||
voter.setExpressionHandler(getMessageExpressionHandler());
|
||||
|
||||
List<AccessDecisionVoter<? extends Object>> voters = new ArrayList<>();
|
||||
List<AccessDecisionVoter<?>> voters = new ArrayList<>();
|
||||
voters.add(voter);
|
||||
|
||||
AffirmativeBased manager = new AffirmativeBased(voters);
|
||||
|
|
|
@ -133,7 +133,7 @@ public class RsaKeyConversionServicePostProcessor implements BeanFactoryPostProc
|
|||
private static class ConverterPropertyEditorAdapter<T> extends PropertyEditorSupport {
|
||||
private final Converter<String, T> converter;
|
||||
|
||||
public ConverterPropertyEditorAdapter(Converter<String, T> converter) {
|
||||
ConverterPropertyEditorAdapter(Converter<String, T> converter) {
|
||||
this.converter = converter;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ final class AuthenticationConfigBuilder {
|
|||
|
||||
private String openIDLoginPage;
|
||||
|
||||
public AuthenticationConfigBuilder(Element element, boolean forceAutoConfig,
|
||||
AuthenticationConfigBuilder(Element element, boolean forceAutoConfig,
|
||||
ParserContext pc, SessionCreationPolicy sessionPolicy,
|
||||
BeanReference requestCache, BeanReference authenticationManager,
|
||||
BeanReference sessionStrategy, BeanReference portMapper,
|
||||
|
|
|
@ -152,7 +152,7 @@ class HttpConfigurationBuilder {
|
|||
private BeanDefinition invalidSession;
|
||||
private boolean addAllAuth;
|
||||
|
||||
public HttpConfigurationBuilder(Element element, boolean addAllAuth,
|
||||
HttpConfigurationBuilder(Element element, boolean addAllAuth,
|
||||
ParserContext pc, BeanReference portMapper, BeanReference portResolver,
|
||||
BeanReference authenticationManager) {
|
||||
this.httpElt = element;
|
||||
|
|
|
@ -415,12 +415,12 @@ class OrderDecorator implements Ordered {
|
|||
final BeanMetadataElement bean;
|
||||
final int order;
|
||||
|
||||
public OrderDecorator(BeanMetadataElement bean, SecurityFilters filterOrder) {
|
||||
OrderDecorator(BeanMetadataElement bean, SecurityFilters filterOrder) {
|
||||
this.bean = bean;
|
||||
this.order = filterOrder.getOrder();
|
||||
}
|
||||
|
||||
public OrderDecorator(BeanMetadataElement bean, int order) {
|
||||
OrderDecorator(BeanMetadataElement bean, int order) {
|
||||
this.bean = bean;
|
||||
this.order = order;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ class LogoutBeanDefinitionParser implements BeanDefinitionParser {
|
|||
private ManagedList<BeanMetadataElement> logoutHandlers = new ManagedList<>();
|
||||
private boolean csrfEnabled;
|
||||
|
||||
public LogoutBeanDefinitionParser(String loginPageUrl, String rememberMeServices,
|
||||
LogoutBeanDefinitionParser(String loginPageUrl, String rememberMeServices,
|
||||
BeanMetadataElement csrfLogoutHandler) {
|
||||
this.defaultLogoutUrl = loginPageUrl + "?logout";
|
||||
this.rememberMeServices = rememberMeServices;
|
||||
|
|
|
@ -58,11 +58,11 @@ enum SecurityFilters {
|
|||
private static final int INTERVAL = 100;
|
||||
private final int order;
|
||||
|
||||
private SecurityFilters() {
|
||||
SecurityFilters() {
|
||||
order = ordinal() * INTERVAL;
|
||||
}
|
||||
|
||||
private SecurityFilters(int order) {
|
||||
SecurityFilters(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ final class ProtectPointcutPostProcessor implements BeanPostProcessor {
|
|||
private final PointcutParser parser;
|
||||
private final Set<String> processedBeans = new HashSet<>();
|
||||
|
||||
public ProtectPointcutPostProcessor(
|
||||
ProtectPointcutPostProcessor(
|
||||
MapBasedMethodSecurityMetadataSource mapBasedMethodSecurityMetadataSource) {
|
||||
Assert.notNull(mapBasedMethodSecurityMetadataSource,
|
||||
"MapBasedMethodSecurityMetadataSource to populate is required");
|
||||
|
|
|
@ -72,11 +72,11 @@ public enum SecurityWebFiltersOrder {
|
|||
|
||||
private final int order;
|
||||
|
||||
private SecurityWebFiltersOrder() {
|
||||
SecurityWebFiltersOrder() {
|
||||
this.order = ordinal() * INTERVAL;
|
||||
}
|
||||
|
||||
private SecurityWebFiltersOrder(int order) {
|
||||
SecurityWebFiltersOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
|
|
|
@ -3658,7 +3658,7 @@ public class ServerHttpSecurity {
|
|||
private final WebFilter webFilter;
|
||||
private final int order;
|
||||
|
||||
public OrderedWebFilter(WebFilter webFilter, int order) {
|
||||
OrderedWebFilter(WebFilter webFilter, int order) {
|
||||
this.webFilter = webFilter;
|
||||
this.order = order;
|
||||
}
|
||||
|
|
|
@ -243,8 +243,7 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
|
|||
|
||||
private final boolean sameOriginDisabled;
|
||||
|
||||
public MessageSecurityPostProcessor(String inboundSecurityInterceptorId,
|
||||
boolean sameOriginDisabled) {
|
||||
MessageSecurityPostProcessor(String inboundSecurityInterceptorId, boolean sameOriginDisabled) {
|
||||
this.inboundSecurityInterceptorId = inboundSecurityInterceptorId;
|
||||
this.sameOriginDisabled = sameOriginDisabled;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class SecurityConfigurerAdapterTests {
|
|||
static class OrderedObjectPostProcessor implements ObjectPostProcessor<String>, Ordered {
|
||||
private final int order;
|
||||
|
||||
public OrderedObjectPostProcessor(int order) {
|
||||
OrderedObjectPostProcessor(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
|
|
|
@ -847,7 +847,7 @@ public class ExpressionUrlAuthorizationConfigurerTests {
|
|||
|
||||
static class CustomExpressionRoot extends WebSecurityExpressionRoot {
|
||||
|
||||
public CustomExpressionRoot(Authentication a, FilterInvocation fi) {
|
||||
CustomExpressionRoot(Authentication a, FilterInvocation fi) {
|
||||
super(a, fi);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class NamespaceHttpExpressionHandlerTests {
|
|||
@EnableWebMvc
|
||||
@EnableWebSecurity
|
||||
private static class ExpressionHandlerConfig extends WebSecurityConfigurerAdapter {
|
||||
public ExpressionHandlerConfig() {}
|
||||
ExpressionHandlerConfig() {}
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
|
|
|
@ -129,7 +129,7 @@ public class SecurityContextConfigurerTests {
|
|||
@Configuration
|
||||
@EnableWebSecurity
|
||||
static class SecurityContextRepositoryDefaultsSecurityContextRepositoryConfig extends WebSecurityConfigurerAdapter {
|
||||
public SecurityContextRepositoryDefaultsSecurityContextRepositoryConfig() {
|
||||
SecurityContextRepositoryDefaultsSecurityContextRepositoryConfig() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -2133,7 +2133,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|||
|
||||
private class MockWebServerPropertySource extends PropertySource {
|
||||
|
||||
public MockWebServerPropertySource() {
|
||||
MockWebServerPropertySource() {
|
||||
super("mockwebserver");
|
||||
}
|
||||
|
||||
|
@ -2178,7 +2178,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
|||
|
||||
private String token;
|
||||
|
||||
public BearerTokenRequestPostProcessor(String token) {
|
||||
BearerTokenRequestPostProcessor(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
|
|
|
@ -631,7 +631,7 @@ public class CsrfConfigTests {
|
|||
static class CsrfReturnedResultMatcher implements ResultMatcher {
|
||||
ExceptionalFunction<MvcResult, String> token;
|
||||
|
||||
public CsrfReturnedResultMatcher(ExceptionalFunction<MvcResult, String> token) {
|
||||
CsrfReturnedResultMatcher(ExceptionalFunction<MvcResult, String> token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class HttpConfigTests {
|
|||
private static class EncodeUrlDenyingHttpServletResponseWrapper
|
||||
extends HttpServletResponseWrapper {
|
||||
|
||||
public EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
|
||||
EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
|
||||
super(response);
|
||||
}
|
||||
|
||||
|
|
|
@ -907,7 +907,7 @@ public class MiscHttpConfigTests {
|
|||
static class EncodeUrlDenyingHttpServletResponseWrapper
|
||||
extends HttpServletResponseWrapper {
|
||||
|
||||
public EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
|
||||
EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
|
||||
super(response);
|
||||
}
|
||||
|
||||
|
|
|
@ -610,7 +610,7 @@ public class SessionManagementConfigTests {
|
|||
private static class EncodeUrlDenyingHttpServletResponseWrapper
|
||||
extends HttpServletResponseWrapper {
|
||||
|
||||
public EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
|
||||
EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
|
||||
super(response);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ final class HtmlUnitWebTestClient {
|
|||
|
||||
private final WebTestClient webTestClient;
|
||||
|
||||
public HtmlUnitWebTestClient(WebClient webClient, WebTestClient webTestClient) {
|
||||
HtmlUnitWebTestClient(WebClient webClient, WebTestClient webTestClient) {
|
||||
Assert.notNull(webClient, "WebClient must not be null");
|
||||
Assert.notNull(webTestClient, "WebTestClient must not be null");
|
||||
this.webClient = webClient;
|
||||
|
|
|
@ -42,7 +42,7 @@ final class MockWebResponseBuilder {
|
|||
private final FluxExchangeResult<String> exchangeResult;
|
||||
|
||||
|
||||
public MockWebResponseBuilder(long startTime, WebRequest webRequest, FluxExchangeResult<String> exchangeResult) {
|
||||
MockWebResponseBuilder(long startTime, WebRequest webRequest, FluxExchangeResult<String> exchangeResult) {
|
||||
Assert.notNull(webRequest, "WebRequest must not be null");
|
||||
Assert.notNull(exchangeResult, "FluxExchangeResult must not be null");
|
||||
this.startTime = startTime;
|
||||
|
|
|
@ -55,5 +55,5 @@ public @interface Secured {
|
|||
*
|
||||
* @return String[] The secure method attributes
|
||||
*/
|
||||
public String[] value();
|
||||
String[] value();
|
||||
}
|
||||
|
|
|
@ -48,11 +48,11 @@ class MethodSecurityEvaluationContext extends StandardEvaluationContext {
|
|||
* for each instance. Use the constructor which takes the resolver, as an argument
|
||||
* thus allowing for caching.
|
||||
*/
|
||||
public MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi) {
|
||||
MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi) {
|
||||
this(user, mi, new DefaultSecurityParameterNameDiscoverer());
|
||||
}
|
||||
|
||||
public MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi,
|
||||
MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi,
|
||||
ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
this.mi = mi;
|
||||
this.parameterNameDiscoverer = parameterNameDiscoverer;
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface RoleHierarchy {
|
|||
* @param authorities - List of the directly assigned authorities.
|
||||
* @return List of all reachable authorities given the assigned authorities.
|
||||
*/
|
||||
public Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
|
||||
Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
|
||||
Collection<? extends GrantedAuthority> authorities);
|
||||
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ public final class DelegatingMethodSecurityMetadataSource extends
|
|||
private final Method method;
|
||||
private final Class<?> targetClass;
|
||||
|
||||
public DefaultCacheKey(Method method, Class<?> targetClass) {
|
||||
DefaultCacheKey(Method method, Class<?> targetClass) {
|
||||
this.method = method;
|
||||
this.targetClass = targetClass;
|
||||
}
|
||||
|
|
|
@ -287,7 +287,7 @@ public class MapBasedMethodSecurityMetadataSource extends
|
|||
private final Method method;
|
||||
private final Class<?> registeredJavaType;
|
||||
|
||||
public RegisteredMethod(Method method, Class<?> registeredJavaType) {
|
||||
RegisteredMethod(Method method, Class<?> registeredJavaType) {
|
||||
Assert.notNull(method, "Method required");
|
||||
Assert.notNull(registeredJavaType, "Registered Java Type required");
|
||||
this.method = method;
|
||||
|
|
|
@ -29,5 +29,5 @@ import org.springframework.security.access.SecurityMetadataSource;
|
|||
* @author Ben Alex
|
||||
*/
|
||||
public interface MethodSecurityMetadataSource extends SecurityMetadataSource {
|
||||
public Collection<ConfigAttribute> getAttributes(Method method, Class<?> targetClass);
|
||||
Collection<ConfigAttribute> getAttributes(Method method, Class<?> targetClass);
|
||||
}
|
||||
|
|
|
@ -38,5 +38,5 @@ public @interface PostAuthorize {
|
|||
* @return the Spring-EL expression to be evaluated after invoking the protected
|
||||
* method
|
||||
*/
|
||||
public String value();
|
||||
String value();
|
||||
}
|
||||
|
|
|
@ -38,5 +38,5 @@ public @interface PostFilter {
|
|||
* @return the Spring-EL expression to be evaluated after invoking the protected
|
||||
* method
|
||||
*/
|
||||
public String value();
|
||||
String value();
|
||||
}
|
||||
|
|
|
@ -50,12 +50,12 @@ public @interface PreFilter {
|
|||
* @return the Spring-EL expression to be evaluated before invoking the protected
|
||||
* method
|
||||
*/
|
||||
public String value();
|
||||
String value();
|
||||
|
||||
/**
|
||||
* @return the name of the parameter which should be filtered (must be a non-null
|
||||
* collection instance) If the method contains a single collection argument, then this
|
||||
* attribute can be omitted.
|
||||
*/
|
||||
public String filterTarget() default "";
|
||||
String filterTarget() default "";
|
||||
}
|
||||
|
|
|
@ -45,14 +45,14 @@ public abstract class AbstractAccessDecisionManager implements AccessDecisionMan
|
|||
// ================================================================================================
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private List<AccessDecisionVoter<? extends Object>> decisionVoters;
|
||||
private List<AccessDecisionVoter<?>> decisionVoters;
|
||||
|
||||
protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
|
||||
|
||||
private boolean allowIfAllAbstainDecisions = false;
|
||||
|
||||
protected AbstractAccessDecisionManager(
|
||||
List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
Assert.notEmpty(decisionVoters, "A list of AccessDecisionVoters is required");
|
||||
this.decisionVoters = decisionVoters;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public abstract class AbstractAccessDecisionManager implements AccessDecisionMan
|
|||
}
|
||||
}
|
||||
|
||||
public List<AccessDecisionVoter<? extends Object>> getDecisionVoters() {
|
||||
public List<AccessDecisionVoter<?>> getDecisionVoters() {
|
||||
return this.decisionVoters;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.springframework.security.core.Authentication;
|
|||
*/
|
||||
public class AffirmativeBased extends AbstractAccessDecisionManager {
|
||||
|
||||
public AffirmativeBased(List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
public AffirmativeBased(List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
super(decisionVoters);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ConsensusBased extends AbstractAccessDecisionManager {
|
|||
|
||||
private boolean allowIfEqualGrantedDeniedDecisions = true;
|
||||
|
||||
public ConsensusBased(List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
public ConsensusBased(List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
super(decisionVoters);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.springframework.security.core.Authentication;
|
|||
*/
|
||||
public class UnanimousBased extends AbstractAccessDecisionManager {
|
||||
|
||||
public UnanimousBased(List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
public UnanimousBased(List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
super(decisionVoters);
|
||||
}
|
||||
|
||||
|
|
|
@ -402,7 +402,7 @@ public abstract class AbstractJaasAuthenticationProvider
|
|||
private class InternalCallbackHandler implements CallbackHandler {
|
||||
private final Authentication authentication;
|
||||
|
||||
public InternalCallbackHandler(Authentication authentication) {
|
||||
InternalCallbackHandler(Authentication authentication) {
|
||||
this.authentication = authentication;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,24 +61,24 @@ public final class DelegatingSecurityContextScheduledExecutorService extends
|
|||
this(delegate, null);
|
||||
}
|
||||
|
||||
public final ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
|
||||
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
|
||||
command = wrap(command);
|
||||
return getDelegate().schedule(command, delay, unit);
|
||||
}
|
||||
|
||||
public final <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay,
|
||||
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay,
|
||||
TimeUnit unit) {
|
||||
callable = wrap(callable);
|
||||
return getDelegate().schedule(callable, delay, unit);
|
||||
}
|
||||
|
||||
public final ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
|
||||
long initialDelay, long period, TimeUnit unit) {
|
||||
command = wrap(command);
|
||||
return getDelegate().scheduleAtFixedRate(command, initialDelay, period, unit);
|
||||
}
|
||||
|
||||
public final ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
|
||||
long initialDelay, long delay, TimeUnit unit) {
|
||||
command = wrap(command);
|
||||
return getDelegate().scheduleWithFixedDelay(command, initialDelay, delay, unit);
|
||||
|
@ -87,4 +87,4 @@ public final class DelegatingSecurityContextScheduledExecutorService extends
|
|||
private ScheduledExecutorService getDelegate() {
|
||||
return (ScheduledExecutorService) getDelegateExecutor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,9 +92,9 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
|||
private ListItem items;
|
||||
|
||||
private interface Item {
|
||||
final int INTEGER_ITEM = 0;
|
||||
final int STRING_ITEM = 1;
|
||||
final int LIST_ITEM = 2;
|
||||
int INTEGER_ITEM = 0;
|
||||
int STRING_ITEM = 1;
|
||||
int LIST_ITEM = 2;
|
||||
|
||||
int compareTo(Item item);
|
||||
|
||||
|
@ -117,7 +117,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
|||
this.value = BigInteger_ZERO;
|
||||
}
|
||||
|
||||
public IntegerItem(String str) {
|
||||
IntegerItem(String str) {
|
||||
this.value = new BigInteger(str);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
|||
|
||||
private String value;
|
||||
|
||||
public StringItem(String value, boolean followedByDigit) {
|
||||
StringItem(String value, boolean followedByDigit) {
|
||||
if (followedByDigit && value.length() == 1) {
|
||||
// a1 = alpha-1, b1 = beta-1, m1 = milestone-1
|
||||
switch (value.charAt(0)) {
|
||||
|
@ -341,7 +341,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
|||
}
|
||||
}
|
||||
|
||||
public ComparableVersion(String version) {
|
||||
ComparableVersion(String version) {
|
||||
parseVersion(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,6 @@ public interface Attributes2GrantedAuthoritiesMapper {
|
|||
* @param attributes the attributes to be mapped
|
||||
* @return the collection of authorities created from the attributes
|
||||
*/
|
||||
public Collection<? extends GrantedAuthority> getGrantedAuthorities(
|
||||
Collection<? extends GrantedAuthority> getGrantedAuthorities(
|
||||
Collection<String> attributes);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
|||
long creationTime = new Date().getTime();
|
||||
String serverSecret = computeServerSecretApplicableAt(creationTime);
|
||||
String pseudoRandomNumber = generatePseudoRandomNumber();
|
||||
String content = Long.toString(creationTime) + ":" + pseudoRandomNumber + ":"
|
||||
String content = creationTime + ":" + pseudoRandomNumber + ":"
|
||||
+ extendedInformation;
|
||||
|
||||
// Compute key
|
||||
|
@ -126,7 +126,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
|||
String sha1Hex = tokens[tokens.length - 1];
|
||||
|
||||
// Verification
|
||||
String content = Long.toString(creationTime) + ":" + pseudoRandomNumber + ":"
|
||||
String content = creationTime + ":" + pseudoRandomNumber + ":"
|
||||
+ extendedInfo.toString();
|
||||
String expectedSha512Hex = Sha512DigestUtils.shaHex(content + ":" + serverSecret);
|
||||
Assert.isTrue(expectedSha512Hex.equals(sha1Hex), "Key verification failure");
|
||||
|
|
|
@ -53,7 +53,7 @@ class AnonymousAuthenticationTokenMixin {
|
|||
* @param authorities the authorities granted to the principal
|
||||
*/
|
||||
@JsonCreator
|
||||
public AnonymousAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
|
||||
AnonymousAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
|
||||
@JsonProperty("authorities") Collection<? extends GrantedAuthority> authorities) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class RememberMeAuthenticationTokenMixin {
|
|||
* @param authorities the authorities granted to the principal
|
||||
*/
|
||||
@JsonCreator
|
||||
public RememberMeAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash,
|
||||
RememberMeAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash,
|
||||
@JsonProperty("principal") Object principal,
|
||||
@JsonProperty("authorities") Collection<? extends GrantedAuthority> authorities) {
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ public final class SecurityJackson2Modules {
|
|||
*/
|
||||
static class WhitelistTypeResolverBuilder extends ObjectMapper.DefaultTypeResolverBuilder {
|
||||
|
||||
public WhitelistTypeResolverBuilder(ObjectMapper.DefaultTyping defaultTyping) {
|
||||
WhitelistTypeResolverBuilder(ObjectMapper.DefaultTyping defaultTyping) {
|
||||
super(defaultTyping);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class MutableUser implements MutableUserDetails {
|
|||
private String password;
|
||||
private final UserDetails delegate;
|
||||
|
||||
public MutableUser(UserDetails user) {
|
||||
MutableUser(UserDetails user) {
|
||||
this.delegate = user;
|
||||
this.password = user.getPassword();
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class SecurityConfigTests {
|
|||
private class MockConfigAttribute implements ConfigAttribute {
|
||||
private String attribute;
|
||||
|
||||
public MockConfigAttribute(String configuration) {
|
||||
MockConfigAttribute(String configuration) {
|
||||
this.attribute = configuration;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,31 +35,31 @@ public interface BusinessService extends Serializable {
|
|||
@Secured({ "ROLE_ADMIN" })
|
||||
@RolesAllowed({ "ROLE_ADMIN" })
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
public void someAdminMethod();
|
||||
void someAdminMethod();
|
||||
|
||||
@Secured({ "ROLE_USER", "ROLE_ADMIN" })
|
||||
@RolesAllowed({ "ROLE_USER", "ROLE_ADMIN" })
|
||||
public void someUserAndAdminMethod();
|
||||
void someUserAndAdminMethod();
|
||||
|
||||
@Secured({ "ROLE_USER" })
|
||||
@RolesAllowed({ "ROLE_USER" })
|
||||
public void someUserMethod1();
|
||||
void someUserMethod1();
|
||||
|
||||
@Secured({ "ROLE_USER" })
|
||||
@RolesAllowed({ "ROLE_USER" })
|
||||
public void someUserMethod2();
|
||||
void someUserMethod2();
|
||||
|
||||
@RolesAllowed({ "USER" })
|
||||
public void rolesAllowedUser();
|
||||
void rolesAllowedUser();
|
||||
|
||||
public int someOther(String s);
|
||||
int someOther(String s);
|
||||
|
||||
public int someOther(int input);
|
||||
int someOther(int input);
|
||||
|
||||
public List<?> methodReturningAList(List<?> someList);
|
||||
List<?> methodReturningAList(List<?> someList);
|
||||
|
||||
public Object[] methodReturningAnArray(Object[] someArray);
|
||||
Object[] methodReturningAnArray(Object[] someArray);
|
||||
|
||||
public List<?> methodReturningAList(String userName, String extraParam);
|
||||
List<?> methodReturningAList(String userName, String extraParam);
|
||||
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ public class SecuredAnnotationSecurityMetadataSourceTests {
|
|||
// Inner classes
|
||||
class Department extends Entity {
|
||||
|
||||
public Department(String name) {
|
||||
Department(String name) {
|
||||
super(name);
|
||||
}
|
||||
}
|
||||
|
@ -285,15 +285,15 @@ public class SecuredAnnotationSecurityMetadataSourceTests {
|
|||
public @interface AnnotatedAnnotation {
|
||||
}
|
||||
|
||||
public static interface ReturnVoid {
|
||||
public interface ReturnVoid {
|
||||
|
||||
public void doSomething(List<?> param);
|
||||
void doSomething(List<?> param);
|
||||
}
|
||||
|
||||
@AnnotatedAnnotation
|
||||
public static interface ReturnVoid2 {
|
||||
public interface ReturnVoid2 {
|
||||
|
||||
public void doSomething(List<?> param);
|
||||
void doSomething(List<?> param);
|
||||
}
|
||||
|
||||
@AnnotatedAnnotation
|
||||
|
|
|
@ -58,7 +58,7 @@ public class MethodSecurityEvaluationContextTests {
|
|||
private static class NotNullVariableMethodSecurityEvaluationContext
|
||||
extends MethodSecurityEvaluationContext {
|
||||
|
||||
public NotNullVariableMethodSecurityEvaluationContext(Authentication auth, MethodInvocation mi,
|
||||
NotNullVariableMethodSecurityEvaluationContext(Authentication auth, MethodInvocation mi,
|
||||
ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
super(auth, mi, parameterNameDiscoverer);
|
||||
}
|
||||
|
|
|
@ -203,19 +203,19 @@ public class PrePostAnnotationSecurityMetadataSourceTests {
|
|||
// ~ Inner Classes
|
||||
// ==================================================================================================
|
||||
|
||||
public static interface ReturnVoid {
|
||||
public void doSomething(List<?> param);
|
||||
public interface ReturnVoid {
|
||||
void doSomething(List<?> param);
|
||||
}
|
||||
|
||||
public static interface ReturnAList {
|
||||
public List<?> doSomething(List<?> param);
|
||||
public interface ReturnAList {
|
||||
List<?> doSomething(List<?> param);
|
||||
}
|
||||
|
||||
@PreAuthorize("interfaceAuthzExpression")
|
||||
public static interface ReturnAnotherList {
|
||||
public interface ReturnAnotherList {
|
||||
@PreAuthorize("interfaceMethodAuthzExpression")
|
||||
@PreFilter(filterTarget = "param", value = "interfacePreFilterExpression")
|
||||
public List<?> doSomething(List<?> param);
|
||||
List<?> doSomething(List<?> param);
|
||||
}
|
||||
|
||||
@PreAuthorize("someExpression")
|
||||
|
@ -275,8 +275,8 @@ public class PrePostAnnotationSecurityMetadataSourceTests {
|
|||
}
|
||||
|
||||
@CustomAnnotation
|
||||
public static interface ReturnVoid2 {
|
||||
public void doSomething(List<?> param);
|
||||
public interface ReturnVoid2 {
|
||||
void doSomething(List<?> param);
|
||||
}
|
||||
|
||||
@CustomAnnotation
|
||||
|
|
|
@ -179,8 +179,7 @@ public class AfterInvocationProviderManagerTests {
|
|||
|
||||
private Object forceReturnObject;
|
||||
|
||||
public MockAfterInvocationProvider(Object forceReturnObject, Class secureObject,
|
||||
ConfigAttribute configAttribute) {
|
||||
MockAfterInvocationProvider(Object forceReturnObject, Class secureObject, ConfigAttribute configAttribute) {
|
||||
this.forceReturnObject = forceReturnObject;
|
||||
this.secureObject = secureObject;
|
||||
this.configAttribute = configAttribute;
|
||||
|
|
|
@ -156,8 +156,7 @@ public class AbstractAuthenticationTokenTests {
|
|||
private Object credentials;
|
||||
private Object principal;
|
||||
|
||||
public MockAuthenticationImpl(Object principal, Object credentials,
|
||||
List<GrantedAuthority> authorities) {
|
||||
MockAuthenticationImpl(Object principal, Object credentials, List<GrantedAuthority> authorities) {
|
||||
super(authorities);
|
||||
this.principal = principal;
|
||||
this.credentials = credentials;
|
||||
|
|
|
@ -139,7 +139,7 @@ public class DefaultAuthenticationEventPublisherTests {
|
|||
|
||||
private static final class MockAuthenticationException extends
|
||||
AuthenticationException {
|
||||
public MockAuthenticationException(String msg) {
|
||||
MockAuthenticationException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ public class JaasAuthenticationProviderTests {
|
|||
private static class MockLoginContext extends LoginContext {
|
||||
boolean loggedOut = false;
|
||||
|
||||
public MockLoginContext(String loginModule) throws LoginException {
|
||||
MockLoginContext(String loginModule) throws LoginException {
|
||||
super(loginModule);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public class RemoteAuthenticationProviderTests {
|
|||
private class MockRemoteAuthenticationManager implements RemoteAuthenticationManager {
|
||||
private boolean grantAccess;
|
||||
|
||||
public MockRemoteAuthenticationManager(boolean grantAccess) {
|
||||
MockRemoteAuthenticationManager(boolean grantAccess) {
|
||||
this.grantAccess = grantAccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ public class DelegatingSecurityContextSupportTests extends
|
|||
|
||||
private static class ConcreteDelegatingSecurityContextSupport extends
|
||||
AbstractDelegatingSecurityContextSupport {
|
||||
public ConcreteDelegatingSecurityContextSupport(SecurityContext securityContext) {
|
||||
ConcreteDelegatingSecurityContextSupport(SecurityContext securityContext) {
|
||||
super(securityContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,13 +78,13 @@ public class AnnotationParameterNameDiscovererTests {
|
|||
|
||||
@Test
|
||||
public void getParameterNamesConstructor() throws Exception {
|
||||
assertThat(discoverer.getParameterNames(Impl.class.getConstructor(String.class)))
|
||||
assertThat(discoverer.getParameterNames(Impl.class.getDeclaredConstructor(String.class)))
|
||||
.isEqualTo(new String[] { "id" });
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getParameterNamesConstructorNoAnnotation() throws Exception {
|
||||
assertThat(discoverer.getParameterNames(Impl.class.getConstructor(Long.class)))
|
||||
assertThat(discoverer.getParameterNames(Impl.class.getDeclaredConstructor(Long.class)))
|
||||
.isNull();
|
||||
}
|
||||
|
||||
|
@ -148,10 +148,10 @@ public class AnnotationParameterNameDiscovererTests {
|
|||
}
|
||||
|
||||
static class Impl {
|
||||
public Impl(Long dataSourceId) {
|
||||
Impl(Long dataSourceId) {
|
||||
}
|
||||
|
||||
public Impl(@P("id") String dataSourceId) {
|
||||
Impl(@P("id") String dataSourceId) {
|
||||
}
|
||||
|
||||
String findMessageByTo(@P("to") String to) {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
package org.springframework.security.crypto.bcrypt;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
|
@ -486,7 +485,7 @@ public class BCrypt {
|
|||
* @param lr an array containing the two 32-bit half blocks
|
||||
* @param off the position in the array of the blocks
|
||||
*/
|
||||
private final void encipher(int lr[], int off) {
|
||||
private void encipher(int lr[], int off) {
|
||||
int i, n, l = lr[off], r = lr[off + 1];
|
||||
|
||||
l ^= P[0];
|
||||
|
@ -733,11 +732,7 @@ public class BCrypt {
|
|||
public static String hashpw(String password, String salt) {
|
||||
byte passwordb[];
|
||||
|
||||
try {
|
||||
passwordb = password.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
throw new AssertionError("UTF-8 is not supported");
|
||||
}
|
||||
passwordb = password.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
return hashpw(passwordb, salt);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* UTF-8 Charset encoder/decoder.
|
||||
|
@ -28,7 +29,7 @@ import java.nio.charset.Charset;
|
|||
* @author Luke Taylor
|
||||
*/
|
||||
public final class Utf8 {
|
||||
private static final Charset CHARSET = Charset.forName("UTF-8");
|
||||
private static final Charset CHARSET = StandardCharsets.UTF_8;
|
||||
|
||||
/**
|
||||
* Get the bytes of the String in UTF-8 encoded form.
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class AesBytesEncryptor implements BytesEncryptor {
|
|||
private BytesKeyGenerator ivGenerator;
|
||||
private String name;
|
||||
|
||||
private CipherAlgorithm(String name, BytesKeyGenerator ivGenerator) {
|
||||
CipherAlgorithm(String name, BytesKeyGenerator ivGenerator) {
|
||||
this.name = name;
|
||||
this.ivGenerator = ivGenerator;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ final class HexEncodingTextEncryptor implements TextEncryptor {
|
|||
|
||||
private final BytesEncryptor encryptor;
|
||||
|
||||
public HexEncodingTextEncryptor(BytesEncryptor encryptor) {
|
||||
HexEncodingTextEncryptor(BytesEncryptor encryptor) {
|
||||
this.encryptor = encryptor;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ final class HexEncodingStringKeyGenerator implements StringKeyGenerator {
|
|||
|
||||
private final BytesKeyGenerator keyGenerator;
|
||||
|
||||
public HexEncodingStringKeyGenerator(BytesKeyGenerator keyGenerator) {
|
||||
HexEncodingStringKeyGenerator(BytesKeyGenerator keyGenerator) {
|
||||
this.keyGenerator = keyGenerator;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,14 +34,14 @@ final class SecureRandomBytesKeyGenerator implements BytesKeyGenerator {
|
|||
/**
|
||||
* Creates a secure random key generator using the defaults.
|
||||
*/
|
||||
public SecureRandomBytesKeyGenerator() {
|
||||
SecureRandomBytesKeyGenerator() {
|
||||
this(DEFAULT_KEY_LENGTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a secure random key generator with a custom key length.
|
||||
*/
|
||||
public SecureRandomBytesKeyGenerator(int keyLength) {
|
||||
SecureRandomBytesKeyGenerator(int keyLength) {
|
||||
this.random = new SecureRandom();
|
||||
this.keyLength = keyLength;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ final class SharedKeyGenerator implements BytesKeyGenerator {
|
|||
|
||||
private byte[] sharedKey;
|
||||
|
||||
public SharedKeyGenerator(byte[] sharedKey) {
|
||||
SharedKeyGenerator(byte[] sharedKey) {
|
||||
this.sharedKey = sharedKey;
|
||||
}
|
||||
|
||||
|
@ -38,4 +38,4 @@ final class SharedKeyGenerator implements BytesKeyGenerator {
|
|||
return sharedKey;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ final class Digester {
|
|||
* @param algorithm the digest algorithm; for example, "SHA-1" or "SHA-256".
|
||||
* @param iterations the number of times to apply the digest algorithm to the input
|
||||
*/
|
||||
public Digester(String algorithm, int iterations) {
|
||||
Digester(String algorithm, int iterations) {
|
||||
// eagerly validate the algorithm
|
||||
createDigest(algorithm);
|
||||
this.algorithm = algorithm;
|
||||
|
@ -53,7 +53,7 @@ final class Digester {
|
|||
return value;
|
||||
}
|
||||
|
||||
final void setIterations(int iterations) {
|
||||
void setIterations(int iterations) {
|
||||
if (iterations <= 0) {
|
||||
throw new IllegalArgumentException("Iterations value must be greater than zero");
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public class BouncyCastleAesBytesEncryptorEquivalencyTest {
|
|||
|
||||
private final int keyLength;
|
||||
|
||||
public PredictableRandomBytesKeyGenerator(int keyLength) {
|
||||
PredictableRandomBytesKeyGenerator(int keyLength) {
|
||||
this.random = new Random(1);
|
||||
this.keyLength = keyLength;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
<!-- Coding -->
|
||||
<module name="EmptyStatementCheck" />
|
||||
<module name="RedundantModifier" />
|
||||
|
||||
<!-- Imports -->
|
||||
<module name="UnusedImportsCheck">
|
||||
|
|
|
@ -127,7 +127,7 @@ public class FilterChainPerformanceTests {
|
|||
HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
|
||||
SecurityContextHolder.getContext());
|
||||
SecurityContextHolder.clearContext();
|
||||
sw.start(Integer.toString(nAuthorities) + " authorities");
|
||||
sw.start(nAuthorities + " authorities");
|
||||
runWithStack(minimalStack);
|
||||
System.out.println(sw.shortSummary());
|
||||
sw.stop();
|
||||
|
|
|
@ -17,6 +17,6 @@ package org.springframework.security.integration;
|
|||
|
||||
public interface UserRepository {
|
||||
|
||||
public void doSomething();
|
||||
void doSomething();
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||
public interface TestService {
|
||||
|
||||
@PreAuthorize("someMethod.py")
|
||||
public void someMethod();
|
||||
void someMethod();
|
||||
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ public class DefaultSpringSecurityContextSourceTests {
|
|||
|
||||
static class EnvExposingDefaultSpringSecurityContextSource extends
|
||||
DefaultSpringSecurityContextSource {
|
||||
public EnvExposingDefaultSpringSecurityContextSource(String providerUrl) {
|
||||
EnvExposingDefaultSpringSecurityContextSource(String providerUrl) {
|
||||
super(providerUrl);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public enum PasswordPolicyErrorStatus {
|
|||
private final String errorCode;
|
||||
private final String defaultMessage;
|
||||
|
||||
private PasswordPolicyErrorStatus(String errorCode, String defaultMessage) {
|
||||
PasswordPolicyErrorStatus(String errorCode, String defaultMessage) {
|
||||
this.errorCode = errorCode;
|
||||
this.defaultMessage = defaultMessage;
|
||||
}
|
||||
|
|
|
@ -493,7 +493,7 @@ public class LdapUserDetailsManager implements UserDetailsManager {
|
|||
|
||||
private final ByteArrayOutputStream value = new ByteArrayOutputStream();
|
||||
|
||||
public PasswordModifyRequest(String userIdentity, String oldPassword, String newPassword) {
|
||||
PasswordModifyRequest(String userIdentity, String oldPassword, String newPassword) {
|
||||
ByteArrayOutputStream elements = new ByteArrayOutputStream();
|
||||
|
||||
if (userIdentity != null) {
|
||||
|
|
|
@ -468,7 +468,7 @@ public class ActiveDirectoryLdapAuthenticationProviderTests {
|
|||
static class MockNamingEnumeration implements NamingEnumeration<SearchResult> {
|
||||
private SearchResult sr;
|
||||
|
||||
public MockNamingEnumeration(SearchResult sr) {
|
||||
MockNamingEnumeration(SearchResult sr) {
|
||||
this.sr = sr;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class MessageExpressionConfigAttribute implements ConfigAttribute, EvaluationCon
|
|||
* @param authorizeExpression the {@link Expression} to use. Cannot be null
|
||||
* @param matcher the {@link MessageMatcher} used to match the messages.
|
||||
*/
|
||||
public MessageExpressionConfigAttribute(Expression authorizeExpression, MessageMatcher<?> matcher) {
|
||||
MessageExpressionConfigAttribute(Expression authorizeExpression, MessageMatcher<?> matcher) {
|
||||
Assert.notNull(authorizeExpression, "authorizeExpression cannot be null");
|
||||
Assert.notNull(matcher, "matcher cannot be null");
|
||||
this.authorizeExpression = authorizeExpression;
|
||||
|
|
|
@ -38,7 +38,7 @@ abstract class AbstractMessageMatcherComposite<T> implements MessageMatcher<T> {
|
|||
*
|
||||
* @param messageMatchers the {@link MessageMatcher} instances to try
|
||||
*/
|
||||
public AbstractMessageMatcherComposite(List<MessageMatcher<T>> messageMatchers) {
|
||||
AbstractMessageMatcherComposite(List<MessageMatcher<T>> messageMatchers) {
|
||||
notEmpty(messageMatchers, "messageMatchers must contain a value");
|
||||
if (messageMatchers.contains(null)) {
|
||||
throw new IllegalArgumentException(
|
||||
|
@ -54,7 +54,7 @@ abstract class AbstractMessageMatcherComposite<T> implements MessageMatcher<T> {
|
|||
* @param messageMatchers the {@link MessageMatcher} instances to try
|
||||
*/
|
||||
@SafeVarargs
|
||||
public AbstractMessageMatcherComposite(MessageMatcher<T>... messageMatchers) {
|
||||
AbstractMessageMatcherComposite(MessageMatcher<T>... messageMatchers) {
|
||||
this(asList(messageMatchers));
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public interface MessageMatcher<T> {
|
|||
*/
|
||||
MessageMatcher<Object> ANY_MESSAGE = new MessageMatcher<Object>() {
|
||||
@Override
|
||||
public boolean matches(Message<? extends Object> message) {
|
||||
public boolean matches(Message<?> message) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ public final class SimpDestinationMessageMatcher implements MessageMatcher<Objec
|
|||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
public boolean matches(Message<? extends Object> message) {
|
||||
public boolean matches(Message<?> message) {
|
||||
if (!messageTypeMatcher.matches(message)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public final class SimpDestinationMessageMatcher implements MessageMatcher<Objec
|
|||
}
|
||||
|
||||
|
||||
public Map<String, String> extractPathVariables(Message<? extends Object> message){
|
||||
public Map<String, String> extractPathVariables(Message<?> message){
|
||||
final String destination = SimpMessageHeaderAccessor.getDestination(message
|
||||
.getHeaders());
|
||||
return destination != null ? matcher.extractUriTemplateVariables(pattern, destination)
|
||||
|
|
|
@ -45,7 +45,7 @@ public class SimpMessageTypeMatcher implements MessageMatcher<Object> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Message<? extends Object> message) {
|
||||
public boolean matches(Message<?> message) {
|
||||
MessageHeaders headers = message.getHeaders();
|
||||
SimpMessageType messageType = SimpMessageHeaderAccessor.getMessageType(headers);
|
||||
|
||||
|
|
|
@ -258,10 +258,10 @@ public class AuthenticationPrincipalArgumentResolverTests {
|
|||
public final String property = "property";
|
||||
}
|
||||
|
||||
static class CopyUserPrincipal {
|
||||
public static class CopyUserPrincipal {
|
||||
public final String property;
|
||||
|
||||
CopyUserPrincipal(String property) {
|
||||
public CopyUserPrincipal(String property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue