![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
metalsmith-subresource-integrity
Advanced tools
Readme
A Metalsmith plugin that adds a subresouce
object to _metadata
. This allows the user to look up the hash from within
templates.
Example of setting up subresource integrity in code:
var metalsmith = require('metalsmith'),
subresourceIntegrity = require('metalsmith-subresource-integrity');
metalsmith(__dirname)
.use(subresourceIntegrity({
algorithm: 'sha512',
pattern: '*.{css,js}',
minimatchOptions: {
matchBase: true
}
})
.build();
Example of setting up subresource integrity in config:
{
"source": "src",
"destination": "build",
"plugins": {
"metalsmith-subresource-integrity": {
"algorithm": "sha512",
"pattern": "*.{css,js}",
"minimatchOptions": {
"matchBase": true
}
}
}
}
In the template, a hash can be found like so (the example uses underscore templates):
<link
href="/css/main.css"
integrity="<%= subresource['css/main.css'] %>"
/>
<script
src="/js/main.js"
integrity="<%= subresource['js/main.js'] %>"
></script>
Keep in mind that you will want to use this plugin after any file generation takes place (es6, coffeescript, sass) so the correct file names are found in the files list.
algorithm
defaults to sha512
. Can be either:
sha256
sha384
sha512
This is the hashing algorithm used.
pattern
defaults to *.{css,js}
. This is a
minimatch pattern to determine the
files to create subresource hashes for.
minimatchOptions
defaults to {matchBase: true}
. This is an Object
of
options for minimatch to tweak how
pattern
is applied.
FAQs
Metalsmith plugin for adding subresource integrity
The npm package metalsmith-subresource-integrity receives a total of 1 weekly downloads. As such, metalsmith-subresource-integrity popularity was classified as not popular.
We found that metalsmith-subresource-integrity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.