1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/app/scripts/lib
Erik Marks fc1ffae406
Add subject types (#13026)
This PR introduces the concept of subject _types_ to be associated with each subject in the `SubjectMetadataController`, and used for control flow in our RPC stack (`setupProviderEngine` and so forth).

We already differentiate between "types" of subjects in various places on an ad hoc basis via boolean flags (e.g. `isInternal` in our RPC stack) or the presence/absence of certain values in the subject's metadata (specifically `metadata.extensionId`). The status quo is manageable if not ideal, but will start to become untenable with the introduction of Snaps in the near future.

Therefore, this PR establishes a `SUBJECT_TYPES` enum and adds the `subjectType` property to the metadata of each subject. A new migration is added to accomplish this. Finally, we specify and `INTERNAL` subject type to distinguish internal from external requests.
2021-12-08 15:37:29 -08:00
..
ens-ipfs
migrator
rpc-method-middleware
account-tracker.js
buy-eth-url.js
buy-eth-url.test.js
cleanErrorStack.js
cleanErrorStack.test.js
ComposableObservableStore.js Added getPersistentState support for V2 controllers persist metadata (#12007) 2021-09-05 19:33:37 -07:00
ComposableObservableStore.test.js
createLoggerMiddleware.js
createMetaRPCHandler.js
createMetaRPCHandler.test.js
createOnboardingMiddleware.js
createOriginMiddleware.js
createStreamSink.js
createTabIdMiddleware.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
decrypt-message-manager.js
encryption-public-key-manager.js
extractEthjsErrorMessage.js
get-first-preferred-lang-code.js
getObjStructure.js
local-store.js
message-manager.js
message-manager.test.js
metaRPCClientFactory.js
metaRPCClientFactory.test.js
network-store.js
notification-manager.js
personal-message-manager.js
personal-message-manager.test.js
seed-phrase-verifier.js
seed-phrase-verifier.test.js
segment.js
setupSentry.js Add build type to Sentry environment (#12441) 2021-10-25 14:27:30 -02:30
stream-utils.js
typed-message-manager.js
typed-message-manager.test.js
util.js
util.test.js