target/strelka

Add in 'root id' to 'tree' object

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.
The current 'tree' object in Strelka displays a unique identifier for the current File (node) as well as (if applicable) the identifier for the parent File (parent). If the depth of a file is greater than 1 (i.e., if a file is insize a zip is inside a zip), then a user will have to walk from parent to node to get one level up, then walk from parent to node again to get the original object. While users can access the root node with request.id, it is not available in the 'tree' object.

Current working tree:

For depth: 0 
    "tree": {
      "node": "33523e49-a66c-404e-9aa9-da6afa7dd376",
    }

For depth: 1
    "tree": {
      "node": "a140807c-561e-41b0-b855-de806e87812b",
      "parent": "33523e49-a66c-404e-9aa9-da6afa7dd376",
    }

For depth: 2
    "tree": {
      "node": "34a377ac-3057-4b55-a333-af56e11d517e",
      "parent": "a140807c-561e-41b0-b855-de806e87812b",
    }

If you are examining the record at depth:2, you would need to use that tree.parent id to get to depth:1 and repeat to get to the root file.

Describe the solution you'd like
Add in a tree.root object that always maintains the root id.

For depth: 0 
    "tree": {
      "node": "33523e49-a66c-404e-9aa9-da6afa7dd376",
      "root": "33523e49-a66c-404e-9aa9-da6afa7dd376"
    }

For depth: 1
    "tree": {
      "node": "a140807c-561e-41b0-b855-de806e87812b",
      "parent": "33523e49-a66c-404e-9aa9-da6afa7dd376",
      "root": "33523e49-a66c-404e-9aa9-da6afa7dd376"
    }

For depth: 2
    "tree": {
      "node": "34a377ac-3057-4b55-a333-af56e11d517e",
      "parent": "a140807c-561e-41b0-b855-de806e87812b",
      "root": "33523e49-a66c-404e-9aa9-da6afa7dd376"
    }

Describe alternatives you've considered
Don't do this and add in documentation stating that you can obtain the root object with request.id.

Additional context
N/A

Completed per 3950d55