Skip to content

Commit 259a053

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: rename some classes, adjust some qldocs
1 parent 8c512c4 commit 259a053

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TypeAbstractRequestMatcherRegistry extends Class {
4242
/**
4343
* A call to the `HttpSecurity.authorizeRequests` method.
4444
*
45-
* Note: this API is deprecated and scheduled for removal
45+
* Note: this method is deprecated and scheduled for removal
4646
* in Spring Security 7.0.
4747
*/
4848
class AuthorizeRequestsCall extends MethodCall {
@@ -55,7 +55,7 @@ class AuthorizeRequestsCall extends MethodCall {
5555
/**
5656
* A call to the `HttpSecurity.authorizeHttpRequests` method.
5757
*
58-
* Note: the no-argument version of this API is deprecated
58+
* Note: the no-argument version of this method is deprecated
5959
* and scheduled for removal in Spring Security 7.0.
6060
*/
6161
class AuthorizeHttpRequestsCall extends MethodCall {
@@ -65,15 +65,25 @@ class AuthorizeHttpRequestsCall extends MethodCall {
6565
}
6666
}
6767

68-
/** A call to the `HttpSecurity.requestMatcher` method. */
68+
/**
69+
* A call to the `HttpSecurity.requestMatcher` method.
70+
*
71+
* Note: this method was removed in Spring Security 6.0.
72+
* It was replaced by `securityMatcher`.
73+
*/
6974
class RequestMatcherCall extends MethodCall {
7075
RequestMatcherCall() {
7176
this.getMethod().hasName("requestMatcher") and
7277
this.getMethod().getDeclaringType() instanceof TypeHttpSecurity
7378
}
7479
}
7580

76-
/** A call to the `HttpSecurity.requestMatchers` method. */
81+
/**
82+
* A call to the `HttpSecurity.requestMatchers` method.
83+
*
84+
* Note: this method was removed in Spring Security 6.0.
85+
* It was replaced by `securityMatchers`.
86+
*/
7787
class RequestMatchersCall extends MethodCall {
7888
RequestMatchersCall() {
7989
this.getMethod().hasName("requestMatchers") and

java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ private import semmle.code.java.frameworks.spring.SpringBoot
88
* A call to an `HttpSecurity` matcher method with argument
99
* `EndpointRequest.toAnyEndpoint()`.
1010
*/
11-
private class MatcherCall extends MethodCall {
12-
MatcherCall() {
11+
private class HttpSecurityMatcherCall extends MethodCall {
12+
HttpSecurityMatcherCall() {
1313
(
1414
this instanceof RequestMatcherCall or
1515
this instanceof SecurityMatcherCall
@@ -22,8 +22,8 @@ private class MatcherCall extends MethodCall {
2222
* A call to an `HttpSecurity` matchers method with lambda
2323
* argument `EndpointRequest.toAnyEndpoint()`.
2424
*/
25-
private class MatchersCall extends MethodCall {
26-
MatchersCall() {
25+
private class HttpSecurityMatchersCall extends MethodCall {
26+
HttpSecurityMatchersCall() {
2727
(
2828
this instanceof RequestMatchersCall or
2929
this instanceof SecurityMatchersCall
@@ -56,10 +56,10 @@ private class AuthorizeCall extends MethodCall {
5656
predicate permitsSpringBootActuators(PermitAllCall permitAllCall) {
5757
exists(AuthorizeCall authorizeCall |
5858
// .requestMatcher(EndpointRequest).authorizeRequests([...]).[...]
59-
authorizeCall.getQualifier() instanceof MatcherCall
59+
authorizeCall.getQualifier() instanceof HttpSecurityMatcherCall
6060
or
6161
// .requestMatchers(matcher -> EndpointRequest).authorizeRequests([...]).[...]
62-
authorizeCall.getQualifier() instanceof MatchersCall
62+
authorizeCall.getQualifier() instanceof HttpSecurityMatchersCall
6363
|
6464
// [...].authorizeRequests(r -> r.anyRequest().permitAll()) or
6565
// [...].authorizeRequests(r -> r.requestMatchers(EndpointRequest).permitAll())
@@ -98,7 +98,7 @@ predicate permitsSpringBootActuators(PermitAllCall permitAllCall) {
9898
permitAllCall.getQualifier() = registryRequestMatchersCall
9999
)
100100
or
101-
exists(Variable v, MatcherCall matcherCall |
101+
exists(Variable v, HttpSecurityMatcherCall matcherCall |
102102
// http.securityMatcher(EndpointRequest.toAnyEndpoint());
103103
// http.authorizeRequests([...].permitAll())
104104
v.getAnAccess() = authorizeCall.getQualifier() and

0 commit comments

Comments
 (0)