@metamask/permission-controller 11.0.5 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -2
- package/dist/PermissionController.cjs +10 -4
- package/dist/PermissionController.cjs.map +1 -1
- package/dist/PermissionController.d.cts +8 -8
- package/dist/PermissionController.d.cts.map +1 -1
- package/dist/PermissionController.d.mts +8 -8
- package/dist/PermissionController.d.mts.map +1 -1
- package/dist/PermissionController.mjs +10 -4
- package/dist/PermissionController.mjs.map +1 -1
- package/dist/SubjectMetadataController.cjs +6 -1
- package/dist/SubjectMetadataController.cjs.map +1 -1
- package/dist/SubjectMetadataController.d.cts +2 -2
- package/dist/SubjectMetadataController.d.cts.map +1 -1
- package/dist/SubjectMetadataController.d.mts +2 -2
- package/dist/SubjectMetadataController.d.mts.map +1 -1
- package/dist/SubjectMetadataController.mjs +6 -1
- package/dist/SubjectMetadataController.mjs.map +1 -1
- package/dist/permission-middleware.cjs.map +1 -1
- package/dist/permission-middleware.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [11.1.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add two new controller state metadata properties: `includeInStateLogs` and `usedInUi` ([#6525](https://github.com/MetaMask/core/pull/6525))
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Bump `@metamask/utils` from `^11.1.0` to `^11.8.1` ([#5301](https://github.com/MetaMask/core/pull/5301), [#6054](https://github.com/MetaMask/core/pull/6054), [#6588](https://github.com/MetaMask/core/pull/6588), [#6708](https://github.com/MetaMask/core/pull/6708))
|
|
19
|
+
- Bump `@metamask/base-controller` from `^8.0.0` to `^8.4.1` ([#5722](https://github.com/MetaMask/core/pull/5722), [#6284](https://github.com/MetaMask/core/pull/6284), [#6355](https://github.com/MetaMask/core/pull/6355), [#6465](https://github.com/MetaMask/core/pull/6465), [#6632](https://github.com/MetaMask/core/pull/6632), [#6807](https://github.com/MetaMask/core/pull/6807))
|
|
20
|
+
- Bump `@metamask/controller-utils` from `^11.5.0` to `^11.14.1` ([#5439](https://github.com/MetaMask/core/pull/5439), [#5583](https://github.com/MetaMask/core/pull/5583), [#5765](https://github.com/MetaMask/core/pull/5765), [#5812](https://github.com/MetaMask/core/pull/5812), [#5935](https://github.com/MetaMask/core/pull/5935), [#6069](https://github.com/MetaMask/core/pull/6069), [#6303](https://github.com/MetaMask/core/pull/6303), [#6620](https://github.com/MetaMask/core/pull/6620), [#6629](https://github.com/MetaMask/core/pull/6629), [#6807](https://github.com/MetaMask/core/pull/6807))
|
|
21
|
+
- Bump `@metamask/json-rpc-engine` from `^10.0.3` to `^10.1.1` ([#6678](https://github.com/MetaMask/core/pull/6678), [#6807](https://github.com/MetaMask/core/pull/6807))
|
|
22
|
+
|
|
23
|
+
## [11.0.6]
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Bump `@metamask/base-controller` from `^7.1.1` to `^8.0.0` ([#5305](https://github.com/MetaMask/core/pull/5305))
|
|
28
|
+
- Bump `@metamask/controller-utils` from `^11.4.5` to `^11.5.0` ([#5272](https://github.com/MetaMask/core/pull/5272))
|
|
29
|
+
- Bump `@metamask/json-rpc-engine` from `^10.0.2` to `^10.0.3` ([#5272](https://github.com/MetaMask/core/pull/5272))
|
|
30
|
+
- Bump `@metamask/utils` from `^11.0.1` to `^11.1.0` ([#5223](https://github.com/MetaMask/core/pull/5223))
|
|
31
|
+
|
|
10
32
|
## [11.0.5]
|
|
11
33
|
|
|
12
34
|
### Changed
|
|
@@ -19,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
41
|
- Bump `nanoid` from `^3.1.31` to `^3.3.8` ([#5073](https://github.com/MetaMask/core/pull/5073))
|
|
20
42
|
- Bump `@metamask/utils` from `^10.0.0` to `^11.0.1` ([#5080](https://github.com/MetaMask/core/pull/5080))
|
|
21
43
|
- Bump `@metamask/rpc-errors` from `^7.0.0` to `^7.0.2` ([#5080](https://github.com/MetaMask/core/pull/5080))
|
|
22
|
-
- Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.
|
|
44
|
+
- Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.1` ([#5079](https://github.com/MetaMask/core/pull/5079)), ([#5135](https://github.com/MetaMask/core/pull/5135))
|
|
23
45
|
|
|
24
46
|
## [11.0.4]
|
|
25
47
|
|
|
@@ -321,7 +343,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
321
343
|
|
|
322
344
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
323
345
|
|
|
324
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.0
|
|
346
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.1.0...HEAD
|
|
347
|
+
[11.1.0]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.0.6...@metamask/permission-controller@11.1.0
|
|
348
|
+
[11.0.6]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.0.5...@metamask/permission-controller@11.0.6
|
|
325
349
|
[11.0.5]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.0.4...@metamask/permission-controller@11.0.5
|
|
326
350
|
[11.0.4]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.0.3...@metamask/permission-controller@11.0.4
|
|
327
351
|
[11.0.3]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@11.0.2...@metamask/permission-controller@11.0.3
|
|
@@ -33,7 +33,14 @@ const controllerName = 'PermissionController';
|
|
|
33
33
|
* @returns The state metadata
|
|
34
34
|
*/
|
|
35
35
|
function getStateMetadata() {
|
|
36
|
-
return {
|
|
36
|
+
return {
|
|
37
|
+
subjects: {
|
|
38
|
+
includeInStateLogs: true,
|
|
39
|
+
anonymous: true,
|
|
40
|
+
persist: true,
|
|
41
|
+
usedInUi: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* Get the default state of the {@link PermissionController}.
|
|
@@ -59,7 +66,7 @@ var CaveatMutatorOperation;
|
|
|
59
66
|
* document for details.
|
|
60
67
|
*
|
|
61
68
|
* Assumes the existence of an {@link ApprovalController} reachable via the
|
|
62
|
-
* {@link
|
|
69
|
+
* {@link Messenger}.
|
|
63
70
|
*
|
|
64
71
|
* @template ControllerPermissionSpecification - A union of the types of all
|
|
65
72
|
* permission specifications available to the controller. Any referenced caveats
|
|
@@ -88,7 +95,7 @@ class PermissionController extends base_controller_1.BaseController {
|
|
|
88
95
|
* {@link PermissionSpecificationMap} and the README for more details.
|
|
89
96
|
* @param options.unrestrictedMethods - The callable names of all JSON-RPC
|
|
90
97
|
* methods ignored by the new controller.
|
|
91
|
-
* @param options.messenger - The
|
|
98
|
+
* @param options.messenger - The messenger. See
|
|
92
99
|
* {@link BaseController} for more information.
|
|
93
100
|
* @param options.state - Existing state to hydrate the controller with at
|
|
94
101
|
* initialization.
|
|
@@ -866,7 +873,6 @@ class PermissionController extends base_controller_1.BaseController {
|
|
|
866
873
|
*/
|
|
867
874
|
validateCaveat(caveat, origin, target) {
|
|
868
875
|
if (!(0, controller_utils_1.isPlainObject)(caveat)) {
|
|
869
|
-
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
870
876
|
throw new errors_1.InvalidCaveatError(caveat, origin, target);
|
|
871
877
|
}
|
|
872
878
|
if (Object.keys(caveat).length !== 2) {
|