Browse Source

Deprecate ChannelSecurityConfigurer

Closes gh-16680
pull/16682/head
Josh Cummings 11 months ago
parent
commit
72070cd191
No known key found for this signature in database
GPG Key ID: 869B37A20E876129
  1. 2
      config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
  2. 10
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java
  3. 2
      config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt

2
config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java

@ -3137,7 +3137,9 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul @@ -3137,7 +3137,9 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
* the {@link ChannelSecurityConfigurer.ChannelRequestMatcherRegistry}
* @return the {@link HttpSecurity} for further customizations
* @throws Exception
* @deprecated Use {@link #redirectToHttps}
*/
@Deprecated
public HttpSecurity requiresChannel(
Customizer<ChannelSecurityConfigurer<HttpSecurity>.ChannelRequestMatcherRegistry> requiresChannelCustomizer)
throws Exception {

10
config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java

@ -78,7 +78,9 @@ import org.springframework.security.web.util.matcher.RequestMatcher; @@ -78,7 +78,9 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
* @author Rob Winch
* @author Onur Kagan Ozcan
* @since 3.2
* @deprecated please use {@link HttpsRedirectConfigurer} instead
*/
@Deprecated
public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
extends AbstractHttpConfigurer<ChannelSecurityConfigurer<H>, H> {
@ -147,6 +149,10 @@ public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>> @@ -147,6 +149,10 @@ public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
return this.REGISTRY;
}
/**
* @deprecated no replacement planned
*/
@Deprecated
public final class ChannelRequestMatcherRegistry
extends AbstractConfigAttributeRequestMatcherRegistry<RequiresChannelUrl> {
@ -215,6 +221,10 @@ public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>> @@ -215,6 +221,10 @@ public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
}
/**
* @deprecated no replacement planned
*/
@Deprecated
public class RequiresChannelUrl {
protected List<? extends RequestMatcher> requestMatchers;

2
config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt

@ -527,7 +527,9 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu @@ -527,7 +527,9 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* @param requiresChannelConfiguration custom configuration that specifies
* channel security
* @see [RequiresChannelDsl]
* @deprecated please use [redirectToHttps] instead
*/
@Deprecated(message="since 6.5 use redirectToHttps instead")
fun requiresChannel(requiresChannelConfiguration: RequiresChannelDsl.() -> Unit) {
val requiresChannelCustomizer = RequiresChannelDsl().apply(requiresChannelConfiguration).get()
this.http.requiresChannel(requiresChannelCustomizer)

Loading…
Cancel
Save