Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metamask/permission-controller

Package Overview
Dependencies
Maintainers
9
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/permission-controller - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

7

CHANGELOG.md

@@ -9,2 +9,6 @@ # Changelog

## [4.1.0]
### Changed
- Update `@metamask/utils` to `^6.2.0` ([#1514](https://github.com/MetaMask/core/pull/1514))
## [4.0.1]

@@ -73,3 +77,4 @@ ### Fixed

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@4.0.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@4.1.0...HEAD
[4.1.0]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@4.0.1...@metamask/permission-controller@4.1.0
[4.0.1]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@4.0.0...@metamask/permission-controller@4.0.1

@@ -76,0 +81,0 @@ [4.0.0]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@3.2.0...@metamask/permission-controller@4.0.0

4

dist/Caveat.d.ts

@@ -1,3 +0,3 @@

import { Json } from '@metamask/utils';
import { AsyncRestrictedMethod, RestrictedMethod, PermissionConstraint, RestrictedMethodParameters } from './Permission';
import type { Json } from '@metamask/utils';
import type { AsyncRestrictedMethod, RestrictedMethod, PermissionConstraint, RestrictedMethodParameters } from './Permission';
export declare type CaveatConstraint = {

@@ -4,0 +4,0 @@ /**

import { EthereumRpcError } from 'eth-rpc-errors';
import { PermissionType } from './Permission';
import type { PermissionType } from './Permission';
declare type UnauthorizedArg = {

@@ -4,0 +4,0 @@ data?: Record<string, unknown>;

import type { Json } from '@metamask/utils';
import { JsonRpcMiddleware } from 'json-rpc-engine';
import { GenericPermissionController, PermissionSubjectMetadata, RestrictedMethodParameters } from '.';
import type { JsonRpcMiddleware } from 'json-rpc-engine';
import type { GenericPermissionController, PermissionSubjectMetadata, RestrictedMethodParameters } from '.';
declare type PermissionMiddlewareFactoryOptions = {

@@ -5,0 +5,0 @@ executeRestrictedMethod: GenericPermissionController['_executeRestrictedMethod'];

@@ -1,7 +0,7 @@

import { Json } from '@metamask/utils';
import { NonEmptyArray } from '@metamask/controller-utils';
import { ActionConstraint, EventConstraint } from '@metamask/base-controller';
import type { ActionConstraint, EventConstraint } from '@metamask/base-controller';
import type { NonEmptyArray } from '@metamask/controller-utils';
import type { Json } from '@metamask/utils';
import type { CaveatConstraint } from './Caveat';
import type { PermissionsRequest, SideEffectMessenger } from './PermissionController';
import type { SubjectType } from './SubjectMetadataController';
import { CaveatConstraint } from './Caveat';
import type { PermissionsRequest, SideEffectMessenger } from './PermissionController';
/**

@@ -8,0 +8,0 @@ * The origin of a subject.

@@ -1,10 +0,11 @@

import { Patch } from 'immer';
import { Json } from '@metamask/utils';
import { AcceptRequest as AcceptApprovalRequest, AddApprovalRequest, HasApprovalRequest, RejectRequest as RejectApprovalRequest } from '@metamask/approval-controller';
import { BaseControllerV2, RestrictedControllerMessenger, ActionConstraint, EventConstraint } from '@metamask/base-controller';
import { NonEmptyArray } from '@metamask/controller-utils';
import { GetSubjectMetadata } from './SubjectMetadataController';
import { CaveatConstraint, CaveatSpecificationConstraint, CaveatSpecificationMap, ExtractCaveat, ExtractCaveats, ExtractCaveatValue } from './Caveat';
import { EndowmentSpecificationConstraint, ExtractAllowedCaveatTypes, OriginString, PermissionConstraint, PermissionSpecificationConstraint, PermissionSpecificationMap, RequestedPermissions, RestrictedMethod, RestrictedMethodParameters, RestrictedMethodSpecificationConstraint, SideEffectHandler, ValidPermission, ValidPermissionSpecification } from './Permission';
import type { AcceptRequest as AcceptApprovalRequest, AddApprovalRequest, HasApprovalRequest, RejectRequest as RejectApprovalRequest } from '@metamask/approval-controller';
import type { RestrictedControllerMessenger, ActionConstraint, EventConstraint } from '@metamask/base-controller';
import { BaseControllerV2 } from '@metamask/base-controller';
import type { NonEmptyArray } from '@metamask/controller-utils';
import type { Json } from '@metamask/utils';
import type { Patch } from 'immer';
import type { CaveatConstraint, CaveatSpecificationConstraint, CaveatSpecificationMap, ExtractCaveat, ExtractCaveats, ExtractCaveatValue } from './Caveat';
import type { EndowmentSpecificationConstraint, ExtractAllowedCaveatTypes, OriginString, PermissionConstraint, PermissionSpecificationConstraint, PermissionSpecificationMap, RequestedPermissions, RestrictedMethod, RestrictedMethodParameters, RestrictedMethodSpecificationConstraint, SideEffectHandler, ValidPermission, ValidPermissionSpecification } from './Permission';
import { getPermissionMiddlewareFactory } from './permission-middleware';
import type { GetSubjectMetadata } from './SubjectMetadataController';
/**

@@ -11,0 +12,0 @@ * Metadata associated with {@link PermissionController} subjects.

@@ -27,10 +27,9 @@ "use strict";

exports.PermissionController = exports.CaveatMutatorOperation = void 0;
/* eslint-enable @typescript-eslint/no-unused-vars */
const base_controller_1 = require("@metamask/base-controller");
const controller_utils_1 = require("@metamask/controller-utils");
const utils_1 = require("@metamask/utils");
const deep_freeze_strict_1 = __importDefault(require("deep-freeze-strict"));
const eth_rpc_errors_1 = require("eth-rpc-errors");
const immer_1 = require("immer");
const nanoid_1 = require("nanoid");
const eth_rpc_errors_1 = require("eth-rpc-errors");
const utils_1 = require("@metamask/utils");
const base_controller_1 = require("@metamask/base-controller");
const controller_utils_1 = require("@metamask/controller-utils");
const Caveat_1 = require("./Caveat");

@@ -37,0 +36,0 @@ const errors_1 = require("./errors");

@@ -1,4 +0,4 @@

import type { PermittedHandlerExport } from '../utils';
import type { PermissionConstraint } from '../Permission';
import type { SubjectPermissions } from '../PermissionController';
import type { PermittedHandlerExport } from '../utils';
export declare const getPermissionsHandler: PermittedHandlerExport<GetPermissionsHooks, undefined, PermissionConstraint[]>;

@@ -5,0 +5,0 @@ export declare type GetPermissionsHooks = {

@@ -1,5 +0,5 @@

import { RequestPermissionsHooks } from './requestPermissions';
import { GetPermissionsHooks } from './getPermissions';
import type { GetPermissionsHooks } from './getPermissions';
import type { RequestPermissionsHooks } from './requestPermissions';
export declare type PermittedRpcMethodHooks = RequestPermissionsHooks & GetPermissionsHooks;
export declare const handlers: readonly [import("..").PermittedHandlerExport<RequestPermissionsHooks, [import("..").RequestedPermissions], import("..").PermissionConstraint[]>, import("..").PermittedHandlerExport<GetPermissionsHooks, undefined, import("..").PermissionConstraint[]>];
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handlers = void 0;
const getPermissions_1 = require("./getPermissions");
const requestPermissions_1 = require("./requestPermissions");
const getPermissions_1 = require("./getPermissions");
exports.handlers = [

@@ -7,0 +7,0 @@ requestPermissions_1.requestPermissionsHandler,

@@ -0,3 +1,3 @@

import type { PermissionConstraint, RequestedPermissions } from '../Permission';
import type { PermittedHandlerExport } from '../utils';
import type { PermissionConstraint, RequestedPermissions } from '../Permission';
export declare const requestPermissionsHandler: PermittedHandlerExport<RequestPermissionsHooks, [

@@ -4,0 +4,0 @@ RequestedPermissions

@@ -13,6 +13,6 @@ "use strict";

exports.requestPermissionsHandler = void 0;
const controller_utils_1 = require("@metamask/controller-utils");
const eth_rpc_errors_1 = require("eth-rpc-errors");
const controller_utils_1 = require("@metamask/controller-utils");
const errors_1 = require("../errors");
const utils_1 = require("../utils");
const errors_1 = require("../errors");
exports.requestPermissionsHandler = {

@@ -19,0 +19,0 @@ methodNames: [utils_1.MethodNames.requestPermissions],

@@ -0,5 +1,6 @@

import type { RestrictedControllerMessenger } from '@metamask/base-controller';
import { BaseControllerV2 } from '@metamask/base-controller';
import type { Json } from '@metamask/utils';
import type { Patch } from 'immer';
import { Json } from '@metamask/utils';
import { BaseControllerV2, RestrictedControllerMessenger } from '@metamask/base-controller';
import { HasPermissions, PermissionSubjectMetadata } from './PermissionController';
import type { HasPermissions, PermissionSubjectMetadata } from './PermissionController';
declare const controllerName = "SubjectMetadataController";

@@ -60,5 +61,5 @@ declare type SubjectOrigin = string;

export declare class SubjectMetadataController extends BaseControllerV2<typeof controllerName, SubjectMetadataControllerState, SubjectMetadataControllerMessenger> {
private subjectCacheLimit;
private subjectsWithoutPermissionsEncounteredSinceStartup;
private subjectHasPermissions;
private readonly subjectCacheLimit;
private readonly subjectsWithoutPermissionsEncounteredSinceStartup;
private readonly subjectHasPermissions;
constructor({ messenger, subjectCacheLimit, state, }: SubjectMetadataControllerOptions);

@@ -65,0 +66,0 @@ /**

import type { Json, JsonRpcParams, JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';
import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from 'json-rpc-engine';
import { CaveatSpecificationConstraint, CaveatSpecificationMap } from './Caveat';
import { PermissionSpecificationConstraint, PermissionSpecificationMap } from './Permission';
import type { CaveatSpecificationConstraint, CaveatSpecificationMap } from './Caveat';
import type { PermissionSpecificationConstraint, PermissionSpecificationMap } from './Permission';
export declare enum MethodNames {

@@ -6,0 +6,0 @@ requestPermissions = "wallet_requestPermissions",

{
"name": "@metamask/permission-controller",
"version": "4.0.1",
"version": "4.1.0",
"description": "Mediates access to JSON-RPC methods, used to interact with pieces of the MetaMask stack, via middleware for json-rpc-engine",

@@ -32,6 +32,6 @@ "keywords": [

"dependencies": {
"@metamask/approval-controller": "^3.3.0",
"@metamask/base-controller": "^3.0.0",
"@metamask/controller-utils": "^4.0.1",
"@metamask/utils": "^5.0.2",
"@metamask/approval-controller": "^3.5.0",
"@metamask/base-controller": "^3.2.0",
"@metamask/controller-utils": "^4.3.0",
"@metamask/utils": "^6.2.0",
"@types/deep-freeze-strict": "^1.1.0",

@@ -55,3 +55,3 @@ "deep-freeze-strict": "^1.1.1",

"peerDependencies": {
"@metamask/approval-controller": "^3.3.0"
"@metamask/approval-controller": "^3.5.0"
},

@@ -58,0 +58,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc