Skip to content

Commit 06c7160

Browse files
committed
JS: Extension point -> extensible predicate
2 parents 395a9f0 + ecb46e8 commit 06c7160

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A data extension for JavaScript is a YAML file of the form:
1717
extensions:
1818
- addsTo:
1919
pack: codeql/javascript-all
20-
extensible: <name of extension point>
20+
extensible: <name of extensible predicate>
2121
data:
2222
- <tuple1>
2323
- <tuple2>
@@ -58,7 +58,7 @@ This can be achieved with the following data extension:
5858
- ["execa", "Member[shell].Argument[0]", "command-line-injection"]
5959
6060
61-
- Since we're adding a new sink, we add a tuple to the **sinkModel** extension point.
61+
- Since we're adding a new sink, we add a tuple to the **sinkModel** extensible predicate.
6262
- The first column, **"execa"**, identifies a set of values from which to begin the search for the sink.
6363
The string **"execa"** means we start at the places where the codebase imports the NPM package **execa**.
6464
- The second column is an access path that is evaluated from left to right, starting at the values that were identified by the first column.
@@ -95,7 +95,7 @@ This source is already known by the CodeQL JS analysis, but we'll show how it co
9595
]
9696
9797
98-
- Since we're adding a new taint source, we add a tuple to the **sourceModel** extension point.
98+
- Since we're adding a new taint source, we add a tuple to the **sourceModel** extensible predicate.
9999
- The first column, **"global"**, begins the search at references to the global object (also known as **window** in browser contexts). This is a special JavaScript object that contains all global variables and methods.
100100
- **Member[addEventListener]** selects accesses to the **addEventListener** member.
101101
- **Argument[1]** selects the second argument of calls to that member (the argument containing the callback).
@@ -192,7 +192,7 @@ Using a **typeModel** tuple we can tell our model that this function returns an
192192
- ["mysql.Connection", "@example/db", "Member[getConnection].ReturnValue"]
193193
194194
195-
- Since we're providing type information, we add a tuple to the **typeModel** extension point.
195+
- Since we're providing type information, we add a tuple to the **typeModel** extensible predicate.
196196
- The first column, **"mysql.Connection"**, names the type that we're adding a new definition for.
197197
- The second column, **"@example/db"**, begins the search at imports of the hypothetical NPM package **@example/db**.
198198
- **Member[getConnection]** selects references to the **getConnection** member from that package.
@@ -236,7 +236,7 @@ This flow is already recognized by the CodeQL JS analysis, but this is how it co
236236
]
237237
238238
239-
- Since we're adding flow through a function call, we add a tuple to the **summaryModel** extension point.
239+
- Since we're adding flow through a function call, we add a tuple to the **summaryModel** extensible predicate.
240240
- The first column, **"global"**, begins the search for relevant calls at references to the global object.
241241
In JavaScript, global variables are properties of the global object, so this lets us access global variables or functions.
242242
- The second column, **Member[decodeURIComponent]**, is a path leading to the function calls we wish to model.
@@ -274,7 +274,7 @@ This flow is already recognized by the CodeQL JS analysis, but we'll show how it
274274
]
275275
276276
277-
- Since we're adding flow through a function call, we add a tuple to the **summaryModel** extension point.
277+
- Since we're adding flow through a function call, we add a tuple to the **summaryModel** extensible predicate.
278278
- The first column, **"underscore"**, begins the search for relevant calls at places where the **underscore** package is imported.
279279
- The second column, **Member[forEach]**, selects references to the **forEach** member from the **underscore** package.
280280
- The third column specifies the input of the flow:
@@ -293,10 +293,10 @@ This flow is already recognized by the CodeQL JS analysis, but we'll show how it
293293
Reference material
294294
------------------
295295

296-
The following sections provide reference material for extension points, access paths, types, and kinds.
296+
The following sections provide reference material for extensible predicates, access paths, types, and kinds.
297297

298-
Extension points
299-
----------------
298+
Extensible predicates
299+
---------------------
300300

301301
sourceModel(type, path, kind)
302302
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -394,7 +394,7 @@ Types
394394
-----
395395

396396
A type is a string that identifies a set of values.
397-
In each of the extension points mentioned above, the first column is always the name of a type.
397+
In each of the extensible predicates mentioned above, the first column is always the name of a type.
398398
A type can be defined by adding **typeModel** tuples for that type. Additionally, the following built-in types are available:
399399

400400
- The name of an NPM package matches imports of that package. For example, the type **express** matches the expression **require("express")**. If the package name includes dots, it must be surrounded by single quotes, such as in **'lodash.escape'**.

0 commit comments

Comments
 (0)