Skip to content

Commit 72070cd

Browse files
committed
Deprecate ChannelSecurityConfigurer
Closes gh-16680
1 parent be23268 commit 72070cd

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Diff for: config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java

+2
Original file line numberDiff line numberDiff line change
@@ -3137,7 +3137,9 @@ public ChannelSecurityConfigurer<HttpSecurity>.ChannelRequestMatcherRegistry req
31373137
* the {@link ChannelSecurityConfigurer.ChannelRequestMatcherRegistry}
31383138
* @return the {@link HttpSecurity} for further customizations
31393139
* @throws Exception
3140+
* @deprecated Use {@link #redirectToHttps}
31403141
*/
3142+
@Deprecated
31413143
public HttpSecurity requiresChannel(
31423144
Customizer<ChannelSecurityConfigurer<HttpSecurity>.ChannelRequestMatcherRegistry> requiresChannelCustomizer)
31433145
throws Exception {

Diff for: config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java

+10
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
* @author Rob Winch
7979
* @author Onur Kagan Ozcan
8080
* @since 3.2
81+
* @deprecated please use {@link HttpsRedirectConfigurer} instead
8182
*/
83+
@Deprecated
8284
public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
8385
extends AbstractHttpConfigurer<ChannelSecurityConfigurer<H>, H> {
8486

@@ -147,6 +149,10 @@ private ChannelRequestMatcherRegistry addAttribute(String attribute, List<? exte
147149
return this.REGISTRY;
148150
}
149151

152+
/**
153+
* @deprecated no replacement planned
154+
*/
155+
@Deprecated
150156
public final class ChannelRequestMatcherRegistry
151157
extends AbstractConfigAttributeRequestMatcherRegistry<RequiresChannelUrl> {
152158

@@ -215,6 +221,10 @@ public H and() {
215221

216222
}
217223

224+
/**
225+
* @deprecated no replacement planned
226+
*/
227+
@Deprecated
218228
public class RequiresChannelUrl {
219229

220230
protected List<? extends RequestMatcher> requestMatchers;

Diff for: config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt

+2
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
527527
* @param requiresChannelConfiguration custom configuration that specifies
528528
* channel security
529529
* @see [RequiresChannelDsl]
530+
* @deprecated please use [redirectToHttps] instead
530531
*/
532+
@Deprecated(message="since 6.5 use redirectToHttps instead")
531533
fun requiresChannel(requiresChannelConfiguration: RequiresChannelDsl.() -> Unit) {
532534
val requiresChannelCustomizer = RequiresChannelDsl().apply(requiresChannelConfiguration).get()
533535
this.http.requiresChannel(requiresChannelCustomizer)

0 commit comments

Comments
 (0)