2
0
Эх сурвалжийг харах

Deprecate SecurityConfig

Closes gh-16773
Josh Cummings 5 сар өмнө
parent
commit
89bd670fb1

+ 9 - 0
config/src/main/java/org/springframework/security/config/http/ChannelAttributeFactory.java

@@ -21,6 +21,8 @@ import java.util.List;
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.security.access.ConfigAttribute;
 import org.springframework.security.access.SecurityConfig;
+import org.springframework.security.authorization.AuthorizationManager;
+import org.springframework.security.core.annotation.SecurityAnnotationScanner;
 import org.springframework.security.web.access.channel.ChannelDecisionManagerImpl;
 
 /**
@@ -29,7 +31,14 @@ import org.springframework.security.web.access.channel.ChannelDecisionManagerImp
  *
  * @author Luke Taylor
  * @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. 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 final class ChannelAttributeFactory {
 
 	private static final String OPT_REQUIRES_HTTP = "http";

+ 9 - 0
core/src/main/java/org/springframework/security/access/SecurityConfig.java

@@ -20,6 +20,8 @@ import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.springframework.security.authorization.AuthorizationManager;
+import org.springframework.security.core.annotation.SecurityAnnotationScanner;
 import org.springframework.util.Assert;
 import org.springframework.util.StringUtils;
 
@@ -27,7 +29,14 @@ import org.springframework.util.StringUtils;
  * Stores a {@link ConfigAttribute} as a <code>String</code>.
  *
  * @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 class SecurityConfig implements ConfigAttribute {
 
 	@Serial