Use case StRS-MDOKFSTUDIO-TRUST-004
Local files load only from the allowed folders
As a reader, I preview a Markdown file from anywhere on my disk and see the images and media beside it, without the preview reading the rest of my disk, whether the path uses parent paths, encoding or links.
Use case diagram
How it is split
This use case (StRS) is reached by one path (the coloured line). A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.
path 1: Load a local image other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: Load a local image
- The document refers to a local imageSwRS-MDOKFSTUDIO-TRUST-025 a reference that leaves the roots or names no regular file is refused with a codeSwRS-MDOKFSTUDIO-TRUST-025 · 7 tests the page gets the address of the file only if the reference is a relative path that decodes safely to an existing regular file inside the allowed roots
- The page holds the address of a file inside the allowed rootsSwRS-MDOKFSTUDIO-TRUST-007 the pending page and the missing-source page allow no local fileSwRS-MDOKFSTUDIO-TRUST-007 · 7 tests the webview loads local files only from the resource root of the preview and the bundle folder of the extension
- The image is shown from an allowed folder
This map has 65 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 2 behaviours on the map are tested one by one, with 14 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-TRUST-002A preview with restricted reads reads includes and resources from the folder of its document only, and no home folder or dot-directory not on the map6 testsSwRS-MDOKFSTUDIO-TRUST-007A page loads local files only from its resource roots 7 testsSwRS-MDOKFSTUDIO-TRUST-025A resource reference resolves only to an existing file inside a root 7 testsSwRS-MDOKFSTUDIO-TRUST-091A restricted-reads preview shows the images of its folders not on the map5 tests