Tighten notebook code cell output sandbox and enable it by default (#664)

* Tighten notebook code cell output sandbox

* Enable sandboxnotebookoutputs by default

* Address feedback
This commit is contained in:
Tanuj Mittal
2021-04-14 11:06:44 -07:00
committed by GitHub
parent 1685b34e2a
commit 68789c5069
8 changed files with 202 additions and 36 deletions

View File

@@ -27,7 +27,7 @@ export type Features = {
export function extractFeatures(given = new URLSearchParams(window.location.search)): Features {
const downcased = new URLSearchParams();
const set = (value: string, key: string) => downcased.set(key.toLowerCase(), value);
const get = (key: string) => downcased.get("feature." + key) ?? undefined;
const get = (key: string, defaultValue?: string) => downcased.get("feature." + key) ?? defaultValue;
try {
new URLSearchParams(window.parent.location.search).forEach(set);
@@ -56,7 +56,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
notebookBasePath: get("notebookbasepath"),
notebookServerToken: get("notebookservertoken"),
notebookServerUrl: get("notebookserverurl"),
sandboxNotebookOutputs: "true" === get("sandboxnotebookoutputs"),
sandboxNotebookOutputs: "true" === get("sandboxnotebookoutputs", "true"),
selfServeType: get("selfservetype"),
pr: get("pr"),
showMinRUSurvey: "true" === get("showminrusurvey"),