This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
Add COEP and COEP header middleware decorator and wildcard route #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To be able to use Starboard notebook to its full potential we need to set the COOP and COEP header. This is required for Atomics and SharedArrayBuffer to be used since the Spectre vulnerabilities (you can check in the browser console by typing
crossOriginIsolated
which should betrue
if everything is good).This PR introduces a middleware (not sure what they are called in Tornado, but I suppose its implemented as a decorator) that sets these headers to the correct value.
With these headers we basically opt in to a stricter set of security rules (which is not a bad idea anyway!), but there's a bit of work required before everything will work again:
crossorigin
attribute set. So it would be<script src="https://content.illumidesk.com/my-javascript-file.js" crossorigin></script>
. This likely means that we have to change some setting in our lms build pipeline that adds these tags. In webpack it'soutput.crossOriginLoading
.index.html
).content.illumidesk.com
. We can set that to a wildcard*
(most CDNs will do this, alternatively it could check the origin and see if it's in a whitelist - but that requires server logic in front of it). Screenshot of issue:https://content.illumidesk.com/npm/starboard-notebook
(e.g.npm/starboard-notebook@0.13.2/dist/index.html
) should additionally have the following headers set:(We have a crazy hack from Stefan to not actually require step 5, but we should not rely on that).