Skip to content

Ability to provide glob/regex pattern for modules to *exclude* from integrity calculation and enforcement #232

@callpraths

Description

@callpraths

Hi,

Would there be any interest in supporting a way to exclude imports to specific modules from integrity hash calculation and enforcement?

Something like:

new SubresourceIntegrityPlugin({ 
  hashFuncNames: ["sha256", "sha384"],
  excludeImports: ["@inhouse-module-federated/*", "@inhouse/gigantic-veeeery-trustworthy-package-i-know-what-i-am-doing-please"]
}),

would exclude all imports starting with @inhouse-module-federated/ prefix (perhaps because it's a module federated package and we have a different way of enforcing SRI for those) and also @inhouse/gigantic-veeeery-trustworthy-package-i-know-what-i-am-doing-please (perhaps because computing the hash really slows build down and wise or not, the app owner can make the decision to exclude it).

This is related to #176. But I believe that this proposal is a better alternative: we avoid adding hidden features within webpack-subresource-integrity that take a dependency on implementation detail of webpack-module-federation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions