Add Missing Deprecation Markers

This commit is contained in:
Josh Cummings 2025-04-22 13:37:40 -06:00
parent 3f7f3dabe7
commit 2ad859a63c
No known key found for this signature in database
GPG Key ID: 869B37A20E876129
18 changed files with 64 additions and 0 deletions

View File

@ -33,12 +33,16 @@ public enum PayloadInterceptorOrder implements Ordered {
/** /**
* Where basic authentication is placed. * Where basic authentication is placed.
* @see RSocketSecurity#basicAuthentication(Customizer) * @see RSocketSecurity#basicAuthentication(Customizer)
* @deprecated please see {@link PayloadInterceptorOrder#AUTHENTICATION}
*/ */
@Deprecated
BASIC_AUTHENTICATION, BASIC_AUTHENTICATION,
/** /**
* Where JWT based authentication is performed. * Where JWT based authentication is performed.
* @see RSocketSecurity#jwt(Customizer) * @see RSocketSecurity#jwt(Customizer)
* @deprecated please see {@link PayloadInterceptorOrder#AUTHENTICATION}
*/ */
@Deprecated
JWT_AUTHENTICATION, JWT_AUTHENTICATION,
/** /**
* A generic placeholder for other types of authentication. * A generic placeholder for other types of authentication.

View File

@ -24,6 +24,7 @@ import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.vote.AffirmativeBased; import org.springframework.security.access.vote.AffirmativeBased;
import org.springframework.security.access.vote.AuthenticatedVoter; import org.springframework.security.access.vote.AuthenticatedVoter;
import org.springframework.security.access.vote.RoleVoter; import org.springframework.security.access.vote.RoleVoter;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.config.BeanIds; import org.springframework.security.config.BeanIds;
/** /**
@ -32,7 +33,9 @@ import org.springframework.security.config.BeanIds;
* @author Luke Taylor * @author Luke Taylor
* @author Ben Alex * @author Ben Alex
* @author Rob Winch * @author Rob Winch
* @deprecated Please use {@link AuthorizationManager} instead
*/ */
@Deprecated
abstract class MethodConfigUtils { abstract class MethodConfigUtils {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")

View File

@ -43,7 +43,9 @@ public final class RoleHierarchyUtils {
* @return a string representation of a role hierarchy * @return a string representation of a role hierarchy
* @throws IllegalArgumentException if roleHierarchyMap is null or empty or if a role * @throws IllegalArgumentException if roleHierarchyMap is null or empty or if a role
* name is null or empty or if an implied role name(s) is null or empty * name is null or empty or if an implied role name(s) is null or empty
* @deprecated please see {@link RoleHierarchyImpl#setHierarchy} deprecation notice
*/ */
@Deprecated
public static String roleHierarchyFromMap(Map<String, List<String>> roleHierarchyMap) { public static String roleHierarchyFromMap(Map<String, List<String>> roleHierarchyMap) {
Assert.notEmpty(roleHierarchyMap, "roleHierarchyMap cannot be empty"); Assert.notEmpty(roleHierarchyMap, "roleHierarchyMap cannot be empty");
StringWriter result = new StringWriter(); StringWriter result = new StringWriter();

View File

@ -28,7 +28,9 @@ import org.springframework.security.core.Authentication;
* functionality. * functionality.
* *
* @author Ben Alex * @author Ben Alex
* @deprecated please see {@link RunAsManager} deprecation notice
*/ */
@Deprecated
final class NullRunAsManager implements RunAsManager { final class NullRunAsManager implements RunAsManager {
@Override @Override

View File

@ -59,7 +59,10 @@ public final class PostAuthorizeReactiveAuthorizationManager
* not be resolved. * not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters * @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3 * @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/ */
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) { public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults); this.registry.setTemplateDefaults(defaults);
} }

View File

@ -74,7 +74,10 @@ public final class PostFilterAuthorizationReactiveMethodInterceptor implements A
* not be resolved. * not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters * @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3 * @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/ */
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) { public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults); this.registry.setTemplateDefaults(defaults);
} }

View File

@ -59,7 +59,10 @@ public final class PreAuthorizeReactiveAuthorizationManager
* not be resolved. * not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters * @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3 * @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/ */
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) { public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults); this.registry.setTemplateDefaults(defaults);
} }

View File

@ -77,7 +77,10 @@ public final class PreFilterAuthorizationReactiveMethodInterceptor implements Au
* not be resolved. * not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters * @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3 * @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/ */
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) { public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults); this.registry.setTemplateDefaults(defaults);
} }

View File

@ -36,7 +36,9 @@ import org.springframework.util.MimeTypeUtils;
* *
* @author Rob Winch * @author Rob Winch
* @since 5.2 * @since 5.2
* @deprecated please use {@link AuthenticationPayloadExchangeConverter} instead
*/ */
@Deprecated
public class BasicAuthenticationPayloadExchangeConverter implements PayloadExchangeAuthenticationConverter { public class BasicAuthenticationPayloadExchangeConverter implements PayloadExchangeAuthenticationConverter {
private MimeType metadataMimetype = MimeTypeUtils private MimeType metadataMimetype = MimeTypeUtils

View File

@ -34,7 +34,9 @@ import org.springframework.security.rsocket.metadata.BearerTokenMetadata;
* *
* @author Rob Winch * @author Rob Winch
* @since 5.2 * @since 5.2
* @deprecated please use {@link AuthenticationPayloadExchangeConverter} instead
*/ */
@Deprecated
public class BearerPayloadExchangeConverter implements PayloadExchangeAuthenticationConverter { public class BearerPayloadExchangeConverter implements PayloadExchangeAuthenticationConverter {
private static final String BEARER_MIME_TYPE_VALUE = BearerTokenMetadata.BEARER_AUTHENTICATION_MIME_TYPE.toString(); private static final String BEARER_MIME_TYPE_VALUE = BearerTokenMetadata.BEARER_AUTHENTICATION_MIME_TYPE.toString();

View File

@ -34,7 +34,11 @@ import org.springframework.util.Assert;
/** /**
* @author Luke Taylor * @author Luke Taylor
* @deprecated please use
* {@link org.springframework.security.web.transport.HttpsRedirectFilter} and its
* associated {@link PortMapper}
*/ */
@Deprecated
public abstract class AbstractRetryEntryPoint implements ChannelEntryPoint { public abstract class AbstractRetryEntryPoint implements ChannelEntryPoint {
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());

View File

@ -22,6 +22,8 @@ import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.web.PortMapper;
/** /**
* May be used by a {@link ChannelProcessor} to launch a web channel. * May be used by a {@link ChannelProcessor} to launch a web channel.
* *
@ -31,7 +33,11 @@ import jakarta.servlet.http.HttpServletResponse;
* interface to assist <code>ChannelProcessor</code>s in performing this delegation. * interface to assist <code>ChannelProcessor</code>s in performing this delegation.
* *
* @author Ben Alex * @author Ben Alex
* @deprecated please use
* {@link org.springframework.security.web.transport.HttpsRedirectFilter} and its
* associated {@link PortMapper}
*/ */
@Deprecated
public interface ChannelEntryPoint { public interface ChannelEntryPoint {
/** /**

View File

@ -16,6 +16,8 @@
package org.springframework.security.web.access.channel; package org.springframework.security.web.access.channel;
import org.springframework.security.web.PortMapper;
/** /**
* Commences an insecure channel by retrying the original request using HTTP. * Commences an insecure channel by retrying the original request using HTTP.
* <p> * <p>
@ -24,7 +26,11 @@ package org.springframework.security.web.access.channel;
* issue. * issue.
* *
* @author Ben Alex * @author Ben Alex
* @deprecated please use
* {@link org.springframework.security.web.transport.HttpsRedirectFilter} and its
* associated {@link PortMapper}
*/ */
@Deprecated(since = "6.5")
public class RetryWithHttpEntryPoint extends AbstractRetryEntryPoint { public class RetryWithHttpEntryPoint extends AbstractRetryEntryPoint {
public RetryWithHttpEntryPoint() { public RetryWithHttpEntryPoint() {

View File

@ -16,6 +16,8 @@
package org.springframework.security.web.access.channel; package org.springframework.security.web.access.channel;
import org.springframework.security.web.PortMapper;
/** /**
* Commences a secure channel by retrying the original request using HTTPS. * Commences a secure channel by retrying the original request using HTTPS.
* <p> * <p>
@ -25,7 +27,11 @@ package org.springframework.security.web.access.channel;
* </p> * </p>
* *
* @author Ben Alex * @author Ben Alex
* @deprecated please use
* {@link org.springframework.security.web.transport.HttpsRedirectFilter} and its
* associated {@link PortMapper}
*/ */
@Deprecated(since = "6.5")
public class RetryWithHttpsEntryPoint extends AbstractRetryEntryPoint { public class RetryWithHttpsEntryPoint extends AbstractRetryEntryPoint {
public RetryWithHttpsEntryPoint() { public RetryWithHttpsEntryPoint() {

View File

@ -44,7 +44,12 @@ public final class DelegatingSecurityContextRepository implements SecurityContex
this.delegates = delegates; this.delegates = delegates;
} }
/**
* @deprecated
* @see SecurityContextRepository#loadContext
*/
@Override @Override
@Deprecated
public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) {
SecurityContext result = null; SecurityContext result = null;
for (SecurityContextRepository delegate : this.delegates) { for (SecurityContextRepository delegate : this.delegates) {

View File

@ -115,7 +115,9 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
* If the session is null, the context object is null or the context object stored in * If the session is null, the context object is null or the context object stored in
* the session is not an instance of {@code SecurityContext}, a new context object * the session is not an instance of {@code SecurityContext}, a new context object
* will be generated and returned. * will be generated and returned.
* @deprecated please see {@link SecurityContextRepository#loadContext}
*/ */
@Deprecated
@Override @Override
public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) {
HttpServletRequest request = requestResponseHolder.getRequest(); HttpServletRequest request = requestResponseHolder.getRequest();

View File

@ -38,7 +38,11 @@ public final class NullSecurityContextRepository implements SecurityContextRepos
return false; return false;
} }
/**
* @deprecated please see {@link SecurityContextRepository#loadContext}
*/
@Override @Override
@Deprecated
public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) {
return this.securityContextHolderStrategy.createEmptyContext(); return this.securityContextHolderStrategy.createEmptyContext();
} }

View File

@ -75,7 +75,11 @@ public final class RequestAttributeSecurityContextRepository implements Security
return getContext(request) != null; return getContext(request) != null;
} }
/**
* @deprecated please see {@link SecurityContextRepository#loadContext}
*/
@Override @Override
@Deprecated
public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) {
return loadDeferredContext(requestResponseHolder.getRequest()).get(); return loadDeferredContext(requestResponseHolder.getRequest()).get();
} }