Skip to content

Commit d5b690c

Browse files
coadaflorinsaritai
andauthored
Apply suggestions from code review
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
1 parent 870ce1b commit d5b690c

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ We need to add a tuple to the ``sinkModel(path, input, kind, provenance)`` exten
108108
data:
109109
- ["sqlx_core::query::query", "Argument[0]", "sql-injection", "manual"]
110110
111-
Since we want to add a new sink, we need to add a tuple to the ``sinkModel`` extensible predicate.
112111
113112
- The first value ``sqlx_core::query::query`` is the canonical path of the function to model. Note that this is the internal module path (``sqlx_core::query::query``), not the public re-export path (``sqlx::query``).
114113
- The second value ``Argument[0]`` is the access path to the first argument of the function call, which is the SQL query string. This is the location of the sink.
@@ -138,7 +137,6 @@ We need to add a tuple to the ``sourceModel(path, output, kind, provenance)`` ex
138137
data:
139138
- ["reqwest::get", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"]
140139
141-
Since we are adding a new source, we need to add a tuple to the ``sourceModel`` extensible predicate.
142140
143141
- The first value ``reqwest::get`` is the canonical path of the function.
144142
- The second value ``ReturnValue.Future.Field[core::result::Result::Ok(0)]`` is the access path to the output. This compound path is read left to right:
@@ -201,7 +199,6 @@ We need to add a tuple to the ``summaryModel(path, input, output, kind, provenan
201199
data:
202200
- ["<reqwest::response::Response>::text", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"]
203201
204-
Since we are adding flow through a method, we need to add a tuple to the ``summaryModel`` extensible predicate.
205202
206203
- The first value ``<reqwest::response::Response>::text`` is the canonical path. Note the format ``<Type>::method`` used for inherent methods. Also note that the canonical path uses the internal module path ``reqwest::response::Response``, not just ``reqwest::Response``.
207204
- The second value ``Argument[self]`` is the access path to the input. ``Argument[self]`` refers to the receiver of the method call (``response`` in the example).
@@ -275,7 +272,6 @@ We need to add tuples to the ``summaryModel(path, input, output, kind, provenanc
275272
data:
276273
- ["<_ as core::iter::traits::iterator::Iterator>::map", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"]
277274
278-
Since we are adding flow through a trait method, we need to add a tuple to the ``summaryModel`` extensible predicate.
279275
280276
- The first value ``<_ as core::iter::traits::iterator::Iterator>::map`` is the canonical path. The ``<_ as Trait>::method`` form uses a wildcard type (``_``) to match any type that implements the ``Iterator`` trait.
281277
- The second value ``Argument[self].Element`` is the access path to the input — the elements of the iterator (the receiver).
@@ -324,7 +320,7 @@ Consider a hypothetical function ``my_crate::sanitize::escape_sql`` which escape
324320
// ...
325321
}
326322
327-
We need to add a tuple to the ``barrierModel``\(path, output, kind, provenance) extensible predicate by updating a data extension file.
323+
We need to add a tuple to the ``barrierModel(path, output, kind, provenance)`` extensible predicate by updating a data extension file.
328324

329325
.. code-block:: yaml
330326
@@ -335,7 +331,6 @@ We need to add a tuple to the ``barrierModel``\(path, output, kind, provenance)
335331
data:
336332
- ["my_crate::sanitize::escape_sql", "ReturnValue", "sql-injection", "manual"]
337333
338-
Since we are adding a barrier, we need to add a tuple to the ``barrierModel`` extensible predicate.
339334
340335
- The first value ``my_crate::sanitize::escape_sql`` is the canonical path of the function.
341336
- The second value ``ReturnValue`` is the access path to the output of the barrier, which means that the return value is considered sanitized.
@@ -359,7 +354,7 @@ Consider a hypothetical function ``my_crate::validate::is_safe_path`` which retu
359354
}
360355
}
361356
362-
We need to add a tuple to the ``barrierGuardModel``\(path, input, acceptingValue, kind, provenance) extensible predicate by updating a data extension file.
357+
We need to add a tuple to the ``barrierGuardModel(path, input, acceptingValue, kind, provenance)`` extensible predicate by updating a data extension file.
363358

364359
.. code-block:: yaml
365360
@@ -370,7 +365,6 @@ We need to add a tuple to the ``barrierGuardModel``\(path, input, acceptingValue
370365
data:
371366
- ["my_crate::validate::is_safe_path", "Argument[0]", "true", "path-injection", "manual"]
372367
373-
Since we are adding a barrier guard, we need to add a tuple to the ``barrierGuardModel`` extensible predicate.
374368
375369
- The first value ``my_crate::validate::is_safe_path`` is the canonical path of the function.
376370
- The second value ``Argument[0]`` is the access path to the input whose flow is blocked. In this case, the first argument to the function (``user_path`` in the example).

0 commit comments

Comments
 (0)