Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLASK] BREAKING - snaps-monorepo@0.30.0 #17718

Merged
merged 103 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 102 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c2b4e1f
updated snap permission to wallet_snap, updated tests and added migra…
hmalik88 Feb 5, 2023
1047595
updated snap packages
hmalik88 Feb 10, 2023
83aa95c
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 10, 2023
e88824c
yarn.lock fix
hmalik88 Feb 10, 2023
df1b8b6
fixed errors
hmalik88 Feb 10, 2023
d880ae3
override policy
hmalik88 Feb 10, 2023
d1c4c8b
update policy
hmalik88 Feb 10, 2023
cab57a3
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 10, 2023
85c03bc
undo override
hmalik88 Feb 10, 2023
fc60da6
updated localization message descriptions
hmalik88 Feb 10, 2023
543d090
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 10, 2023
f58c1b5
updated lavamoat policy
hmalik88 Feb 13, 2023
5d00502
more policy updates
hmalik88 Feb 13, 2023
3e07d66
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 14, 2023
f2abe5a
update permission controller version
hmalik88 Feb 14, 2023
d50ec2b
update policy
hmalik88 Feb 14, 2023
58a5c11
update fixture builder
hmalik88 Feb 14, 2023
25a0be8
updated code to include permission value to satisfy wallet_snap permi…
hmalik88 Feb 14, 2023
7e72e83
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 14, 2023
c73959c
fix import issue
hmalik88 Feb 14, 2023
b04b21e
update test-snaps version
hmalik88 Feb 15, 2023
81ac499
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 15, 2023
474083b
added missing actions, added snap permission dedupe function
hmalik88 Feb 15, 2023
f25b9cc
prettier fix
hmalik88 Feb 15, 2023
663fa11
fix fencing
hmalik88 Feb 15, 2023
ed3b906
add more fencing
hmalik88 Feb 15, 2023
0776e55
prettier fix
hmalik88 Feb 15, 2023
6bef378
fix fencing (again)
hmalik88 Feb 16, 2023
9f660fe
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 16, 2023
c23307a
added new action and selector and updated view snap accordingly
hmalik88 Feb 16, 2023
ad4e026
update test snaps website version
hmalik88 Feb 16, 2023
830003c
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 16, 2023
783b715
unfence request variable
hmalik88 Feb 16, 2023
0ae013d
add fencing
hmalik88 Feb 16, 2023
f38265a
add optional chaining to fix type error
hmalik88 Feb 16, 2023
192c620
update migration #
hmalik88 Feb 16, 2023
ce6e6cd
remove old migration
hmalik88 Feb 16, 2023
6d1671d
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 16, 2023
1d97a6c
prettier fix
hmalik88 Feb 17, 2023
3814d53
fix migration test
hmalik88 Feb 18, 2023
bbb01c0
fix fencing
hmalik88 Feb 18, 2023
5123212
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 18, 2023
b678736
added missing fencing
hmalik88 Feb 20, 2023
6fced37
updated code to workaround fencing
hmalik88 Feb 20, 2023
41b1411
update test-snaps site version and remove snap confirm test
hmalik88 Feb 23, 2023
4382f7e
update snap packages
hmalik88 Feb 23, 2023
f58d1f0
update policies
hmalik88 Feb 23, 2023
28922ac
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 23, 2023
23abc3a
fix merge marker issue
hmalik88 Feb 23, 2023
3c2ca17
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 23, 2023
cc9cee1
update test
hmalik88 Feb 23, 2023
1018b0f
more fixes
hmalik88 Feb 24, 2023
e532b89
fix permissions
hmalik88 Feb 24, 2023
b966484
update test
hmalik88 Feb 24, 2023
095c4cf
fixed test
hmalik88 Feb 24, 2023
e3da807
Bump test-snaps and iframe-execution-environment
FrederikBolding Feb 24, 2023
15cd225
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 24, 2023
280d2fe
remove unused snap permission from fixture builder
hmalik88 Feb 24, 2023
6721468
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Feb 24, 2023
9617270
update policies
hmalik88 Mar 3, 2023
0daa64a
undo comment removal, update selector implementation
hmalik88 Mar 3, 2023
f9dea3e
removed unnecessary function, updated migration, updated caveat action
hmalik88 Mar 3, 2023
dd05293
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 3, 2023
f824dd3
remove optional chaining
hmalik88 Mar 3, 2023
eb5d201
fix type issue
hmalik88 Mar 3, 2023
0cc6c73
more type fixes
hmalik88 Mar 3, 2023
81237ef
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 3, 2023
c85c4ba
fix migration test
hmalik88 Mar 3, 2023
b5b064f
remove isFlask check, make migration logic more robust
hmalik88 Mar 3, 2023
1922c85
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 3, 2023
515289c
update coverage
hmalik88 Mar 3, 2023
73aa202
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 3, 2023
177ed54
Update LavaMoat policies
FrederikBolding Mar 6, 2023
934f7dc
Update test/e2e/snaps/enums.js
FrederikBolding Mar 6, 2023
3a00a40
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 6, 2023
b45c53d
add extra bail condition
hmalik88 Mar 6, 2023
5bbbf0b
Merge branch 'hm/migrate-snap-permissions-to-caveats' of github.com:M…
hmalik88 Mar 6, 2023
cd2ded6
Revert "add extra bail condition"
hmalik88 Mar 6, 2023
dc5d70a
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 6, 2023
5054330
Revert "Revert "add extra bail condition""
hmalik88 Mar 6, 2023
650121e
fix test
hmalik88 Mar 6, 2023
6e306d7
add SnapController entry to state object
hmalik88 Mar 6, 2023
d8340ab
updated permission name and caveat type with hardcoded values
hmalik88 Mar 6, 2023
7abff22
add extra test for non-flask scenario
hmalik88 Mar 6, 2023
567194e
update lavamoat policies
hmalik88 Mar 6, 2023
48d81e8
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 6, 2023
5d748cc
fix locale messages
hmalik88 Mar 6, 2023
7f4d8ba
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 6, 2023
1e5d3e6
change coverage target
hmalik88 Mar 6, 2023
860bcdf
re-enable rpc snap test
hmalik88 Mar 6, 2023
b1adfab
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 6, 2023
d94d7ee
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 7, 2023
9f0f3ee
revert locale message change
hmalik88 Mar 7, 2023
457a979
fix el message
hmalik88 Mar 7, 2023
973abd1
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 7, 2023
1171b08
reverted changes
hmalik88 Mar 7, 2023
875088d
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 7, 2023
d89877e
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 7, 2023
1045b9f
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 7, 2023
bbe7281
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 8, 2023
b15b9ba
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 8, 2023
b1ff6c6
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 8, 2023
0c7a772
Merge branch 'develop' into hm/migrate-snap-permissions-to-caveats
hmalik88 Mar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ const state = {
},
version: '0.6.0',
},
permissionName: 'wallet_snap_local:http://localhost:8080/',
sourceCode: '(...)',
status: 'stopped',
svgIcon: '<svg>...</svg>',
Expand Down Expand Up @@ -330,7 +329,6 @@ const state = {
},
version: '0.6.0',
},
permissionName: 'wallet_snap_npm:http://localhost:8080/',
sourceCode: '(...)',
status: 'stopped',
svgIcon: '<svg>...</svg>',
Expand Down
4 changes: 2 additions & 2 deletions app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/hi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/id/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/ja/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/ko/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/pt/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/ru/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/tl/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/tr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/vi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/_locales/zh_CN/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('PermissionController specifications', () => {
describe('caveat specifications', () => {
it('getCaveatSpecifications returns the expected specifications object', () => {
const caveatSpecifications = getCaveatSpecifications({});
expect(Object.keys(caveatSpecifications)).toHaveLength(7);
expect(Object.keys(caveatSpecifications)).toHaveLength(8);
expect(
caveatSpecifications[CaveatTypes.restrictReturnedAccounts].type,
).toStrictEqual(CaveatTypes.restrictReturnedAccounts);
Expand All @@ -39,6 +39,9 @@ describe('PermissionController specifications', () => {
expect(caveatSpecifications.rpcOrigin.type).toStrictEqual(
SnapCaveatType.RpcOrigin,
);
expect(caveatSpecifications.snapIds.type).toStrictEqual(
SnapCaveatType.SnapIds,
);
});

describe('restrictReturnedAccounts', () => {
Expand Down
22 changes: 21 additions & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ export default class MetamaskController extends EventEmitter {
///: BEGIN:ONLY_INCLUDE_IN(flask)
const snapExecutionServiceArgs = {
iframeUrl: new URL(
'https://metamask.github.io/iframe-execution-environment/0.12.0',
'https://metamask.github.io/iframe-execution-environment/0.13.0',
),
messenger: this.controllerMessenger.getRestricted({
name: 'ExecutionService',
Expand Down Expand Up @@ -778,6 +778,8 @@ export default class MetamaskController extends EventEmitter {
`${this.permissionController.name}:revokeAllPermissions`,
`${this.permissionController.name}:revokePermissions`,
`${this.permissionController.name}:revokePermissionForAllSubjects`,
`${this.permissionController.name}:getSubjectNames`,
`${this.permissionController.name}:updateCaveat`,
`${this.approvalController.name}:addRequest`,
`${this.permissionController.name}:grantPermissions`,
`${this.subjectMetadataController.name}:getSubjectMetadata`,
Expand Down Expand Up @@ -4613,6 +4615,24 @@ export default class MetamaskController extends EventEmitter {
}
};

///: BEGIN:ONLY_INCLUDE_IN(flask)
updateCaveat = (origin, target, caveatType, caveatValue) => {
try {
this.controllerMessenger.call(
'PermissionController:updateCaveat',
origin,
target,
caveatType,
caveatValue,
);
} catch (exp) {
if (!(exp instanceof PermissionsRequestNotFoundError)) {
throw exp;
}
}
};
///: END:ONLY_INCLUDE_IN

rejectPermissionsRequest = (requestId) => {
try {
this.permissionController.rejectPermissionsRequest(requestId);
Expand Down
Loading