When writing code, you can call any function as long as it’s public, and similarly, you can access any object’s public properties or methods. Usually, access to code is all or none – a piece of code can be either public or private. Lately, I’ve been thinking about ways to implement more fine-grained access controls and have looked to the networking world for inspiration…
I love that you’re thinking about how to secure sensitive parts of JS applications, however I wonder what threat this is guarding against. Can you give an example? Surely if an attacker can modify the source to call the sensitive functions, then they could modify the allow list