Skip to content

Commit 061c187

Browse files
committed
Convert GithubComGinGonicGinContextBindSource to MaD
1 parent ef833de commit 061c187

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

go/ql/lib/ext/github.com.gin-gonic.gin.model.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,22 @@ extensions:
3737
- ["github.com/gin-gonic/gin", "Context", True, "QueryMap", "", "", "ReturnValue", "remote", "manual"] # TODO: should be .MapValue (and .MapKey?)
3838
- ["github.com/gin-gonic/gin", "Context", True, "Accepted", "", "", "", "remote", "manual"]
3939
- ["github.com/gin-gonic/gin", "Context", True, "Params", "", "", "", "remote", "manual"]
40+
41+
- ["github.com/gin-gonic/gin", "Context", True, "BindJSON", "", "", "Argument[0]", "remote", "manual"]
42+
- ["github.com/gin-gonic/gin", "Context", True, "BindYAML", "", "", "Argument[0]", "remote", "manual"]
43+
- ["github.com/gin-gonic/gin", "Context", True, "BindXML", "", "", "Argument[0]", "remote", "manual"]
44+
- ["github.com/gin-gonic/gin", "Context", True, "BindUri", "", "", "Argument[0]", "remote", "manual"]
45+
- ["github.com/gin-gonic/gin", "Context", True, "BindQuery", "", "", "Argument[0]", "remote", "manual"]
46+
- ["github.com/gin-gonic/gin", "Context", True, "BindWith", "", "", "Argument[0]", "remote", "manual"]
47+
- ["github.com/gin-gonic/gin", "Context", True, "BindHeader", "", "", "Argument[0]", "remote", "manual"]
48+
- ["github.com/gin-gonic/gin", "Context", True, "MustBindWith", "", "", "Argument[0]", "remote", "manual"]
49+
- ["github.com/gin-gonic/gin", "Context", True, "Bind", "", "", "Argument[0]", "remote", "manual"]
50+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBind", "", "", "Argument[0]", "remote", "manual"]
51+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindBodyWith", "", "", "Argument[0]", "remote", "manual"]
52+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindJSON", "", "", "Argument[0]", "remote", "manual"]
53+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindQuery", "", "", "Argument[0]", "remote", "manual"]
54+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindUri", "", "", "Argument[0]", "remote", "manual"]
55+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindHeader", "", "", "Argument[0]", "remote", "manual"]
56+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindWith", "", "", "Argument[0]", "remote", "manual"]
57+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindXML", "", "", "Argument[0]", "remote", "manual"]
58+
- ["github.com/gin-gonic/gin", "Context", True, "ShouldBindYAML", "", "", "Argument[0]", "remote", "manual"]

go/ql/lib/semmle/go/frameworks/Gin.qll

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,6 @@ private module Gin {
99
/** Gets the package name `github.com/gin-gonic/gin`. */
1010
string packagePath() { result = package("github.com/gin-gonic/gin", "") }
1111

12-
/**
13-
* A call to a method on `Context` struct that unmarshals data into a target.
14-
*/
15-
private class GithubComGinGonicGinContextBindSource extends RemoteFlowSource::Range {
16-
GithubComGinGonicGinContextBindSource() {
17-
exists(DataFlow::MethodCallNode call, string methodName |
18-
call.getTarget().hasQualifiedName(packagePath(), "Context", methodName) and
19-
methodName in [
20-
"BindJSON", "BindYAML", "BindXML", "BindUri", "BindQuery", "BindWith", "BindHeader",
21-
"MustBindWith", "Bind", "ShouldBind", "ShouldBindBodyWith", "ShouldBindJSON",
22-
"ShouldBindQuery", "ShouldBindUri", "ShouldBindHeader", "ShouldBindWith",
23-
"ShouldBindXML", "ShouldBindYAML"
24-
]
25-
|
26-
this = FunctionOutput::parameter(0).getExitNode(call)
27-
)
28-
}
29-
}
30-
3112
/**
3213
* The File system access sinks
3314
*/

0 commit comments

Comments
 (0)