-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathGoJose.qll
More file actions
39 lines (34 loc) · 1.15 KB
/
GoJose.qll
File metadata and controls
39 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Provides classes for working with the `gopkg.in/square/go-jose` and `github.com/go-jose/go-jose`
* packages.
*/
overlay[local?]
module;
import go
private module GoJose {
/**
* Provides classes and predicates for working with the `gopkg.in/square/go-jose/jwt` and
* `github.com/go-jose/go-jose/jwt` packages.
*/
private module Jwt {
private import semmle.go.security.MissingJwtSignatureCheckCustomizations::MissingJwtSignatureCheck
/** The method `JSONWebToken.Claims`. */
private class GoJoseParseWithClaims extends JwtSafeParse {
GoJoseParseWithClaims() {
this.(Method).hasQualifiedName(goJoseJwtPackage(), "JSONWebToken", "Claims")
}
override int getTokenArgNum() { result = -1 }
}
/**
* Gets the package names `gopkg.in/square/go-jose/jwt`, `gopkg.in/go-jose/go-jose/jwt`,
* `github.com/square/go-jose/jwt`, and `github.com/go-jose/go-jose/jwt`.
*/
private string goJoseJwtPackage() {
result =
package([
"gopkg.in/square/go-jose", "gopkg.in/go-jose/go-jose", "github.com/square/go-jose",
"github.com/go-jose/go-jose"
], "jwt")
}
}
}