Skip to content

Conversation

@vito
Copy link
Owner

@vito vito commented May 28, 2022

a double feature:

(read)ing host paths

You can now (read) host paths! With one caveat: it is not possible to escape the host path's context dir. This is a basic safety mechanism to prevent Bass scripts from reading arbitrary sensitive data from the host. Provided that it is not possible create arbitrary symlinks on the host (the only way to perform writes at all is through memos, this should keep them pretty well sandboxed.

bass.Readable instead of file path strings

The bass.Range type attached to forms returned by bass.Reader (the parser) and used by Annotate, the metadata system, backtrace reporting, etc. now embeds a bass.Readable instead of a file path string. This is a bit of a technical detail, but it allows e.g. error traces to correctly annotate source code from an arbitrary Readable (perhaps a fs.FS backed by a network/API) rather than being limited to local files on disk.

In general this refactor helps clean up areas that previously switched on the concrete Path implementation. For example, the (memos) system could now be refactored to support any Readable. (But I'll save that for another PR.)

vito added 5 commits May 28, 2022 10:09
* host paths can now be read, provided they don't attempt to escape the
  context dir
* Readable now implements CachePath which can be used to return a
  host-side file path containing the Readable's contents
much richer! now an arbitrary FSPath backed by any fs.FS type can
properly show up in backtraces.
@vito vito added the enhancement New feature or request label May 28, 2022
@vito vito changed the title richer paths: (read)able host paths, decoupled traces richer paths: (read)able host paths, generalize annotation paths May 28, 2022
@vito vito merged commit 6149123 into main May 28, 2022
@vito vito deleted the path-reader branch May 28, 2022 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants