Cleanup Synapse+Spark Logic (#813)

This commit is contained in:
Steve Faulkner
2021-05-25 14:46:52 -05:00
committed by GitHub
parent 522fdc69ab
commit e7e15c54b3
22 changed files with 46 additions and 6746 deletions

View File

@@ -36,7 +36,6 @@ import * as Constants from "../../../Common/Constants";
import { Areas } from "../../../Common/Constants";
import { Action as TelemetryAction, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor";
import { decryptJWTToken } from "../../../Utils/AuthorizationUtils";
import { logConsoleError, logConsoleInfo } from "../../../Utils/NotificationConsoleUtils";
import * as FileSystemUtil from "../FileSystemUtil";
import * as cdbActions from "../NotebookComponent/actions";
@@ -105,11 +104,6 @@ const formWebSocketURL = (serverConfig: NotebookServiceConfig, kernelId: string,
params.append("session_id", sessionId);
}
const userId = getUserPuid();
if (userId) {
params.append("user_id", userId);
}
const q = params.toString();
const suffix = q !== "" ? `?${q}` : "";
@@ -289,7 +283,6 @@ export const launchWebSocketKernelEpic = (
return EMPTY;
}
const serverConfig: NotebookServiceConfig = selectors.serverConfig(host);
serverConfig.userPuid = getUserPuid();
const {
payload: { kernelSpecName, cwd, kernelRef, contentRef },
@@ -766,25 +759,6 @@ const executeFocusedCellAndFocusNextEpic = (
);
};
function getUserPuid(): string {
const arcadiaToken = window.dataExplorer && window.dataExplorer.arcadiaToken();
if (!arcadiaToken) {
return undefined;
}
let userPuid;
try {
const tokenPayload = decryptJWTToken(arcadiaToken);
if (tokenPayload && tokenPayload.hasOwnProperty("puid")) {
userPuid = tokenPayload.puid;
}
} catch (error) {
// ignore
}
return userPuid;
}
/**
* Close tab if mimetype not supported
* @param action$