Chrissi | Freaky
Chrissi | Freakyā€¢2mo ago

Why Are Permissions Enabled Globally and Not Per Dependency?

I've been trying out Deno and built a small project. One thing heard about Deno was the control over what a package can do on your system. However, after going through the docs and experimenting, I noticed that permissions can only be enabled globally for the project. Is there a way to allow specific permissions, like file system access, for just one package? It feels a bit confusing because in my small project, I already need to allow three permissions, and Iā€™m tempted to just use the -A flag for convenience. Could someone clarify this for me?
6 Replies
crowlKats
crowlKatsā€¢2mo ago
simple answer to the title question: technical limitations we have not been able to work around (yet)
Chrissi | Freaky
Chrissi | FreakyOPā€¢2mo ago
ah okay but the plan for a future version would be to give Permissions per Dependency?
Doctor šŸ¤–
Doctor šŸ¤–ā€¢2mo ago
I wouldn't say its something they intend to eventually do, but if someone figures out a viable way to do it then I guess it would probably be implemented.
Chrissi | Freaky
Chrissi | FreakyOPā€¢2mo ago
Wouldn't it be beneficial to have more detailed control over permissions? I'm trying to understand why this approach is considered safer than Node.js. Maybe I'm missing something?
Doctor šŸ¤–
Doctor šŸ¤–ā€¢2mo ago
It would but there is a technical limitation preventing them from implementing it. This current approach is still better than nodejs because you can limit, what directories and files are opened, what commands are executed, etc. Deno offers you the ability to prevent a random dependency from executing rm -rf /
Chrissi | Freaky
Chrissi | FreakyOPā€¢2mo ago
Alright that clears it up