Skip to content

Commit df6ebc7

Browse files
committed
Rename DelegatingAuthorizationManager
Closes gh-9692
1 parent 17cfc6a commit df6ebc7

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

web/src/main/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManager.java renamed to web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
* @author Evgeniy Cheban
4141
* @since 5.5
4242
*/
43-
public final class DelegatingAuthorizationManager implements AuthorizationManager<HttpServletRequest> {
43+
public final class RequestMatcherDelegatingAuthorizationManager implements AuthorizationManager<HttpServletRequest> {
4444

4545
private final Log logger = LogFactory.getLog(getClass());
4646

4747
private final Map<RequestMatcher, AuthorizationManager<RequestAuthorizationContext>> mappings;
4848

49-
private DelegatingAuthorizationManager(
49+
private RequestMatcherDelegatingAuthorizationManager(
5050
Map<RequestMatcher, AuthorizationManager<RequestAuthorizationContext>> mappings) {
5151
Assert.notEmpty(mappings, "mappings cannot be empty");
5252
this.mappings = mappings;
@@ -85,15 +85,15 @@ public AuthorizationDecision check(Supplier<Authentication> authentication, Http
8585
}
8686

8787
/**
88-
* Creates a builder for {@link DelegatingAuthorizationManager}.
88+
* Creates a builder for {@link RequestMatcherDelegatingAuthorizationManager}.
8989
* @return the new {@link Builder} instance
9090
*/
9191
public static Builder builder() {
9292
return new Builder();
9393
}
9494

9595
/**
96-
* A builder for {@link DelegatingAuthorizationManager}.
96+
* A builder for {@link RequestMatcherDelegatingAuthorizationManager}.
9797
*/
9898
public static final class Builder {
9999

@@ -113,11 +113,11 @@ public Builder add(RequestMatcher matcher, AuthorizationManager<RequestAuthoriza
113113
}
114114

115115
/**
116-
* Creates a {@link DelegatingAuthorizationManager} instance.
117-
* @return the {@link DelegatingAuthorizationManager} instance
116+
* Creates a {@link RequestMatcherDelegatingAuthorizationManager} instance.
117+
* @return the {@link RequestMatcherDelegatingAuthorizationManager} instance
118118
*/
119-
public DelegatingAuthorizationManager build() {
120-
return new DelegatingAuthorizationManager(this.mappings);
119+
public RequestMatcherDelegatingAuthorizationManager build() {
120+
return new RequestMatcherDelegatingAuthorizationManager(this.mappings);
121121
}
122122

123123
}

web/src/test/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManagerTests.java renamed to web/src/test/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManagerTests.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,38 @@
3030
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
3131

3232
/**
33-
* Tests for {@link DelegatingAuthorizationManager}.
33+
* Tests for {@link RequestMatcherDelegatingAuthorizationManager}.
3434
*
3535
* @author Evgeniy Cheban
3636
*/
37-
public class DelegatingAuthorizationManagerTests {
37+
public class RequestMatcherDelegatingAuthorizationManagerTests {
3838

3939
@Test
4040
public void buildWhenMappingsEmptyThenException() {
41-
assertThatIllegalArgumentException().isThrownBy(() -> DelegatingAuthorizationManager.builder().build())
41+
assertThatIllegalArgumentException()
42+
.isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder().build())
4243
.withMessage("mappings cannot be empty");
4344
}
4445

4546
@Test
4647
public void addWhenMatcherNullThenException() {
4748
assertThatIllegalArgumentException()
48-
.isThrownBy(() -> DelegatingAuthorizationManager.builder()
49+
.isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder()
4950
.add(null, (a, o) -> new AuthorizationDecision(true)).build())
5051
.withMessage("matcher cannot be null");
5152
}
5253

5354
@Test
5455
public void addWhenManagerNullThenException() {
55-
assertThatIllegalArgumentException().isThrownBy(
56-
() -> DelegatingAuthorizationManager.builder().add(new MvcRequestMatcher(null, "/grant"), null).build())
56+
assertThatIllegalArgumentException()
57+
.isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder()
58+
.add(new MvcRequestMatcher(null, "/grant"), null).build())
5759
.withMessage("manager cannot be null");
5860
}
5961

6062
@Test
6163
public void checkWhenMultipleMappingsConfiguredThenDelegatesMatchingManager() {
62-
DelegatingAuthorizationManager manager = DelegatingAuthorizationManager.builder()
64+
RequestMatcherDelegatingAuthorizationManager manager = RequestMatcherDelegatingAuthorizationManager.builder()
6365
.add(new MvcRequestMatcher(null, "/grant"), (a, o) -> new AuthorizationDecision(true))
6466
.add(new MvcRequestMatcher(null, "/deny"), (a, o) -> new AuthorizationDecision(false))
6567
.add(new MvcRequestMatcher(null, "/neutral"), (a, o) -> null).build();

0 commit comments

Comments
 (0)