Skip to content

Detect unused permissions in Snaps CLI #3290

@Mrtenz

Description

@Mrtenz

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions