All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bump
@metamask/controller-utilsfrom^12.0.0to^12.1.0(#8774)
- Bump
@metamask/json-rpc-enginefrom^10.3.0to^10.5.0(#8746, #8753) - Bump
@metamask/controller-utilsfrom^11.20.0to^12.0.0(#8755)
- Expose missing public
PermissionControllermethods through its messenger (#8675)- The following actions are now available:
PermissionController:acceptPermissionsRequest,PermissionController:rejectPermissionsRequest,PermissionController:revokePermission,PermissionController:updatePermissionsByCaveat,PermissionController:getPermission
- Corresponding action types are available as well.
- The following actions are now available:
- Add
createPermissionMiddlewareV2, aJsonRpcEngineV2variant of the standalone permission middleware factory (#8532) - Add
messengeroption to permission specification builders, allowing restricted-method specs to receive a scoped messenger in place ofmethodHooks(#8551)- Use the
actionNamesfield on the specification builder andcreateRestrictedMethodMessengerto construct the scoped messenger.
- Use the
- BREAKING: Decouple the permission middleware from
PermissionControllerand expose it as a standalone function (#8532)- The standalone
createPermissionMiddlewarereplaces the formerPermissionController.createPermissionMiddleware; it is imported from@metamask/permission-controllerand called with a messenger and subject metadata, and targets the legacyJsonRpcEngine. - New integrations should prefer
createPermissionMiddlewareV2, which targetsJsonRpcEngineV2. PermissionController.getRestrictedMethodno longer serves a purpose, and is removed. Restricted methods should be invoked via the:executeRestrictedMethodaction instead.
- The standalone
- Bump
@metamask/json-rpc-enginefrom^10.2.4to^10.3.0(#8661) - Bump
@metamask/controller-utilsfrom^11.19.0to^11.20.0(#8344) - Bump
@metamask/messengerfrom^1.0.0to^1.2.0(#8364, #8373, #8632) - Bump
@metamask/base-controllerfrom^9.0.1to^9.1.0(#8457)
- Deprecate
createPermissionMiddlewarein favor ofcreatePermissionMiddlewareV2, which targetsJsonRpcEngineV2(#8532)
- BREAKING: Remove
factoryHooks,validatorHooks, and related fields from permission specification builders (#8551) - BREAKING: Remove permitted method handlers and types (#8583)
- The permitted method handlers were unused in practice. Replacement types for generic RPC method implementations are available in
@metamask/json-rpc-engine@10.3.0.
- The permitted method handlers were unused in practice. Replacement types for generic RPC method implementations are available in
- Expose missing public
PermissionControllermethods through its messenger (#8201)- The following actions are now available:
PermissionController:clearState
- Corresponding action types (e.g.
PermissionControllerClearStateAction) are available as well.
- The following actions are now available:
- Expose missing public
SubjectMetadataControllermethods through its messenger (#8201)- The following actions are now available:
SubjectMetadataController:clearStateSubjectMetadataController:trimMetadataState
- Corresponding action types
(e.g.
SubjectMetadataControllerClearStateAction) are available as well.
- The following actions are now available:
- Bump
@metamask/approval-controllerfrom^9.0.0to^9.0.1(#8317) - Bump
@metamask/base-controllerfrom^9.0.0to^9.0.1(#8317) - Bump
@metamask/json-rpc-enginefrom^10.2.3to^10.2.4(#8317) - Bump
@metamask/messengerfrom^0.3.0to^1.0.0(#8317)
- Deprecate action types in favor of
PermissionController...ActionandSubjectMetadataController...Actiontypes (#8201)- For the
PermissionController:GetPermissionControllerStateis nowPermissionControllerGetStateAction.GetSubjectsis nowPermissionControllerGetSubjectsAction.GetPermissionsis nowPermissionControllerGetPermissionsAction.HasPermissionsis nowPermissionControllerHasPermissionsAction.HasPermissionis nowPermissionControllerHasPermissionAction.GrantPermissionsis nowPermissionControllerGrantPermissionsAction.GrantPermissionsIncrementalis nowPermissionControllerGrantPermissionsIncrementalAction.RequestPermissionsis nowPermissionControllerRequestPermissionsAction.RequestPermissionsIncrementalis nowPermissionControllerRequestPermissionsIncrementalAction.RevokePermissionsis nowPermissionControllerRevokePermissionsAction.RevokeAllPermissionsis nowPermissionControllerRevokeAllPermissionsAction.RevokePermissionForAllSubjectsis nowPermissionControllerRevokePermissionForAllSubjectsAction.UpdateCaveatis nowPermissionControllerUpdateCaveatAction.GetCaveatis nowPermissionControllerGetCaveatAction.ClearPermissionsis nowPermissionControllerClearPermissionsAction.GetEndowmentsis nowPermissionControllerGetEndowmentsAction.
- For the
SubjectMetadataController:GetSubjectMetadataControllerStateis nowSubjectMetadataControllerGetStateAction.GetSubjectMetadatais nowSubjectMetadataControllerGetMetadataAction.AddSubjectMetadatais nowSubjectMetadataControllerAddMetadataAction.
- The old types are still exported but are now marked as deprecated and will be removed in a future release.
- For the
- Bump
@metamask/approval-controllerfrom^8.0.0to^9.0.0(#8225) - Bump
@metamask/json-rpc-enginefrom^10.2.0to^10.2.3(#7642, #7856, #8078) - Bump
@metamask/controller-utilsfrom^11.17.0to^11.19.0(#7583, #7995)
- Add
PermissionController:getCaveataction (#7303)
- Upgrade
@metamask/utilsfrom^11.8.1to^11.9.0(#7511) - Move peer dependencies for controller and service packages to direct dependencies (#7209)
- The dependencies moved are:
@metamask/approval-controller(^8.0.0)
- In clients, it is now possible for multiple versions of these packages to exist in the dependency tree.
- For example, this scenario would be valid: a client relies on
@metamask/controller-a1.0.0 and@metamask/controller-b1.0.0, and@metamask/controller-bdepends on@metamask/controller-a1.1.0.
- For example, this scenario would be valid: a client relies on
- Note, however, that the versions specified in the client's
package.jsonalways "win", and you are expected to keep them up to date so as not to break controller and service intercommunication.
- The dependencies moved are:
- Bump
@metamask/controller-utilsfrom^11.16.0to^11.17.0(#7534)
- Bump
@metamask/json-rpc-enginefrom^10.1.1to^10.2.0(#7202) - Bump
@metamask/controller-utilsfrom^11.15.0to^11.16.0(#7202)
- Add
nameproperty to permission errors (#6987)
- BREAKING: Use new
Messengerfrom@metamask/messenger(#6537)- Previously,
PermissionControllerandSubjectMetadataControlleraccepted aRestrictedMessengerinstance from@metamask/base-controller.
- Previously,
- BREAKING: Metadata property
anonymousrenamed toincludeInDebugSnapshot(#6537) - BREAKING: Bump
@metamask/approval-controllerfrom^7.0.0to^8.0.0(#6962) - Bump
@metamask/base-controllerfrom^8.4.2to^9.0.0(#6962)
- Bump
@metamask/base-controllerfrom^8.4.1to^8.4.2(#6917)
- Add two new controller state metadata properties:
includeInStateLogsandusedInUi(#6525)
- Bump
@metamask/utilsfrom^11.1.0to^11.8.1(#5301, #6054, #6588, #6708) - Bump
@metamask/base-controllerfrom^8.0.0to^8.4.1(#5722, #6284, #6355, #6465, #6632, #6807) - Bump
@metamask/controller-utilsfrom^11.5.0to^11.14.1(#5439, #5583, #5765, #5812, #5935, #6069, #6303, #6620, #6629, #6807) - Bump
@metamask/json-rpc-enginefrom^10.0.3to^10.1.1(#6678, #6807)
- Bump
@metamask/base-controllerfrom^7.1.1to^8.0.0(#5305) - Bump
@metamask/controller-utilsfrom^11.4.5to^11.5.0(#5272) - Bump
@metamask/json-rpc-enginefrom^10.0.2to^10.0.3(#5272) - Bump
@metamask/utilsfrom^11.0.1to^11.1.0(#5223)
- Remove redundant caveat validator calls (#5062)
- In some cases, caveats were being validated multiple times or without the possibility of being changed.
- The intended purpose of permission and caveat validators has also been
documented. See
ARCHITECTURE.md.
- Bump
nanoidfrom^3.1.31to^3.3.8(#5073) - Bump
@metamask/utilsfrom^10.0.0to^11.0.1(#5080) - Bump
@metamask/rpc-errorsfrom^7.0.0to^7.0.2(#5080) - Bump
@metamask/base-controllerfrom^7.0.0to^7.1.1, (#5079, #5135)
- Correct ESM-compatible build so that imports of the following packages that re-export other modules via
export *are no longer corrupted: (#5011)deep-freeze-strict
- Bump
@metamask/utilsfrom^9.1.0to^10.0.0(#4831)
- Produce and export ESM-compatible TypeScript type declaration files in addition to CommonJS-compatible declaration files (#4648)
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
exportsfield inpackage.jsonlinked to these files. This is an anti-pattern and was rightfully flagged by the "Are the Types Wrong?" tool as "masquerading as CJS". All of the ATTW checks now pass.
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
- Remove chunk files (#4648)
- Previously, the build tool we used to generate JavaScript files extracted common code to "chunk" files. While this was intended to make this package more tree-shakeable, it also made debugging more difficult for our development teams. These chunk files are no longer present.
- Bump
@metamask/base-controllerfrom^6.0.3to^7.0.0(#4643) - Bump
@metamask/controller-utilsfrom^11.0.2to^11.2.0(#4639, #4651) - Bump
typescriptfrom~5.0.4to~5.2.2(#4576, #4584)
- BREAKING: Rename enum property names to match PascalCase instead of camelCase (#4521)
- The affected enums are:
CaveatMutatorOperations,MethodNames.
- The affected enums are:
- Bump TypeScript version to
~5.0.4and setmoduleResolutionoption toNode16(#3645) - Bump
@metamask/base-controllerfrom^6.0.1to^6.0.2(#4544) - Bump
@metamask/controller-utilsfrom^11.0.1to^11.0.2(#4544) - Bump
@metamask/json-rpc-enginefrom^9.0.1to^9.0.2(#4544) - Bump
@metamask/utilsfrom^9.0.0to^9.1.0(#4529)
- Bump
@metamask/rpc-errorsfrom6.2.1to^6.3.1(#4516) - Bump
@metamask/utilsfrom^8.3.0to^9.0.0(#4516) - Bump
@metamask/base-controllerto^9.0.1(#4517) - Bump
@metamask/controller-utilsto^11.0.1(#4517) - Bump
@metamask/json-rpc-engineto^9.0.1(#4517)
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- BREAKING: Bump peer dependency
@metamask/approval-controllerto^7.0.0(#4352) - Bump
@metamask/base-controllerto^6.0.0(#4352) - Bump
@metamask/controller-utilsto^11.0.0(#4352) - Bump
@metamask/json-rpc-engineto^9.0.0(#4352)
- Bump
@metamask/controller-utilsto^10.0.0(#4342)
- Add
requestPermissionsIncremental()and caveat merger functions (#4222) - Enable passing additional metadata during permission requests (#4179)
- Make permission request validation errors more informative (#4172)
- Fix
SideEffectMessengertype not respecting generic parameter types (#4059)
- Fix
typesfield inpackage.json(#4047)
- BREAKING: Add ESM build (#3998)
- It's no longer possible to import files from
./distdirectly.
- It's no longer possible to import files from
- BREAKING: Bump peer dependency on
@metamask/approval-controllerto^6.0.0(#4039) - BREAKING: Bump
@metamask/base-controllerto^5.0.0(#4039)- This version has a number of breaking changes. See the changelog for more.
- Bump
@metamask/controller-utilsto^9.0.0(#4039) - Bump
@metamask/json-rpc-engineto^8.0.0(#4039)
- BREAKING: Fix
SideEffectMessengerso that it's defined with aRestrictedControllerMessengerthat has access toPermissionControllerallowed actions (#4031)- The messenger's
Actiongeneric parameter is widened to include thePermissionControlleractions allowlist. - The messenger's
AllowedActiongeneric parameter is narrowed fromstringto thePermissionControlleractions allowlist.
- The messenger's
- BREAKING: Bump
@metamask/approval-controllerpeer dependency to^5.1.2(#3821) - Bump
@metamask/utilsto^8.3.0(#3769) - Bump
@metamask/base-controllerto^4.1.1(#3760, #3821) - Bump
@metamask/controller-utilsto^8.0.2(#3821) - Bump
@metamask/json-rpc-engineto^7.3.2(#3821)
- Add
SubjectMetadataController:addSubjectMetadataaction (#3733)
- BREAKING: Bump
@metamask/approval-controllerpeer dependency from^5.0.0to^5.1.1(#3680, #3695) - Bump
@metamask/base-controllerto^4.0.1(#3695) - Bump
@metamask/controller-utilsto^8.0.1(#3695, #3678, #3667, #3580) - Bump
@metamask/json-rpc-engineto^7.3.1(#3695)
- Remove
@metamask/approval-controllerdependency (#3607)
- Add new handler to
permissionRpcMethods.handlersforwallet_revokePermissionsRPC method (#1889)
- BREAKING: Bump
@metamask/base-controllerto ^4.0.0 (#2063)- This is breaking because the type of the
messengerhas backward-incompatible changes. See the changelog for this package for more.
- This is breaking because the type of the
- BREAKING: Update
PermittedRpcMethodHookstype so it must support signature forwallet_revokePermissionhook (#1889) - Bump
@metamask/approval-controllerto ^5.0.0 (#2063) - Bump
@metamask/controller-utilsto ^6.0.0 (#2063)
- Bump
@metamask/json-rpc-enginefrom^7.1.0to^7.2.0(#1895) - Bump dependency on
@metamask/rpc-errorsto ^6.1.0 (#1653) - Bump dependency and peer dependency on
@metamask/approval-controllerto ^4.0.1 - Bump
@metamask/utilsfrom8.1.0to8.2.0(#1957) - Bump
@metamask/auto-changelogfrom^3.2.0to^3.4.3(#1870, #1905, #1997)
- BREAKING: Remove
undefinedfrom RestrictedMethodParameters type union and from type parameter for RestrictedMethodOptions (#1749) - BREAKING: Update from
json-rpc-engine@^6.1.0to@metamask/json-rpc-engine@^7.1.1(#1749) - Update from
eth-rpc-errors@^4.0.2to@metamask/rpc-errors@^6.0.0(#1749) - Bump dependency on
@metamask/utilsto ^8.1.0 (#1639) - Bump dependency and peer dependency on
@metamask/approval-controllerto ^4.0.0 - Bump dependency on
@metamask/base-controllerto ^3.2.3 - Bump dependency on
@metamask/controller-utilsto ^5.0.2
- Update TypeScript to v4.8.x (#1718)
- Bump dependency on
@metamask/controller-utilsto ^5.0.0
- Bump dependency and peer dependency on
@metamask/approval-controllerto ^3.5.1 - Bump dependency on
@metamask/base-controllerto ^3.2.1 - Bump dependency on
@metamask/controller-utilsto ^4.3.2
- Update
@metamask/utilsto^6.2.0(#1514)
- Fix permissions RPC method types (#1464)
- The RPC method handlers were mistakenly typed as an array rather than a tuple
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: Update
@metamask/approval-controllerdependency and peer dependency - The export
permissionRpcMethodshas a slightly different type; the second generic type variable of thegetPermissionshandler is nowundefinedrather thanvoid(#1372) - Add
@metamask/utilsdependency (#1275) - Remove
@metamask/typesdependency (#1372) - Change type of constructor parameter
unrestrictedMethodsto be readonly (#1395)
- BREAKING: Remove namespaced permissions (#1337)
- Namespaced permissions are no longer supported. Consumers should replace namespaced permissions with equivalent caveat-based implementations.
- BREAKING: Remove
targetKeyconcept (#1337)- The target key/name distinction only existed to support namespaced permissions, which are removed as of this release. Henceforth, permissions only have "names".
- The
targetKeyproperty of permission specifications has been renamed totargetName.
- Allow restricting permissions by subject type (#1233)
- Move
SubjectMetadataControllerto permission-controller package (#1234) - Update minimum
eth-rpc-errorsversion from4.0.0to4.0.2(#1215)
- Add side-effects to permissions (#1069)
- BREAKING: Remove
isomorphic-fetch(#1106)- Consumers must now import
isomorphic-fetchor another polyfill themselves if they are running in an environment withoutfetch
- Consumers must now import
- Add
updateCaveataction (#1071)
- BREAKING: Update
@metamask/network-controllerpeer dependency to v3 (#1041) - Rename this repository to
core(#1031) - Update
@metamask/controller-utilspackage (#1041)
- This package will now warn if a required package is not present (#1003)
- Relax dependencies on
@metamask/approval-controller,@metamask/base-controllerand@metamask/controller-utils(use^instead of~) (#998)
- Initial release
-
As a result of converting our shared controllers repo into a monorepo (#831), we've created this package from select parts of
@metamask/controllersv33.0.0, namely:- Everything in
src/permissions
All changes listed after this point were applied to this package following the monorepo conversion.
- Everything in
-