Markdown OKF-Schema Studio

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
SwRS-MDOKFSTUDIO-TRUST-025: A resource reference resolves only to an existing file inside a rootSwRS-MDOKFSTUDIO-TRUST-0257 teststhe page gets the address of thefile only if the reference is arelative path that decodes safelyto an existing regular file insidethe allowed rootsSwRS-MDOKFSTUDIO-TRUST-007: A page loads local files only from its resource rootsSwRS-MDOKFSTUDIO-TRUST-0077 teststhe webview loads local files onlyfrom the resource root of thepreview and the bundle folder ofthe extensionSwRS-MDOKFSTUDIO-TRUST-025: A resource reference resolves only to an existing file inside a rootSwRS-MDOKFSTUDIO-TRUST-0257 testsa reference that leaves theroots or names no regularfile is refused with a codeSwRS-MDOKFSTUDIO-TRUST-007: A page loads local files only from its resource rootsSwRS-MDOKFSTUDIO-TRUST-0077 teststhe pending page and the missing-source page allow no localfileThe document refers to a local imageThe document refers to alocal imageThe page holds the address of a file inside the allowed rootsThe page holds theaddress of a file insidethe allowed rootsThe image is shown from an allowed folderThe image is shown froman 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