Deprecate ConfigAttribute

Closes gh-16774
This commit is contained in:
Josh Cummings 2025-03-19 17:34:03 -06:00
parent 89bd670fb1
commit 8e9634d25c
No known key found for this signature in database
GPG Key ID: 869B37A20E876129
6 changed files with 26 additions and 0 deletions

View File

@ -22,7 +22,9 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry; import org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry;
import org.springframework.security.core.annotation.SecurityAnnotationScanner;
import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -36,7 +38,14 @@ import org.springframework.util.Assert;
* @see ChannelSecurityConfigurer * @see ChannelSecurityConfigurer
* @see UrlAuthorizationConfigurer * @see UrlAuthorizationConfigurer
* @see ExpressionUrlAuthorizationConfigurer * @see ExpressionUrlAuthorizationConfigurer
* @deprecated In modern Spring Security APIs, each API manages its own configuration
* context. As such there is no direct replacement for this interface. In the case of
* method security, please see {@link SecurityAnnotationScanner} and
* {@link AuthorizationManager}. In the case of channel security, please see
* {@code HttpsRedirectFilter}. In the case of web security, please see
* {@link AuthorizationManager}.
*/ */
@Deprecated
public abstract class AbstractConfigAttributeRequestMatcherRegistry<C> extends AbstractRequestMatcherRegistry<C> { public abstract class AbstractConfigAttributeRequestMatcherRegistry<C> extends AbstractRequestMatcherRegistry<C> {
private List<UrlMapping> urlMappings = new ArrayList<>(); private List<UrlMapping> urlMappings = new ArrayList<>();

View File

@ -151,6 +151,7 @@ public abstract class AbstractInterceptUrlConfigurer<C extends AbstractIntercept
return securityInterceptor; return securityInterceptor;
} }
@Deprecated
public abstract class AbstractInterceptUrlRegistry<R extends AbstractInterceptUrlRegistry<R, T>, T> public abstract class AbstractInterceptUrlRegistry<R extends AbstractInterceptUrlRegistry<R, T>, T>
extends AbstractConfigAttributeRequestMatcherRegistry<T> { extends AbstractConfigAttributeRequestMatcherRegistry<T> {

View File

@ -202,6 +202,7 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
return "hasIpAddress('" + ipAddressExpression + "')"; return "hasIpAddress('" + ipAddressExpression + "')";
} }
@Deprecated
public final class ExpressionInterceptUrlRegistry extends public final class ExpressionInterceptUrlRegistry extends
ExpressionUrlAuthorizationConfigurer<H>.AbstractInterceptUrlRegistry<ExpressionInterceptUrlRegistry, AuthorizedUrl> { ExpressionUrlAuthorizationConfigurer<H>.AbstractInterceptUrlRegistry<ExpressionInterceptUrlRegistry, AuthorizedUrl> {

View File

@ -203,6 +203,7 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
return authorities; return authorities;
} }
@Deprecated
public final class StandardInterceptUrlRegistry extends public final class StandardInterceptUrlRegistry extends
UrlAuthorizationConfigurer<H>.AbstractInterceptUrlRegistry<StandardInterceptUrlRegistry, AuthorizedUrl> { UrlAuthorizationConfigurer<H>.AbstractInterceptUrlRegistry<StandardInterceptUrlRegistry, AuthorizedUrl> {

View File

@ -19,6 +19,8 @@ package org.springframework.security.access;
import java.io.Serializable; import java.io.Serializable;
import org.springframework.security.access.intercept.RunAsManager; import org.springframework.security.access.intercept.RunAsManager;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.core.annotation.SecurityAnnotationScanner;
/** /**
* Stores a security system related configuration attribute. * Stores a security system related configuration attribute.
@ -35,7 +37,14 @@ import org.springframework.security.access.intercept.RunAsManager;
* target. * target.
* *
* @author Ben Alex * @author Ben Alex
* @deprecated In modern Spring Security APIs, each API manages its own configuration
* context. As such there is no direct replacement for this interface. In the case of
* method security, please see {@link SecurityAnnotationScanner} and
* {@link AuthorizationManager}. In the case of channel security, please see
* {@code HttpsRedirectFilter}. In the case of web security, please see
* {@link AuthorizationManager}.
*/ */
@Deprecated
public interface ConfigAttribute extends Serializable { public interface ConfigAttribute extends Serializable {
/** /**

View File

@ -19,6 +19,7 @@ package org.springframework.security.web.access.expression;
import org.springframework.expression.EvaluationContext; import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression; import org.springframework.expression.Expression;
import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.web.FilterInvocation; import org.springframework.security.web.FilterInvocation;
/** /**
@ -26,7 +27,11 @@ import org.springframework.security.web.FilterInvocation;
* *
* @author Luke Taylor * @author Luke Taylor
* @since 3.0 * @since 3.0
* @deprecated In modern Spring Security APIs, each API manages its own configuration
* context. As such there is no direct replacement for this interface. Please see
* {@link AuthorizationManager}.
*/ */
@Deprecated
class WebExpressionConfigAttribute implements ConfigAttribute, EvaluationContextPostProcessor<FilterInvocation> { class WebExpressionConfigAttribute implements ConfigAttribute, EvaluationContextPostProcessor<FilterInvocation> {
private final Expression authorizeExpression; private final Expression authorizeExpression;