Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@codingame/monaco-vscode-api
Advanced tools
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
import * as nls from 'monaco-editor/esm/vs/nls.js';
import { toAction } from 'monaco-editor/esm/vs/base/common/actions.js';
import { MainContext } from '../common/extHost.protocol.js';
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
import '../../../../../../override/vs/platform/dialogs/common/dialogs.js';
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
import { IDialogService } from '../../../platform/dialogs/common/dialogs.js';
let MainThreadMessageService = class MainThreadMessageService {
constructor(extHostContext, _notificationService, _dialogService) {
this._notificationService = _notificationService;
this._dialogService = _dialogService;
}
dispose() {
}
$showMessage(severity, message, options, commands) {
if (options.modal) {
return this._showModalMessage(severity, message, options.detail, commands, options.useCustom);
}
else {
return this._showMessage(severity, message, commands, options);
}
}
_showMessage(severity, message, commands, options) {
return ( new Promise(resolve => {
const primaryActions = ( commands.map(command => toAction({
id: _extension_message_handle_${command.handle}
,
label: command.title,
enabled: true,
run: () => {
resolve(command.handle);
return Promise.resolve();
}
})));
let source;
if (options.source) {
source = {
label: ( nls.localize('extensionSource', "{0} (Extension)", options.source.label)),
id: options.source.identifier.value
};
}
if (!source) {
source = ( nls.localize('defaultSource', "Extension"));
}
const secondaryActions = [];
const messageHandle = this._notificationService.notify({
severity,
message,
actions: { primary: primaryActions, secondary: secondaryActions },
source
});
Event.once(messageHandle.onDidClose)(() => {
resolve(undefined);
});
}));
}
async _showModalMessage(severity, message, detail, commands, useCustom) {
const buttons = [];
let cancelButton = undefined;
for (const command of commands) {
const button = {
label: command.title,
run: () => command.handle
};
if (command.isCloseAffordance) {
cancelButton = button;
}
else {
buttons.push(button);
}
}
if (!cancelButton) {
if (buttons.length > 0) {
cancelButton = {
label: ( nls.localize('cancel', "Cancel")),
run: () => undefined
};
}
else {
cancelButton = {
label: ( nls.localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK")),
run: () => undefined
};
}
}
const { result } = await this._dialogService.prompt({
type: severity,
message,
detail,
buttons,
cancelButton,
custom: useCustom
});
return result;
}
};
MainThreadMessageService = __decorate([
extHostNamedCustomer(MainContext.MainThreadMessageService),
( __param(1, INotificationService)),
( __param(2, IDialogService))
], MainThreadMessageService);
export { MainThreadMessageService };
FAQs
VSCode public API plugged on the monaco editor
We found that @codingame/monaco-vscode-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.