mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
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:
committed by
GitHub
parent
1d6c0bbd1e
commit
cf0c51337f
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user