Skip to content

Commit 1c91055

Browse files
committed
Python: merge package/type columns
1 parent 22316ee commit 1c91055

File tree

6 files changed

+227
-257
lines changed

6 files changed

+227
-257
lines changed

python/ql/lib/semmle/python/frameworks/Asyncpg.qll

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ private module Asyncpg {
1717
row =
1818
[
1919
// a `ConnectionPool` that is created when the result of `asyncpg.create_pool()` is awaited.
20-
"asyncpg;ConnectionPool;asyncpg;;Member[create_pool].ReturnValue.Awaited",
20+
"asyncpg.ConnectionPool;asyncpg;Member[create_pool].ReturnValue.Awaited",
2121
// a `Connection` that is created when
2222
// * - the result of `asyncpg.connect()` is awaited.
2323
// * - the result of calling `acquire` on a `ConnectionPool` is awaited.
24-
"asyncpg;Connection;asyncpg;;Member[connect].ReturnValue.Awaited",
25-
"asyncpg;Connection;asyncpg;ConnectionPool;Member[acquire].ReturnValue.Awaited",
24+
"asyncpg.Connection;asyncpg;Member[connect].ReturnValue.Awaited",
25+
"asyncpg.Connection;asyncpg.ConnectionPool;Member[acquire].ReturnValue.Awaited",
2626
// Creating an internal `~Connection` type that contains both `Connection` and `ConnectionPool`.
27-
"asyncpg;~Connection;asyncpg;Connection;", "asyncpg;~Connection;asyncpg;ConnectionPool;"
27+
"asyncpg.~Connection;asyncpg.Connection;", //
28+
"asyncpg.~Connection;asyncpg.ConnectionPool;"
2829
]
2930
}
3031
}
@@ -35,13 +36,13 @@ private module Asyncpg {
3536
row =
3637
[
3738
// `Connection`s and `ConnectionPool`s provide some methods that execute SQL.
38-
"asyncpg;~Connection;Member[copy_from_query,execute,fetch,fetchrow,fetchval].Argument[0,query:];sql-injection",
39-
"asyncpg;~Connection;Member[executemany].Argument[0,command:];sql-injection",
39+
"asyncpg.~Connection;Member[copy_from_query,execute,fetch,fetchrow,fetchval].Argument[0,query:];sql-injection",
40+
"asyncpg.~Connection;Member[executemany].Argument[0,command:];sql-injection",
4041
// A model of `Connection` and `ConnectionPool`, which provide some methods that access the file system.
41-
"asyncpg;~Connection;Member[copy_from_query,copy_from_table].Argument[output:];path-injection",
42-
"asyncpg;~Connection;Member[copy_to_table].Argument[source:];path-injection",
42+
"asyncpg.~Connection;Member[copy_from_query,copy_from_table].Argument[output:];path-injection",
43+
"asyncpg.~Connection;Member[copy_to_table].Argument[source:];path-injection",
4344
// the `PreparedStatement` class in `asyncpg`.
44-
"asyncpg;Connection;Member[prepare].Argument[0,query:];sql-injection",
45+
"asyncpg.Connection;Member[prepare].Argument[0,query:];sql-injection",
4546
]
4647
}
4748
}
@@ -58,7 +59,7 @@ private module Asyncpg {
5859
module Cursor {
5960
class CursorConstruction extends SqlConstruction::Range, API::CallNode {
6061
CursorConstruction() {
61-
this = ModelOutput::getATypeNode("asyncpg", "Connection").getMember("cursor").getACall()
62+
this = ModelOutput::getATypeNode("asyncpg.Connection").getMember("cursor").getACall()
6263
}
6364

6465
override DataFlow::Node getSql() { result = this.getParameter(0, "query").asSink() }
@@ -76,7 +77,7 @@ private module Asyncpg {
7677
or
7778
exists(API::CallNode prepareCall |
7879
prepareCall =
79-
ModelOutput::getATypeNode("asyncpg", "Connection").getMember("prepare").getACall()
80+
ModelOutput::getATypeNode("asyncpg.Connection").getMember("prepare").getACall()
8081
|
8182
sql = prepareCall.getParameter(0, "query").asSink() and
8283
this =

0 commit comments

Comments
 (0)