From bc4ad52febfc5fe8b419d64aab6e40f1256f5dc6 Mon Sep 17 00:00:00 2001 From: Marcus Da Coregio Date: Thu, 6 Oct 2022 13:20:53 -0300 Subject: [PATCH] Add deprecation warning to mvcMatchers methods Issue gh-11347 --- .../web/configurers/ChannelSecurityConfigurer.java | 10 +++++++++- .../ExpressionUrlAuthorizationConfigurer.java | 8 ++++++++ .../web/configurers/UrlAuthorizationConfigurer.java | 8 ++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java index 979084ce8c..92d9223871 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -155,13 +155,21 @@ public final class ChannelSecurityConfigurer> setApplicationContext(context); } + /** + * @deprecated use {@link #requestMatchers(HttpMethod, String...)} instead + */ @Override + @Deprecated public MvcMatchersRequiresChannelUrl mvcMatchers(HttpMethod method, String... mvcPatterns) { List mvcMatchers = createMvcMatchers(method, mvcPatterns); return new MvcMatchersRequiresChannelUrl(mvcMatchers); } + /** + * @deprecated use {@link #requestMatchers(String...)} instead + */ @Override + @Deprecated public MvcMatchersRequiresChannelUrl mvcMatchers(String... patterns) { return mvcMatchers(null, patterns); } diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java index bf191c4db1..11a6a62544 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java @@ -222,12 +222,20 @@ public final class ExpressionUrlAuthorizationConfigurer> setApplicationContext(context); } + /** + * @deprecated use {@link #requestMatchers(HttpMethod, String...)} instead + */ @Override + @Deprecated public MvcMatchersAuthorizedUrl mvcMatchers(HttpMethod method, String... mvcPatterns) { return new MvcMatchersAuthorizedUrl(createMvcMatchers(method, mvcPatterns)); } + /** + * @deprecated use {@link #requestMatchers(String...)} instead + */ @Override + @Deprecated public MvcMatchersAuthorizedUrl mvcMatchers(String... patterns) { return mvcMatchers(null, patterns); }