Skip to main content

Module include

Module include 

Source
Expand description

include: expanding pointers into the objects they point at.

The algorithm is upstream’s (RestQuery.js:241-258 for path expansion, :1057-1288 for execution). Every prefix of every dotted path is materialized and the paths are sorted by depth, so a parent resolves before its children. Per level, the pointers at that path are collected and grouped by target class, and one query is issued per target class per level rather than one per pointer.

The part that is not an optimization: the nested query is a full read against the target class with the caller’s own scope, so the target class’s CLP, its object ACLs and its protected fields all apply. Grafting a row in without that is the classic Parse data leak, because the caller is authorized for the class holding the pointer and not for the class it points at. This module deliberately does not fetch anything; it collects and grafts, and the pipeline owns the read.

include=* is out of scope for 0.2.0 and is refused at parse time. See crate::query_parse::parse_include.

Functions§

collect_pointers
Collect every pointer at path, walking through arrays.
exclude_keys_for_path
The excludeKeys an included query inherits (RestQuery.js:1216-1234).
graft
Replace the pointers at path with the fetched objects.
keys_for_path
The keys an included query inherits (RestQuery.js:1196-1214).
paths_forced_by_projection
The extra include paths keys and excludeKeys force (RestQuery.js:148-183).
shape_included
Shape a fetched row for grafting: __type and className, and the _User stripping.

Type Aliases§

PointersByClass
Pointers found at one path, grouped by target class, in encounter order.