Skip to content

Commit a29d96f

Browse files
authored
Allow sentinel ext to use shutdown api (#16904)
1 parent 455265b commit a29d96f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/platform/common/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const JVSC_EXTENSION_ID = 'ms-toolsai.jupyter';
2525
export const DATA_WRANGLER_EXTENSION_ID = 'ms-toolsai.datawrangler';
2626
export const PROPOSED_API_ALLOWED_PUBLISHERS = ['donjayamanne'];
2727
export const POWER_TOYS_EXTENSION_ID = 'ms-toolsai.vscode-jupyter-powertoys';
28+
export const SENTINEL_EXTENSION_ID = 'ms-security.ms-sentinel';
2829
export const JUPYTER_HUB_EXTENSION_ID = 'ms-toolsai.jupyter-hub';
2930
export const AppinsightsKey = '0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255';
3031

src/standalone/api/kernels/kernel.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import {
2020
JVSC_EXTENSION_ID,
2121
POWER_TOYS_EXTENSION_ID,
2222
PROPOSED_API_ALLOWED_PUBLISHERS,
23-
PYTHON_LANGUAGE
23+
PYTHON_LANGUAGE,
24+
SENTINEL_EXTENSION_ID
2425
} from '../../../platform/common/constants';
2526
import { ChatMime, generatePythonCodeToInvokeCallback } from '../../../kernels/chat/generator';
2627
import {
@@ -132,15 +133,15 @@ class WrappedKernelPerExtension extends DisposableBase implements Kernel {
132133
return that.onDidReceiveDisplayUpdate.bind(this);
133134
},
134135
executeCode: (code: string, token: CancellationToken) => this.executeCode(code, token),
135-
get shutdown() {
136+
shutdown() {
136137
if (
137-
![JVSC_EXTENSION_ID, POWER_TOYS_EXTENSION_ID].includes(extensionId) &&
138+
![JVSC_EXTENSION_ID, POWER_TOYS_EXTENSION_ID, SENTINEL_EXTENSION_ID].includes(extensionId) &&
138139
!PROPOSED_API_ALLOWED_PUBLISHERS.includes(extensionId.split('.')[0])
139140
) {
140141
throw new Error(`Proposed API is not supported for extension ${extensionId}`);
141142
}
142143

143-
return () => that.shutdown();
144+
return that.shutdown();
144145
}
145146
});
146147
}

0 commit comments

Comments
 (0)