@@ -11,43 +11,6 @@ private import semmle.python.frameworks.data.ModelsAsData
1111
1212/** Provides models for the `asyncpg` PyPI package. */
1313private module Asyncpg {
14- class AsyncpgModel extends ModelInput:: TypeModelCsv {
15- override predicate row ( string row ) {
16- // type1;type2;path
17- row =
18- [
19- // a `ConnectionPool` that is created when the result of `asyncpg.create_pool()` is awaited.
20- "asyncpg.ConnectionPool;asyncpg;Member[create_pool].ReturnValue.Awaited" ,
21- // a `Connection` that is created when
22- // * - the result of `asyncpg.connect()` is awaited.
23- // * - the result of calling `acquire` on a `ConnectionPool` is awaited.
24- "asyncpg.Connection;asyncpg;Member[connect].ReturnValue.Awaited" ,
25- "asyncpg.Connection;asyncpg;Member[connection].Member[connect].ReturnValue.Awaited" ,
26- "asyncpg.Connection;asyncpg.ConnectionPool;Member[acquire].ReturnValue.Awaited" ,
27- // Creating an internal `~Connection` type that contains both `Connection` and `ConnectionPool`.
28- "asyncpg.~Connection;asyncpg.Connection;" , //
29- "asyncpg.~Connection;asyncpg.ConnectionPool;"
30- ]
31- }
32- }
33-
34- class AsyncpgSink extends ModelInput:: SinkModelCsv {
35- // type;path;kind
36- override predicate row ( string row ) {
37- row =
38- [
39- // `Connection`s and `ConnectionPool`s provide some methods that execute SQL.
40- "asyncpg.~Connection;Member[copy_from_query,execute,fetch,fetchrow,fetchval].Argument[0,query:];sql-injection" ,
41- "asyncpg.~Connection;Member[executemany].Argument[0,command:];sql-injection" ,
42- // A model of `Connection` and `ConnectionPool`, which provide some methods that access the file system.
43- "asyncpg.~Connection;Member[copy_from_query,copy_from_table].Argument[output:];path-injection" ,
44- "asyncpg.~Connection;Member[copy_to_table].Argument[source:];path-injection" ,
45- // the `PreparedStatement` class in `asyncpg`.
46- "asyncpg.Connection;Member[prepare].Argument[0,query:];sql-injection" ,
47- ]
48- }
49- }
50-
5114 /**
5215 * Provides models of the `Cursor` class in `asyncpg`.
5316 * `Cursor`s are created
0 commit comments