-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set CSP frame-ancestors 'self' for nbgrader handlers #1915
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jeflem, looks good to me
Bump CI |
@jeflem I took the liberty to merge main is this PR to try to fix the |
Hi, Any ideas? |
Does it only fail on IPads ?
What do you mean by manually ? in the config ? |
Yes it seems to only fail on iPads (and maybe iPhones), so I'm guessing it's an iOS issue. By manually I mean configuring apache to set headers to 'self' for frame-ancestors and by first post I mean the first post in this PR. However, this doesn't seem to be an issue with nbgrader. But I don't know where to file the bug (Lab or Hub or webkit iOS itself). |
Thanks for the clarification |
Co-authored-by: Nicolas Brichet <[email protected]>
This PR solves issue #1870 (formgrader does not show in JupyerLab tab due to JupyterHub >=4.1.0 security settings in HTTP headers).
Starting with JupyterHub 4.1.0 HTTP header
is the default setting instead of
See Mitigating same-origin deployments for some background on this decision and CSP: frame-ancestors for details on the header.
The
none
header prevents loading of formgrader in a tab of JupyterLab.The JupyterHub
none
setting overwrites theself
setting of Jupyter Server running without JupyterHub. Seeself
in Jupyter Server,none
in JupyterHub's Jupyter Server extension,none
in JupyterHub's code for classic notebook.To allow embedding of nbgrader's formgrader (and possibly other nbgrader components) without affecting security of other JupyterHub components this PR sets
frame-ancestors
toself
for responses of nbgrader handlers only.The class
BaseHandler
modified by this PR is a subclass oftornado.web.RequestHandler
, which provides theset_header
method.