Skip to content

Commit

Permalink
Update LavaMoat policies
Browse files Browse the repository at this point in the history
  • Loading branch information
metamaskbot authored and DDDDDanica committed Jan 15, 2025
1 parent ced7bf4 commit 704d4ab
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 276 deletions.
8 changes: 6 additions & 2 deletions development/webpack/test/webpack.config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ${Object.entries(env)
}

it('should have the correct defaults', () => {
const config: Configuration = getWebpackConfig();
const config: Configuration = getWebpackConfig(['--test']);
// check that options are valid
const { options } = webpack(config);
assert.strictEqual(options.name, 'MetaMask – development');
Expand Down Expand Up @@ -162,6 +162,9 @@ ${Object.entries(env)
{
manifest_version: 3,
name: 'name',
permissions: [
'tabs'
],
version: '1.2.3',
content_scripts: [
{
Expand Down Expand Up @@ -191,6 +194,7 @@ ${Object.entries(env)
'--no-progress',
'--no-cache',
'--zip',
'--test',
...removeUnsupportedFeatures,
],
{
Expand Down Expand Up @@ -231,7 +235,7 @@ ${Object.entries(env)
assert.deepStrictEqual(manifestPlugin.options.description, null);
assert.deepStrictEqual(manifestPlugin.options.zip, true);
assert(manifestPlugin.options.zipOptions, 'Zip options should be present');
assert.strictEqual(manifestPlugin.options.transform, undefined);
assert.notEqual(manifestPlugin.options.transform, undefined);

const progressPlugin = instance.options.plugins.find(
(plugin) => plugin && plugin.constructor.name === 'ProgressPlugin',
Expand Down
5 changes: 4 additions & 1 deletion development/webpack/utils/plugins/ManifestPlugin/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export function transformManifest(args: { lockdown: boolean; test: boolean }) {
browserManifest._flags = manifestFlags;
}

transforms.push(addManifestFlags);
// Add manifest flags only for non-test builds so the test build is not affected by local feature flags
if(!args.test) {
transforms.push(addManifestFlags);
}

if (!args.lockdown) {
// remove lockdown scripts from content_scripts
Expand Down
2 changes: 1 addition & 1 deletion lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5650,4 +5650,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5650,4 +5650,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5650,4 +5650,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5742,4 +5742,4 @@
}
}
}
}
}
Loading

0 comments on commit 704d4ab

Please sign in to comment.