-
-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
It would be great for future work to integrate with ember-deploy, which I believe could automatically enable SRI for assets deployed to cdn. It would be good if that deploy step would also valid the deploy validates. Something worth adding to this rfc. The progress, browser support and potential for spec completion and future browser adoption. |
@lukemelia I would love your thoughts on the ember deploy side of things (or maybe you can pull in the appropriate people) |
It is also worth noting, a segment on the site will need to be added if we pull this in. |
The next version of ember-cli-deploy 0.5.0 is based on a pipeline + plugins architecture. A plugin would be be an excellent fit for adding SRI attributes. If we went that route, we would potentially lose the "SRI-by-default" benefit. But, personally, I would like to see the fingerprinting and prepending also become deploy pipeline plugins eventually. I think understanding their order of execution would be a lot easier that way. |
@lukemelia We want to prepackage the build plugin by default so that ember-cli-deploy can always at least do that. We could do the same thing with the SRI plugin too right? So, by default your deploy will build with SRI attributes. |
Will add to both the plugin README and RFC tonight.
100% and mostly this should be a copy and paste from the README
Can I suggest that this will lock out people with custom build processes like ourselves, if instead an addon could also be a plugin this might make a transition simpler. So if an addon could know when it was being used as a build process plugin it could give a better experience there. So for example if told by ember-build the origin and the crossorigin status of the CDN domain the code in its current state would give the best experience. The addon would just need to know when it is going to be used in this manner. Ultimately the addon is only a paper thin bit of code passing through to the broccoli however does ember really want an addon and a build plugin for everything similar to this? Either that or the |
Is there a path where ember-deploy can live healthily in you existing flow? I can't help but feel we can do an even better job with more input. Ultimately, I don't want to force these concepts to be entangled if doing so causes many users grief. |
Pretty much the best you could do is make the default config use the We are likely an edge case however here is a few issues I see that don't fit:
|
we should revisit this outside of this RFC, sorry for bringing it up. But thanks for the details. |
@stefanpenner yeah I was going to move that to be a issue on ember-cli-deploy but I don't really know the roadmap if However the code be it in ember-cli core or ember-cli-deploy can be moved to the new way later. Right now ember-cli could give relative path SRI out the box with zero config safely. The transition to deploy would not impact a developer using ember-cli as the attributes should be the same. |
I don't see that happening. But clearly some better coordiation between deploy + build is needed. |
Some further outstanding issues:
|
@stefanpenner here are the commits as mentioned: This expects version 1.0.0 of the addon which has not been published yet, however this should be ready by the end of the day. The change for the specification to fail-close should make no difference to us as it should not ever happen. Mailing list ember-cli-sri uses: broccoli-sri-hash uses: sri-toolbox |
@jonathanKingston what is the relationship between SRI and gzipping? Is the provided fingerprint expected to be after decoding content or before? In practical terms, will gzipping images, css & js as part of a deployment process invalidate the SRI fingerprints? |
@lukemelia it is checked after gzipping (I agree the algo is not so clear - I'll raise that as an issue). The company I work for is using a slightly older version of the addon: https://portal.cyber-ami.com/ (icons should not have the integrity) however we use gzip and the page gets checked correctly in the latest chrome. Images are not checked in the latest version of the specification as that will be a level 2 bit of work along with nested images within CSS. |
@lukemelia SRI is applied on the representation data, i.e., it undoes transport encoding like gzip. |
@jonathanKingston @mozfreddyb Thanks, I've been working on the next version of ember-cli-deploy, whose plugin ecosystem will include https://github.com/lukemelia/ember-cli-deploy-gzip. It doesn't sound like that will interfere with SRI providing gzipping occurs after SRI runs. 👍 |
@mozfreddyb thanks, I was looking purely at the fetch algo changes and wasn't seeing it. But then transport encoding doesn't seem to be mentioned in fetch either? |
@stefanpenner thanks 👍 |
Rendered