Skip to content

Allow for customized SRI Algorithm #28946

@wkaskie

Description

@wkaskie

Command

build

Description

Currently, configuration allows for setting subresourceIntegrity to true and this adds a sha384 hash to the html output's script tags.

However, sha384 is not supported in all platforms and/or frontend developers cannot control the deployment servers. (eg: AWS S3 doesn't allow for sha384 with its checksum-algorithm flag)

Request is to allow overriding of the default sha384 that is set here:

Describe the solution you'd like

Two options:

  • given that custom webpack configurations are already alowed and plugins added there are already expected to override the defaults, allow the existence of
   plugins: [
    new SubresourceIntegrityPlugin({
      enabled: true,
      hashFuncNames: ['sha256'],
    }), 

to override the hardcodedd configuration.

  • Add additional configuration parameter for overriding the hashFuncNames setting like:
           ...,
          "subresourceIntegrity": true,
         "hashFuncNames": ["sha256", "sha512"],
         ...
    

### Describe alternatives you've considered

I have tried adding the plugin in my custom webpack.config.js file.
I've also tried to completely rework the settings in Angular to allow for a fully customizable index file...but I honestly just lack the skill to get that to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions