Browse Source

Add deprecation warning to mvcMatchers methods

Issue gh-11347
pull/11880/head
Marcus Da Coregio 3 years ago
parent
commit
bc4ad52feb
  1. 10
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/ChannelSecurityConfigurer.java
  2. 8
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java
  3. 8
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java

10
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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -155,13 +155,21 @@ public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
setApplicationContext(context); setApplicationContext(context);
} }
/**
* @deprecated use {@link #requestMatchers(HttpMethod, String...)} instead
*/
@Override @Override
@Deprecated
public MvcMatchersRequiresChannelUrl mvcMatchers(HttpMethod method, String... mvcPatterns) { public MvcMatchersRequiresChannelUrl mvcMatchers(HttpMethod method, String... mvcPatterns) {
List<MvcRequestMatcher> mvcMatchers = createMvcMatchers(method, mvcPatterns); List<MvcRequestMatcher> mvcMatchers = createMvcMatchers(method, mvcPatterns);
return new MvcMatchersRequiresChannelUrl(mvcMatchers); return new MvcMatchersRequiresChannelUrl(mvcMatchers);
} }
/**
* @deprecated use {@link #requestMatchers(String...)} instead
*/
@Override @Override
@Deprecated
public MvcMatchersRequiresChannelUrl mvcMatchers(String... patterns) { public MvcMatchersRequiresChannelUrl mvcMatchers(String... patterns) {
return mvcMatchers(null, patterns); return mvcMatchers(null, patterns);
} }

8
config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExpressionUrlAuthorizationConfigurer.java

@ -222,12 +222,20 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
setApplicationContext(context); setApplicationContext(context);
} }
/**
* @deprecated use {@link #requestMatchers(HttpMethod, String...)} instead
*/
@Override @Override
@Deprecated
public MvcMatchersAuthorizedUrl mvcMatchers(HttpMethod method, String... mvcPatterns) { public MvcMatchersAuthorizedUrl mvcMatchers(HttpMethod method, String... mvcPatterns) {
return new MvcMatchersAuthorizedUrl(createMvcMatchers(method, mvcPatterns)); return new MvcMatchersAuthorizedUrl(createMvcMatchers(method, mvcPatterns));
} }
/**
* @deprecated use {@link #requestMatchers(String...)} instead
*/
@Override @Override
@Deprecated
public MvcMatchersAuthorizedUrl mvcMatchers(String... patterns) { public MvcMatchersAuthorizedUrl mvcMatchers(String... patterns) {
return mvcMatchers(null, patterns); return mvcMatchers(null, patterns);
} }

8
config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java

@ -202,12 +202,20 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
setApplicationContext(context); setApplicationContext(context);
} }
/**
* @deprecated use {@link #requestMatchers(HttpMethod, String...)} instead
*/
@Override @Override
@Deprecated
public MvcMatchersAuthorizedUrl mvcMatchers(HttpMethod method, String... mvcPatterns) { public MvcMatchersAuthorizedUrl mvcMatchers(HttpMethod method, String... mvcPatterns) {
return new MvcMatchersAuthorizedUrl(createMvcMatchers(method, mvcPatterns)); return new MvcMatchersAuthorizedUrl(createMvcMatchers(method, mvcPatterns));
} }
/**
* @deprecated use {@link #requestMatchers(String...)} instead
*/
@Override @Override
@Deprecated
public MvcMatchersAuthorizedUrl mvcMatchers(String... patterns) { public MvcMatchersAuthorizedUrl mvcMatchers(String... patterns) {
return mvcMatchers(null, patterns); return mvcMatchers(null, patterns);
} }

Loading…
Cancel
Save