Change websocket authentication from url token to getting token from payload (#1487)

* Change websocket authentication from url to message body

* Add new message type

* Validation checks

* Remove flight and always send token in payload
This commit is contained in:
Karthik chakravarthy
2023-07-11 15:45:41 -04:00
committed by GitHub
parent 1d6c0bbd1e
commit cf0c51337f
3 changed files with 44 additions and 13 deletions

View File

@@ -47,6 +47,10 @@ export class JupyterLabAppFactory {
}
public async createTerminalApp(serverSettings: ServerConnection.ISettings): Promise<ITerminalConnection | undefined> {
//Need to add this after we remove passing token through url
//const configurationSettings: Partial<ServerConnection.ISettings> = serverSettings;
//(configurationSettings.appendToken as boolean) = false;
//serverSettings = ServerConnection.makeSettings(configurationSettings);
const manager = new TerminalManager({
serverSettings: serverSettings,
});
@@ -64,6 +68,11 @@ export class JupyterLabAppFactory {
}
}, this);
let internalSend = session.send;
session.send = (message: IMessage) => {
message?.content?.push(serverSettings?.token);
internalSend.call(session, message);
};
const term = new Terminal(session, { theme: "dark", shutdownOnClose: true });
if (!term) {