Skip to content

Add status to PermissionInfoWithMetadata#8445

Merged
jeffsmale90 merged 2 commits intomainfrom
feat/gator-permissions-status
Apr 15, 2026
Merged

Add status to PermissionInfoWithMetadata#8445
jeffsmale90 merged 2 commits intomainfrom
feat/gator-permissions-status

Conversation

@jeffsmale90
Copy link
Copy Markdown
Contributor

@jeffsmale90 jeffsmale90 commented Apr 14, 2026

Explanation

Gator permissions loaded from storage may be either active, revoked, or expired - this is in addition to the "Revoked" metadata stored with the permission.

With this change, after loading the permissions we resolve the status for each item. While the status is being resolved, we show the previous status held in storage for this item.

Note: this requires a migration.

When resolving the status:

  • if revocationMetadata exists, or revoked onchain - 'Revoked'
  • if expiration after onchain block timestamp 'Expired'
  • otherwise 'Active'

Mocked up UI in Extension:

Screenshot 2026-04-14 at 3 34 54 PM image

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Adds a new persisted status field and introduces on-chain RPC reads via NetworkController during permission sync, which could affect performance and correctness across chains if provider/contract data is misconfigured.

Overview
Adds lifecycle status to gator granted permissions. PermissionInfoWithMetadata now includes a status (Active/Revoked/Expired) and this type is exported for consumers.

Sync now resolves status from chain state after fetching from the snap. After the snap returns granted permissions, the controller temporarily keeps the previous stored status (defaulting to Active for migrated rows) and then calls new permissionOnChainStatus helpers to: treat revocationMetadata or DelegationManager.disabledDelegations as Revoked, use TimestampEnforcer caveats plus latest block timestamp for Expired, otherwise Active.

Integration surface expands. GatorPermissionsController now depends on NetworkController actions to obtain a chain provider, and the package adds @metamask/network-controller and @metamask/abi-utils dependencies; tests were updated and new unit tests were added for the on-chain status resolver.

Reviewed by Cursor Bugbot for commit ce97078. Bugbot is set up for automated code reviews on this repo. Configure here.

@jeffsmale90 jeffsmale90 requested review from a team as code owners April 14, 2026 03:51
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 46e2976. Configure here.

Comment thread packages/gator-permissions-controller/src/types.ts Outdated
@jeffsmale90 jeffsmale90 marked this pull request as draft April 14, 2026 18:50
@jeffsmale90 jeffsmale90 force-pushed the feat/gator-permissions-status branch from 1517a54 to 01ee3ff Compare April 14, 2026 23:38
@jeffsmale90 jeffsmale90 changed the title After loading gator permissions, resolve status for each item Add status to stored gator permissions Apr 14, 2026
@jeffsmale90 jeffsmale90 changed the title Add status to stored gator permissions Add status to PermissionInfoWithMetadata Apr 14, 2026
@jeffsmale90 jeffsmale90 force-pushed the feat/gator-permissions-status branch 2 times, most recently from 3a6cd2f to d6f7efa Compare April 15, 2026 00:01
@jeffsmale90 jeffsmale90 marked this pull request as ready for review April 15, 2026 00:09
@jeffsmale90 jeffsmale90 force-pushed the feat/gator-permissions-status branch from 1cc98dd to 7af006f Compare April 15, 2026 01:26
- if revocationMetadata exists, or revoked onchain - 'Revoked'
- if expiration after onchain block timestamp 'Expired'
- otherwise 'Active'
- changelog entry
- readme change referencing the dependency from permissions controller to network controller
Copy link
Copy Markdown
Contributor

@mj-kiwi mj-kiwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeffsmale90 jeffsmale90 added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 13c2dc9 Apr 15, 2026
345 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/gator-permissions-status branch April 15, 2026 05:30
@jeffsmale90 jeffsmale90 mentioned this pull request Apr 15, 2026
4 tasks
github-merge-queue Bot pushed a commit that referenced this pull request Apr 16, 2026
## Explanation

Releases
- @metamask/gator-permissions-controller@4.0.0
- @metamask/signature-controller@39.2.0

Breaking change to @metamask-gator-permissions-controller:
>- **BREAKING:** Add `status` to `PermissionInfoWithMetadata` type,
resolved from onchain data
([#8445](#8445))

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Primarily a version/dependency release PR, but it propagates a
breaking type change (`PermissionInfoWithMetadata.status`) via a major
bump that can break downstream TypeScript consumers.
> 
> **Overview**
> Cuts the `918.0.0` release by bumping the root monorepo version and
publishing `@metamask/gator-permissions-controller` `4.0.0` (noted as
**BREAKING** due to adding a `status` field to
`PermissionInfoWithMetadata`, resolved from on-chain data).
> 
> Updates the dependency chain to consume the new major:
`@metamask/signature-controller` is released as `39.2.0` and now depends
on `@metamask/gator-permissions-controller@^4.0.0`, and
`@metamask/shield-controller` updates to
`@metamask/signature-controller@^39.2.0`; lockfile and changelogs are
updated accordingly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0371831. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MJ Kiwi <me@mj.kiwi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants