@@ -32,7 +32,7 @@ class TypeJwtHandlerAdapter extends Class {
32
32
TypeJwtHandlerAdapter ( ) { this .hasQualifiedName ( "io.jsonwebtoken" , "JwtHandlerAdapter" ) }
33
33
}
34
34
35
- /** The `parse(token, handler)` method defined in `TypeJwtParser `. */
35
+ /** The `parse(token, handler)` method defined in `JwtParser `. */
36
36
private class JwtParserParseHandlerMethod extends Method {
37
37
JwtParserParseHandlerMethod ( ) {
38
38
this .hasName ( "parse" ) and
@@ -41,7 +41,7 @@ private class JwtParserParseHandlerMethod extends Method {
41
41
}
42
42
}
43
43
44
- /** The `parse(token)`, `parseClaimsJwt(token)` and `parsePlaintextJwt(token)` methods defined in `TypeJwtParser `. */
44
+ /** The `parse(token)`, `parseClaimsJwt(token)` and `parsePlaintextJwt(token)` methods defined in `JwtParser `. */
45
45
private class JwtParserInsecureParseMethods extends Method {
46
46
JwtParserInsecureParseMethods ( ) {
47
47
this .hasName ( [ "parse" , "parseClaimsJwt" , "parsePlaintextJwt" ] ) and
@@ -50,7 +50,7 @@ private class JwtParserInsecureParseMethods extends Method {
50
50
}
51
51
}
52
52
53
- /** The `onClaimsJwt(jwt)` and `onPlaintextJwt(jwt)` methods defined in `TypeJwtHandler `. */
53
+ /** The `onClaimsJwt(jwt)` and `onPlaintextJwt(jwt)` methods defined in `JwtHandler `. */
54
54
private class JwtHandlerOnJwtMethods extends Method {
55
55
JwtHandlerOnJwtMethods ( ) {
56
56
this .hasName ( [ "onClaimsJwt" , "onPlaintextJwt" ] ) and
@@ -59,7 +59,7 @@ private class JwtHandlerOnJwtMethods extends Method {
59
59
}
60
60
}
61
61
62
- /** The `onClaimsJwt(jwt)` and `onPlaintextJwt(jwt)` methods defined in `TypeJwtHandlerAdapter `. */
62
+ /** The `onClaimsJwt(jwt)` and `onPlaintextJwt(jwt)` methods defined in `JwtHandlerAdapter `. */
63
63
private class JwtHandlerAdapterOnJwtMethods extends Method {
64
64
JwtHandlerAdapterOnJwtMethods ( ) {
65
65
this .hasName ( [ "onClaimsJwt" , "onPlaintextJwt" ] ) and
@@ -100,24 +100,24 @@ private class JwtParserInsecureParseMethodAccess extends MethodAccess {
100
100
}
101
101
102
102
/**
103
- * Holds if `signingMa` directly or indirectly sets a signing key for `expr`, which is a `TypeJwtParser `.
104
- * The `setSigningKey` and `setSigningKeyResolver` methods set a signing key for a `TypeJwtParser `.
103
+ * Holds if `signingMa` directly or indirectly sets a signing key for `expr`, which is a `JwtParser `.
104
+ * The `setSigningKey` and `setSigningKeyResolver` methods set a signing key for a `JwtParser `.
105
105
* Directly means code like this:
106
106
* ```java
107
107
* Jwts.parser().setSigningKey(key).parse(token);
108
108
* ```
109
- * Here the signing key is set directly on a `TypeJwtParser `.
109
+ * Here the signing key is set directly on a `JwtParser `.
110
110
* Indirectly means code like this:
111
111
* ```java
112
112
* Jwts.parserBuilder().setSigningKey(key).build().parse(token);
113
113
* ```
114
- * In this case, the signing key is set on a `TypeJwtParserBuilder ` indirectly setting the key of `TypeJwtParser ` that is created by the call to `build`.
114
+ * In this case, the signing key is set on a `JwtParserBuilder ` indirectly setting the key of `JwtParser ` that is created by the call to `build`.
115
115
*/
116
116
private predicate isSigningKeySet ( Expr expr , MethodAccess signingMa ) {
117
117
any ( SigningToExprDataFlow s ) .hasFlow ( DataFlow:: exprNode ( signingMa ) , DataFlow:: exprNode ( expr ) )
118
118
}
119
119
120
- /** An expr that is a `TypeJwtParser ` for which a signing key has been set. */
120
+ /** An expr that is a `JwtParser ` for which a signing key has been set. */
121
121
private class JwtParserWithSigningKeyExpr extends Expr {
122
122
MethodAccess signingMa ;
123
123
@@ -131,8 +131,8 @@ private class JwtParserWithSigningKeyExpr extends Expr {
131
131
}
132
132
133
133
/**
134
- * Models flow from `SigningKeyMethodAccess`es to expressions that are a (sub-type of) `TypeJwtParser `.
135
- * This is used to determine whether a `TypeJwtParser ` has a signing key set.
134
+ * Models flow from `SigningKeyMethodAccess`es to expressions that are a (sub-type of) `JwtParser `.
135
+ * This is used to determine whether a `JwtParser ` has a signing key set.
136
136
*/
137
137
private class SigningToExprDataFlow extends DataFlow:: Configuration {
138
138
SigningToExprDataFlow ( ) { this = "SigningToExprDataFlow" }
@@ -145,7 +145,7 @@ private class SigningToExprDataFlow extends DataFlow::Configuration {
145
145
sink .asExpr ( ) .getType ( ) .( RefType ) .getASourceSupertype * ( ) instanceof TypeJwtParser
146
146
}
147
147
148
- /** Models the builder style of `TypeJwtParser ` and `TypeJwtParserBuilder `. */
148
+ /** Models the builder style of `JwtParser ` and `JwtParserBuilder `. */
149
149
override predicate isAdditionalFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
150
150
(
151
151
pred .asExpr ( ) .getType ( ) .( RefType ) .getASourceSupertype * ( ) instanceof TypeJwtParser or
@@ -155,7 +155,7 @@ private class SigningToExprDataFlow extends DataFlow::Configuration {
155
155
}
156
156
}
157
157
158
- /** An access to the `setSigningKey` or `setSigningKeyResolver` method (or an overriden method) defined in `TypeJwtParser ` and `TypeJwtParserBuilder `. */
158
+ /** An access to the `setSigningKey` or `setSigningKeyResolver` method (or an overriden method) defined in `JwtParser ` and `JwtParserBuilder `. */
159
159
private class SigningKeyMethodAccess extends MethodAccess {
160
160
SigningKeyMethodAccess ( ) {
161
161
exists ( Method m |
0 commit comments