snaps icon indicating copy to clipboard operation
snaps copied to clipboard

Detect unused permissions in Snaps CLI

Open Mrtenz opened this issue 11 months ago • 0 comments

We should add a feature to the Snaps CLI to detect unused permissions, and log a warning if a permission is requested from the manifest but not used.

  • For exports-related permissions (onRpcRequest, onTransaction, etc.) we can hook into the eval functionality to detect which exports the Snap has.
  • To detect other permissions, we may need to do some AST parsing, detecting if certain methods are used, and so on, depending on complexity.
  • Ideally there's some way to ignore the warnings as well (through a config option) in case of false positives.

Mrtenz avatar Apr 01 '25 13:04 Mrtenz