Closed callumforrester closed 10 months ago
Paging @tacaswell and @DiamondJoseph
The refactoring seems good and I think I'm sold on this. The requirement to include the root twice was never great (if I recall correctly, there was a path dependency is that we had read_path and write_path for a while and then we added the notion of root so added it in a way that would not break stuff on the floor).
A different API that we talked about at the time was a root level integer to say how many levels to consider as part of the root but we (incorrectly) judged that was more likely to end up with incorrect values than including the part of the path that was the root directly.
We do not seem to check that self.reg_root
is actually absolute which leaves the thing we are actually trying to prevent (which is relative paths leaking out into the documents).
Fixes #1146
FileStoreBase
"validates" its write path template (unless a read path template is also supplied). In this context that means it checks if the store's root is an ancestor of the template, but does not allow.
as the write path.The use case for this is making a file store write to its own root.
Changes in this PR to address this:
FileStoreBase
consider the value of root (or simply.
) a valid write path under root.Note: If we decide that
.
should be explicitly disallowed, then the first point is easily reversible and the others are hopefully still useful.