You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this open source project, nice and focussed! Though, I would argue that package is in the perfect position to help developers to populate the "integrity" attribute: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity. But currently it doesn't seem possible to get access to the raw hash to format a string in the way the integrity attribute expects.
If there is interest in this I can contribute an implementation for this, the following approaches would be possible
Create a method fs.Integrity(name) that simply returns a value for the integrity attribute. It might be too closely tied to this specific use case
Create a method that allows arbitrary formatting something like Sprintf(name, format, ...args), "format" argument could be a string with formatting directives and args would always include the hash. But ordering could be awkward, and this seems to magical
Simply have a method that returns the raw hash: fs.HashOf(name), the caller can use the hash in whatever way they like.
Let me know what you think
The text was updated successfully, but these errors were encountered:
Thank you for this open source project, nice and focussed! Though, I would argue that package is in the perfect position to help developers to populate the "integrity" attribute: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity. But currently it doesn't seem possible to get access to the raw hash to format a string in the way the integrity attribute expects.
If there is interest in this I can contribute an implementation for this, the following approaches would be possible
fs.Integrity(name)
that simply returns a value for the integrity attribute. It might be too closely tied to this specific use caseSprintf(name, format, ...args)
, "format" argument could be a string with formatting directives and args would always include the hash. But ordering could be awkward, and this seems to magicalfs.HashOf(name)
, the caller can use the hash in whatever way they like.Let me know what you think
The text was updated successfully, but these errors were encountered: