-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Secure external file access macro functions #5163
Comments
For browsers:
These first two are already available to MapTool by creating a HTML5 panel. Drag and Drop would require more effort. In addition, Chrome has a File System access API which:
|
I think I can conclude that I was getting ahead of myself in pondering how to represent the file handle data structure in MTScript, and thinking that the read/write macro functions should pop up a progress bar. There's a lot of work to break down for implementing this, and the Secure Context and user gesture tracking are necessary preconditions. |
https://wicg.github.io/file-system-access/#privacy-considerations would be a useful reference for some things to restrict granting file access to. |
Describe the Problem
#4728 #3826 and #4677 are open issues for various forms of external file access for reading.
#4728 and #3826 are possible to implement by using a HTML5 dialog to prompt to enter a path like https://discord.com/channels/296230822262865920/1222304280204279948
though some use-cases would find needing to prompt every time to be inconvenient.
#4677 is related and could be part of the same mechanism, but only needs to read and is a fully interactive process so has fewer security considerations.
I would like to associate tokens with an external file, like the herolab functions, but in a more generic way since I do not use herolab.
I would also like to be able to write changes to these external files since mid-round players may expend ammunition, FP and other resources, and these changes belong in the character sheet instead of the tokens since the character sheet is the canonical source of truth.
Additionally, prompting every time changes need to be made is going to be unusable, and deferring saving of changes for a manual (or prompted at the end of a round) write-back risks forgetting.
The Solution you'd like
TBD. I am reading through documentation and specifications of browser file access APIs since they have a similar security threat model since they involve running arbitrary scripts from a semi-trusted source.
Discussion has mostly occurred in https://discord.com/channels/296230822262865920/1334279244104077363
Craig has made the point that this mustn't provide automatic file access but prompting every session is an acceptable compromise.
Reverend has suggested the Resources interface is an existing mechanism for specifying directories to expose to MapTool.
Alternatives that you've considered.
Write a bot that handles external file access. This is less useful for other MapTool users and will require ongoing work to maintain.
Additional Context
No response
The text was updated successfully, but these errors were encountered: