Expand description
Which match statements cover a path, and what their wildcards hold (#59).
As measured with tools/oracle/rules_paths.py (tests/fixtures/rules_paths.json):
- A
matchcovers a path when its segments, after those of everymatcharound it (outermost first, from the service), take the whole path:databases, the database ID,documents, then the document’s segments. Itsallowstatements apply to that path only; amatchthat takes part of it only leads to the matches inside. - A literal segment takes itself; a wildcard (
{d},{d=*}) takes one segment and holds it as a string. - A recursive wildcard (
{rest=**}) holds a path: one or more segments in rules version 1, where the compiler only allows it last, and zero or more in version 2, where it may come anywhere, once permatch. So in version 2/c/{d}/{rest=**}coversc/ditself, and a nested/{rest=**}covers the document of thematcharound it.
A list is checked on its collection’s path followed by an unknown document ID, and a
collection group’s path holds an unknown run of segments before its collection ID
(tools/oracle/rules_list.py): only a wildcard takes the unknown ID, and leaves its variable
unbound (using it is a Null value error); only a recursive wildcard takes an unknown run.
Structs§
- Covering
- A
matchthat covers a path: the matches from the service down to it, and the variables they bound, outermost first.
Enums§
Constants§
- UNKNOWN_
ID - How an unknown document ID shows in a recursive wildcard’s path (no segment holds it).
- UNKNOWN_
RUN - How an unknown run of segments shows in a recursive wildcard’s path.
Functions§
- covering
- Every
matchofservicethat coverspath, in source order (amatchbefore the ones inside it). Amatchthat covers it in several ways (two recursive wildcards splitting it differently) is listed once, with the first way found, which gives earlier recursive wildcards fewer segments. - covering_
parts coveringfor a path with unknown parts.