This commit is contained in:
23
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/LICENSE.txt
generated
vendored
Normal file
23
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
vscode-deviceid
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
41
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
106
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/azure-pipelines/azure-pipeline.yml
generated
vendored
Normal file
106
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/azure-pipelines/azure-pipeline.yml
generated
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
name: $(Date:yyyyMMdd)$(Rev:.r)
|
||||
|
||||
trigger: # cause a pipeline to run whenever you push an update to the specified branches
|
||||
batch: true
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
|
||||
parameters:
|
||||
- name: Publish
|
||||
displayName: Push to public npm feed?
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
variables:
|
||||
TeamName: 'Visual Studio Technical Insights'
|
||||
|
||||
# The `resources` specify the location and version of the 1ES PT.
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicrobuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/heads/release
|
||||
|
||||
extends:
|
||||
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
|
||||
# For non-production pipelines, use "Unofficial" as defined below.
|
||||
# For productions pipelines, use "Official".
|
||||
template: /azure-pipelines/MicroBuild.1ES.Official.Publish.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
customBuildTags:
|
||||
- Ignore-Tag
|
||||
pool:
|
||||
name: VSEngSS-MicroBuild2022-1ES
|
||||
os: windows # OS of the image. Allowed values: windows, linux, macOS
|
||||
|
||||
stages:
|
||||
- stage: BuildAndPublishNpmPackage
|
||||
jobs:
|
||||
- job: BuildAndPublish
|
||||
templateContext:
|
||||
mb:
|
||||
signing:
|
||||
enabled: true
|
||||
signType: Test
|
||||
zipSources: false
|
||||
displayName: Build and publish npm package
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '17.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
# lock to older version of python. We need diskutils which was removed in Python 3.12
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.11'
|
||||
|
||||
- script: |
|
||||
npm ci
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- script: |
|
||||
npm run build
|
||||
displayName: 'Compile npm package'
|
||||
|
||||
# Commenting out until we have tests
|
||||
# - script: |
|
||||
# npm run test
|
||||
# displayName: 'Test npm package'
|
||||
|
||||
- powershell: |
|
||||
New-Item -ItemType Directory -Path "$(Build.ArtifactStagingDirectory)\npmpackages" -Force
|
||||
displayName: Create npm package directory
|
||||
|
||||
- script: |
|
||||
npm pack --pack-destination "$(Build.ArtifactStagingDirectory)\npmpackages"
|
||||
displayName: 'Create npm package'
|
||||
|
||||
- powershell: |
|
||||
Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)\npmpackages"
|
||||
displayName: Get contents of $(Build.ArtifactStagingDirectory)\npmpackages
|
||||
|
||||
- ${{ if parameters.Publish }}:
|
||||
- template: /azure-pipelines/MicroBuild.Publish.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
intent: 'PackageDistribution'
|
||||
contentType: 'npm'
|
||||
contentSource: 'Folder'
|
||||
folderLocation: '$(Build.ArtifactStagingDirectory)\npmpackages'
|
||||
waitForReleaseCompletion: true
|
||||
owners: 'piel@microsoft.com'
|
||||
approvers: 'rdawson@microsoft.com'
|
||||
|
||||
- task: 1ES.PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
artifactName: output
|
||||
|
||||
- task: TSAUpload@2
|
||||
inputs:
|
||||
GdnPublishTsaOnboard: true
|
||||
GdnPublishTsaConfigFile: '$(Build.SourcesDirectory)/.config/TSAOptions.json'
|
||||
displayName: 'TSA upload to Codebase (vscode-deviceid)'
|
BIN
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/build/Release/windows.node
generated
vendored
Executable file
BIN
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/build/Release/windows.node
generated
vendored
Executable file
Binary file not shown.
50
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/dist/devdeviceid.js
generated
vendored
Normal file
50
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/dist/devdeviceid.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getDeviceId = void 0;
|
||||
const uuid_1 = require("uuid");
|
||||
const storage = __importStar(require("./storage.js"));
|
||||
async function getDeviceId() {
|
||||
let deviceId;
|
||||
try {
|
||||
deviceId = await storage.getDeviceId();
|
||||
}
|
||||
catch (e) {
|
||||
// Regenerate the deviceId if it cannot be read
|
||||
}
|
||||
if (deviceId) {
|
||||
return deviceId;
|
||||
}
|
||||
else {
|
||||
const newDeviceId = (0, uuid_1.v4)().toLowerCase();
|
||||
await storage.setDeviceId(newDeviceId);
|
||||
return newDeviceId;
|
||||
}
|
||||
}
|
||||
exports.getDeviceId = getDeviceId;
|
26
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/dist/index.js
generated
vendored
Normal file
26
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
if (process.platform !== "win32" &&
|
||||
process.platform !== "darwin" &&
|
||||
process.platform !== "linux") {
|
||||
throw new Error("Unsupported platform");
|
||||
}
|
||||
__exportStar(require("./devdeviceid.js"), exports);
|
80
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/dist/storage.js
generated
vendored
Normal file
80
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/dist/storage.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setDeviceId = exports.getDeviceId = void 0;
|
||||
const path = __importStar(require("path"));
|
||||
const fs = __importStar(require("fs-extra"));
|
||||
const windowRegistry = process.platform === "win32"
|
||||
? require("../build/Release/windows.node")
|
||||
: null;
|
||||
const deviceIdFileName = "deviceid";
|
||||
function getDirectory() {
|
||||
let folder;
|
||||
if (!process.env.HOME) {
|
||||
throw new Error("Home directory not found");
|
||||
}
|
||||
if (process.platform === "darwin") {
|
||||
folder = path.join(process.env.HOME, "Library", "Application Support");
|
||||
}
|
||||
else if (process.platform === "linux") {
|
||||
folder =
|
||||
process.env.XDG_CACHE_HOME ?? path.join(process.env.HOME, ".cache");
|
||||
}
|
||||
else {
|
||||
throw new Error("Unsupported platform");
|
||||
}
|
||||
return path.join(folder, "Microsoft", "DeveloperTools");
|
||||
}
|
||||
function getDeviceIdFilePath() {
|
||||
return path.join(getDirectory(), deviceIdFileName);
|
||||
}
|
||||
async function getDeviceId() {
|
||||
if (process.platform === "win32") {
|
||||
return windowRegistry?.GetDeviceId();
|
||||
}
|
||||
else {
|
||||
if (!fs.existsSync(getDeviceIdFilePath())) {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
return fs.readFile(getDeviceIdFilePath(), "utf8");
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.getDeviceId = getDeviceId;
|
||||
async function setDeviceId(deviceId) {
|
||||
if (process.platform === "win32") {
|
||||
windowRegistry?.SetDeviceId(deviceId);
|
||||
}
|
||||
else {
|
||||
await fs.ensureDir(getDirectory());
|
||||
await fs.writeFile(getDeviceIdFilePath(), deviceId, "utf8");
|
||||
}
|
||||
}
|
||||
exports.setDeviceId = setDeviceId;
|
8
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/nuget.config
generated
vendored
Normal file
8
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/nuget.config
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<!-- Please verify that the feed below exists for your project and replace placeholder values. You may also use another feed of your choice. -->
|
||||
<add key="PublicPackages" value="https://pkgs.dev.azure.com/devdiv/DevDiv/_packaging/DevDiv_PublicPackages/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
10
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/owners.txt
generated
vendored
Normal file
10
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/owners.txt
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
; This owners.txt file was initially populated by StartRight. Every code
|
||||
; change inside of an Ownership Enforcer enabled branch (such as master) must be
|
||||
; approved by at least one expert listed in an applicable owners.txt file. This
|
||||
; root owners.txt file is applicable to every change. Targeted experts can be
|
||||
; defined by placing an owners.txt file inside any subdirectory. More information
|
||||
; about Ownership Enforcer can be found at https://aka.ms/ownershipenforcer.
|
||||
rdawson
|
||||
riteshp
|
||||
piel
|
||||
jonathanyi
|
29
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/package.json
generated
vendored
Normal file
29
vscode-server-linux-x64-web/node_modules/@vscode/deviceid/package.json
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@vscode/deviceid",
|
||||
"version": "0.1.1",
|
||||
"description": "A module for Visual Studio Code to generate a unique device ID",
|
||||
"main": "./dist/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "npm run compile",
|
||||
"compile": "tsc",
|
||||
"lint": "eslint . --max-warnings 0 --report-unused-disable-directives",
|
||||
"lint:fix": "npm run lint -- --fix"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^20.12.4",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
||||
"@typescript-eslint/parser": "^7.5.0",
|
||||
"eslint": "^8.57.0",
|
||||
"prettier": "^3.2.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": "^11.2.0",
|
||||
"uuid": "^9.0.1"
|
||||
}
|
||||
}
|
21
vscode-server-linux-x64-web/node_modules/@vscode/iconv-lite-umd/LICENSE
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@vscode/iconv-lite-umd/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
12
vscode-server-linux-x64-web/node_modules/@vscode/iconv-lite-umd/lib/iconv-lite-umd.js
generated
vendored
Normal file
12
vscode-server-linux-x64-web/node_modules/@vscode/iconv-lite-umd/lib/iconv-lite-umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
39
vscode-server-linux-x64-web/node_modules/@vscode/iconv-lite-umd/package.json
generated
vendored
Normal file
39
vscode-server-linux-x64-web/node_modules/@vscode/iconv-lite-umd/package.json
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@vscode/iconv-lite-umd",
|
||||
"version": "0.7.0",
|
||||
"description": "Iconv-lite as UMD module",
|
||||
"main": "lib/iconv-lite-umd.js",
|
||||
"typings": "iconv-lite-umd.d.ts",
|
||||
"scripts": {
|
||||
"build": "webpack",
|
||||
"prepublish": "webpack",
|
||||
"test": "mocha --reporter spec --grep ."
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Microsoft/vscode-iconv-lite-umd.git"
|
||||
},
|
||||
"keywords": [
|
||||
"iconv-lite",
|
||||
"umd"
|
||||
],
|
||||
"author": "Microsoft",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/vscode-iconv-lite-umd/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Microsoft/vscode-iconv-lite-umd#readme",
|
||||
"devDependencies": {
|
||||
"async": "^3.2.0",
|
||||
"c8": "^7.2.0",
|
||||
"errto": "^0.2.1",
|
||||
"iconv": "^2.3.5",
|
||||
"iconv-lite": "0.6.3",
|
||||
"mocha": "^3.5.3",
|
||||
"request": "^2.88.2",
|
||||
"semver": "^6.3.0",
|
||||
"unorm": "^1.6.0",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
}
|
||||
}
|
24
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/LICENSE.md
generated
vendored
Normal file
24
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
||||
Copyright (c) 2015 Félicien François <felicien@tweakstyle.com>
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
41
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
207
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/out/agent.js
generated
vendored
Normal file
207
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/out/agent.js
generated
vendored
Normal file
@ -0,0 +1,207 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const http_1 = __importDefault(require("http"));
|
||||
const https_1 = __importDefault(require("https"));
|
||||
const debug_1 = __importDefault(require("debug"));
|
||||
const url_1 = require("url");
|
||||
const http_proxy_agent_1 = require("http-proxy-agent");
|
||||
const https_proxy_agent_1 = require("https-proxy-agent");
|
||||
const socks_proxy_agent_1 = require("socks-proxy-agent");
|
||||
const agent_base_1 = require("agent-base");
|
||||
const events_1 = __importDefault(require("events"));
|
||||
const debug = (0, debug_1.default)('pac-proxy-agent');
|
||||
/**
|
||||
* The `PacProxyAgent` class.
|
||||
*
|
||||
* A few different "protocol" modes are supported (supported protocols are
|
||||
* backed by the `get-uri` module):
|
||||
*
|
||||
* - "pac+data", "data" - refers to an embedded "data:" URI
|
||||
* - "pac+file", "file" - refers to a local file
|
||||
* - "pac+ftp", "ftp" - refers to a file located on an FTP server
|
||||
* - "pac+http", "http" - refers to an HTTP endpoint
|
||||
* - "pac+https", "https" - refers to an HTTPS endpoint
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
class _PacProxyAgent extends agent_base_1.Agent {
|
||||
constructor(resolver, opts = {}) {
|
||||
super(opts);
|
||||
debug('Creating PacProxyAgent with options %o', opts);
|
||||
this.resolver = resolver;
|
||||
this.opts = Object.assign({}, opts);
|
||||
this.cache = undefined;
|
||||
}
|
||||
/**
|
||||
* Called when the node-core HTTP client library is creating a new HTTP request.
|
||||
*
|
||||
* @api protected
|
||||
*/
|
||||
connect(req, opts) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { secureEndpoint } = opts;
|
||||
// Calculate the `url` parameter
|
||||
const defaultPort = secureEndpoint ? 443 : 80;
|
||||
let path = req.path;
|
||||
let search = null;
|
||||
const firstQuestion = path.indexOf('?');
|
||||
if (firstQuestion !== -1) {
|
||||
search = path.substring(firstQuestion);
|
||||
path = path.substring(0, firstQuestion);
|
||||
}
|
||||
const urlOpts = Object.assign(Object.assign({}, opts), { protocol: secureEndpoint ? 'https:' : 'http:', pathname: path, search,
|
||||
// need to use `hostname` instead of `host` otherwise `port` is ignored
|
||||
hostname: opts.host, host: null, href: null,
|
||||
// set `port` to null when it is the protocol default port (80 / 443)
|
||||
port: defaultPort === opts.port ? null : opts.port });
|
||||
const url = (0, url_1.format)(urlOpts);
|
||||
debug('url: %o', url);
|
||||
let result = yield this.resolver(req, opts, url);
|
||||
// Default to "DIRECT" if a falsey value was returned (or nothing)
|
||||
if (!result) {
|
||||
result = 'DIRECT';
|
||||
}
|
||||
const proxies = String(result)
|
||||
.trim()
|
||||
.split(/\s*;\s*/g)
|
||||
.filter(Boolean);
|
||||
if (this.opts.fallbackToDirect && !proxies.includes('DIRECT')) {
|
||||
proxies.push('DIRECT');
|
||||
}
|
||||
for (const proxy of proxies) {
|
||||
let agent = null;
|
||||
const [type, target] = proxy.split(/\s+/);
|
||||
debug('Attempting to use proxy: %o', proxy);
|
||||
if (type === 'DIRECT') {
|
||||
// Needed for SNI.
|
||||
const originalAgent = this.opts.originalAgent;
|
||||
const defaultAgent = secureEndpoint ? https_1.default.globalAgent : http_1.default.globalAgent;
|
||||
agent = originalAgent === false ? new defaultAgent.constructor() : (originalAgent || defaultAgent);
|
||||
}
|
||||
else if (type === 'SOCKS' || type === 'SOCKS5') {
|
||||
// Use a SOCKSv5h proxy
|
||||
agent = new socks_proxy_agent_1.SocksProxyAgent(`socks://${target}`);
|
||||
}
|
||||
else if (type === 'SOCKS4') {
|
||||
// Use a SOCKSv4a proxy
|
||||
agent = new socks_proxy_agent_1.SocksProxyAgent(`socks4a://${target}`);
|
||||
}
|
||||
else if (type === 'PROXY' ||
|
||||
type === 'HTTP' ||
|
||||
type === 'HTTPS') {
|
||||
// Use an HTTP or HTTPS proxy
|
||||
// http://dev.chromium.org/developers/design-documents/secure-web-proxy
|
||||
const proxyURL = `${type === 'HTTPS' ? 'https' : 'http'}://${target}`;
|
||||
if (secureEndpoint) {
|
||||
agent = new HttpsProxyAgent2(proxyURL, this.opts);
|
||||
}
|
||||
else {
|
||||
agent = new http_proxy_agent_1.HttpProxyAgent(proxyURL, this.opts);
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (agent) {
|
||||
let s;
|
||||
if (agent instanceof agent_base_1.Agent) {
|
||||
s = yield agent.connect(req, opts);
|
||||
}
|
||||
else {
|
||||
s = agent;
|
||||
}
|
||||
req.emit('proxy', { proxy, socket: s });
|
||||
return s;
|
||||
}
|
||||
throw new Error(`Could not determine proxy type for: ${proxy}`);
|
||||
}
|
||||
catch (err) {
|
||||
debug('Got error for proxy %o: %o', proxy, err);
|
||||
req.emit('proxy', { proxy, error: err });
|
||||
}
|
||||
}
|
||||
throw new Error(`Failed to establish a socket connection to proxies: ${JSON.stringify(proxies)}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
class HttpsProxyAgent2 extends https_proxy_agent_1.HttpsProxyAgent {
|
||||
constructor(proxy, opts) {
|
||||
const addHeaders = {};
|
||||
const origHeaders = opts === null || opts === void 0 ? void 0 : opts.headers;
|
||||
const agentOpts = Object.assign(Object.assign({}, opts), { headers: () => {
|
||||
const headers = origHeaders
|
||||
? typeof origHeaders === 'function'
|
||||
? origHeaders()
|
||||
: origHeaders
|
||||
: {};
|
||||
return Object.assign(Object.assign({}, headers), addHeaders);
|
||||
} });
|
||||
super(proxy, agentOpts);
|
||||
this.addHeaders = addHeaders;
|
||||
this.lookupProxyAuthorization = opts.lookupProxyAuthorization;
|
||||
}
|
||||
connect(req, opts, state = {}) {
|
||||
const _super = Object.create(null, {
|
||||
connect: { get: () => super.connect }
|
||||
});
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const tmpReq = new events_1.default();
|
||||
let connect;
|
||||
tmpReq.once('proxyConnect', (_connect) => {
|
||||
connect = _connect;
|
||||
});
|
||||
if (this.lookupProxyAuthorization && !this.addHeaders['Proxy-Authorization']) {
|
||||
try {
|
||||
const proxyAuthorization = yield this.lookupProxyAuthorization(this.proxy.href, undefined, state);
|
||||
if (proxyAuthorization) {
|
||||
this.addHeaders['Proxy-Authorization'] = proxyAuthorization;
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
req.emit('error', err);
|
||||
}
|
||||
}
|
||||
const s = yield _super.connect.call(this, tmpReq, opts);
|
||||
const proxyAuthenticate = connect === null || connect === void 0 ? void 0 : connect.headers['proxy-authenticate'];
|
||||
if (this.lookupProxyAuthorization && (connect === null || connect === void 0 ? void 0 : connect.statusCode) === 407 && proxyAuthenticate) {
|
||||
try {
|
||||
const proxyAuthorization = yield this.lookupProxyAuthorization(this.proxy.href, proxyAuthenticate, state);
|
||||
if (proxyAuthorization) {
|
||||
this.addHeaders['Proxy-Authorization'] = proxyAuthorization;
|
||||
tmpReq.removeAllListeners();
|
||||
s.destroy();
|
||||
return this.connect(req, opts, state);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
req.emit('error', err);
|
||||
}
|
||||
}
|
||||
req.once('socket', s => tmpReq.emit('socket', s));
|
||||
return s;
|
||||
});
|
||||
}
|
||||
}
|
||||
function createPacProxyAgent(resolver, opts) {
|
||||
if (!opts) {
|
||||
opts = {};
|
||||
}
|
||||
if (typeof resolver !== 'function') {
|
||||
throw new TypeError('a resolve function must be specified!');
|
||||
}
|
||||
return new _PacProxyAgent(resolver, opts);
|
||||
}
|
||||
(function (createPacProxyAgent) {
|
||||
createPacProxyAgent.PacProxyAgent = _PacProxyAgent;
|
||||
createPacProxyAgent.prototype = _PacProxyAgent.prototype;
|
||||
})(createPacProxyAgent || (createPacProxyAgent = {}));
|
||||
module.exports = createPacProxyAgent;
|
662
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/out/index.js
generated
vendored
Normal file
662
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/out/index.js
generated
vendored
Normal file
@ -0,0 +1,662 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Nathan Rajlich, Félicien François, Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.testCertificates = exports.toLogString = exports.resetCaches = exports.loadSystemCertificates = exports.createTlsPatch = exports.createNetPatch = exports.createHttpPatch = exports.createProxyResolver = exports.LogLevel = void 0;
|
||||
const net = __importStar(require("net"));
|
||||
const tls = __importStar(require("tls"));
|
||||
const nodeurl = __importStar(require("url"));
|
||||
const os = __importStar(require("os"));
|
||||
const fs = __importStar(require("fs"));
|
||||
const cp = __importStar(require("child_process"));
|
||||
const crypto = __importStar(require("crypto"));
|
||||
const agent_1 = __importStar(require("./agent"));
|
||||
var LogLevel;
|
||||
(function (LogLevel) {
|
||||
LogLevel[LogLevel["Trace"] = 0] = "Trace";
|
||||
LogLevel[LogLevel["Debug"] = 1] = "Debug";
|
||||
LogLevel[LogLevel["Info"] = 2] = "Info";
|
||||
LogLevel[LogLevel["Warning"] = 3] = "Warning";
|
||||
LogLevel[LogLevel["Error"] = 4] = "Error";
|
||||
LogLevel[LogLevel["Critical"] = 5] = "Critical";
|
||||
LogLevel[LogLevel["Off"] = 6] = "Off";
|
||||
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
||||
const maxCacheEntries = 5000; // Cache can grow twice that much due to 'oldCache'.
|
||||
function createProxyResolver(params) {
|
||||
const { getProxyURL, log, getLogLevel, proxyResolveTelemetry: proxyResolverTelemetry, useHostProxy, env } = params;
|
||||
let envProxy = proxyFromConfigURL(env.https_proxy || env.HTTPS_PROXY || env.http_proxy || env.HTTP_PROXY); // Not standardized.
|
||||
let envNoProxy = noProxyFromEnv(env.no_proxy || env.NO_PROXY); // Not standardized.
|
||||
let cacheRolls = 0;
|
||||
let oldCache = new Map();
|
||||
let cache = new Map();
|
||||
function getCacheKey(url) {
|
||||
// Expecting proxies to usually be the same per scheme://host:port. Assuming that for performance.
|
||||
return nodeurl.format(Object.assign(Object.assign({}, url), { pathname: undefined, search: undefined, hash: undefined }));
|
||||
}
|
||||
function getCachedProxy(key) {
|
||||
let proxy = cache.get(key);
|
||||
if (proxy) {
|
||||
return proxy;
|
||||
}
|
||||
proxy = oldCache.get(key);
|
||||
if (proxy) {
|
||||
oldCache.delete(key);
|
||||
cacheProxy(key, proxy);
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
function cacheProxy(key, proxy) {
|
||||
cache.set(key, proxy);
|
||||
if (cache.size >= maxCacheEntries) {
|
||||
oldCache = cache;
|
||||
cache = new Map();
|
||||
cacheRolls++;
|
||||
log.debug('ProxyResolver#cacheProxy cacheRolls', cacheRolls);
|
||||
}
|
||||
}
|
||||
let timeout;
|
||||
let count = 0;
|
||||
let duration = 0;
|
||||
let errorCount = 0;
|
||||
let cacheCount = 0;
|
||||
let envCount = 0;
|
||||
let settingsCount = 0;
|
||||
let localhostCount = 0;
|
||||
let envNoProxyCount = 0;
|
||||
let configNoProxyCount = 0;
|
||||
let results = [];
|
||||
function logEvent() {
|
||||
timeout = undefined;
|
||||
proxyResolverTelemetry({ count, duration, errorCount, cacheCount, cacheSize: cache.size, cacheRolls, envCount, settingsCount, localhostCount, envNoProxyCount, configNoProxyCount, results });
|
||||
count = duration = errorCount = cacheCount = envCount = settingsCount = localhostCount = envNoProxyCount = configNoProxyCount = 0;
|
||||
results = [];
|
||||
}
|
||||
function resolveProxy(flags, req, opts, url, callback) {
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(logEvent, 10 * 60 * 1000);
|
||||
}
|
||||
const stackText = ''; // getLogLevel() === LogLevel.Trace ? '\n' + new Error('Error for stack trace').stack : '';
|
||||
addCertificatesV1(params, flags.addCertificatesV1, opts, () => {
|
||||
useProxySettings(useHostProxy, flags.useProxySettings, req, opts, url, stackText, callback);
|
||||
});
|
||||
}
|
||||
function useProxySettings(useHostProxy, useProxySettings, req, opts, url, stackText, callback) {
|
||||
if (!useProxySettings) {
|
||||
callback('DIRECT');
|
||||
return;
|
||||
}
|
||||
const parsedUrl = nodeurl.parse(url); // Coming from Node's URL, sticking with that.
|
||||
const hostname = parsedUrl.hostname;
|
||||
if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1' || hostname === '::ffff:127.0.0.1') {
|
||||
localhostCount++;
|
||||
callback('DIRECT');
|
||||
log.debug('ProxyResolver#resolveProxy localhost', url, 'DIRECT', stackText);
|
||||
return;
|
||||
}
|
||||
const { secureEndpoint } = opts;
|
||||
const defaultPort = secureEndpoint ? 443 : 80;
|
||||
// if there are any config entries present then env variables are ignored
|
||||
let noProxyConfig = params.getNoProxyConfig ? params.getNoProxyConfig() : [];
|
||||
if (noProxyConfig.length) {
|
||||
let configNoProxy = noProxyFromConfig(noProxyConfig); // Not standardized.
|
||||
if (typeof hostname === 'string' && configNoProxy(hostname, String(parsedUrl.port || defaultPort))) {
|
||||
configNoProxyCount++;
|
||||
callback('DIRECT');
|
||||
log.debug('ProxyResolver#resolveProxy configNoProxy', url, 'DIRECT', stackText);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (typeof hostname === 'string' && envNoProxy(hostname, String(parsedUrl.port || defaultPort))) {
|
||||
envNoProxyCount++;
|
||||
callback('DIRECT');
|
||||
log.debug('ProxyResolver#resolveProxy envNoProxy', url, 'DIRECT', stackText);
|
||||
return;
|
||||
}
|
||||
}
|
||||
let settingsProxy = proxyFromConfigURL(getProxyURL());
|
||||
if (settingsProxy) {
|
||||
settingsCount++;
|
||||
callback(settingsProxy);
|
||||
log.debug('ProxyResolver#resolveProxy settings', url, settingsProxy, stackText);
|
||||
return;
|
||||
}
|
||||
if (envProxy) {
|
||||
envCount++;
|
||||
callback(envProxy);
|
||||
log.debug('ProxyResolver#resolveProxy env', url, envProxy, stackText);
|
||||
return;
|
||||
}
|
||||
const key = getCacheKey(parsedUrl);
|
||||
const proxy = getCachedProxy(key);
|
||||
if (proxy) {
|
||||
cacheCount++;
|
||||
collectResult(results, proxy, parsedUrl.protocol === 'https:' ? 'HTTPS' : 'HTTP', req);
|
||||
callback(proxy);
|
||||
log.debug('ProxyResolver#resolveProxy cached', url, proxy, stackText);
|
||||
return;
|
||||
}
|
||||
if (!useHostProxy) {
|
||||
callback('DIRECT');
|
||||
log.debug('ProxyResolver#resolveProxy unconfigured', url, 'DIRECT', stackText);
|
||||
return;
|
||||
}
|
||||
const start = Date.now();
|
||||
params.resolveProxy(url) // Use full URL to ensure it is an actually used one.
|
||||
.then(proxy => {
|
||||
if (proxy) {
|
||||
cacheProxy(key, proxy);
|
||||
collectResult(results, proxy, parsedUrl.protocol === 'https:' ? 'HTTPS' : 'HTTP', req);
|
||||
}
|
||||
callback(proxy);
|
||||
log.debug('ProxyResolver#resolveProxy', url, proxy, stackText);
|
||||
}).then(() => {
|
||||
count++;
|
||||
duration = Date.now() - start + duration;
|
||||
}, err => {
|
||||
errorCount++;
|
||||
const fallback = cache.values().next().value; // fall back to any proxy (https://github.com/microsoft/vscode/issues/122825)
|
||||
callback(fallback);
|
||||
log.error('ProxyResolver#resolveProxy', fallback, toErrorMessage(err), stackText);
|
||||
});
|
||||
}
|
||||
return resolveProxy;
|
||||
}
|
||||
exports.createProxyResolver = createProxyResolver;
|
||||
function collectResult(results, resolveProxy, connection, req) {
|
||||
const proxy = resolveProxy ? String(resolveProxy).trim().split(/\s+/, 1)[0] : 'EMPTY';
|
||||
req.on('response', res => {
|
||||
const code = `HTTP_${res.statusCode}`;
|
||||
const result = findOrCreateResult(results, proxy, connection, code);
|
||||
result.count++;
|
||||
});
|
||||
req.on('error', err => {
|
||||
const code = err && typeof err.code === 'string' && err.code || 'UNKNOWN_ERROR';
|
||||
const result = findOrCreateResult(results, proxy, connection, code);
|
||||
result.count++;
|
||||
});
|
||||
}
|
||||
function findOrCreateResult(results, proxy, connection, code) {
|
||||
for (const result of results) {
|
||||
if (result.proxy === proxy && result.connection === connection && result.code === code) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
const result = { proxy, connection, code, count: 0 };
|
||||
results.push(result);
|
||||
return result;
|
||||
}
|
||||
function proxyFromConfigURL(configURL) {
|
||||
if (!configURL) {
|
||||
return undefined;
|
||||
}
|
||||
const url = (configURL || '').trim();
|
||||
const i = url.indexOf('://');
|
||||
if (i === -1) {
|
||||
return undefined;
|
||||
}
|
||||
const scheme = url.substr(0, i).toLowerCase();
|
||||
const proxy = url.substr(i + 3);
|
||||
if (scheme === 'http') {
|
||||
return 'PROXY ' + proxy;
|
||||
}
|
||||
else if (scheme === 'https') {
|
||||
return 'HTTPS ' + proxy;
|
||||
}
|
||||
else if (scheme === 'socks' || scheme === 'socks5' || scheme === 'socks5h') {
|
||||
return 'SOCKS ' + proxy;
|
||||
}
|
||||
else if (scheme === 'socks4' || scheme === 'socks4a') {
|
||||
return 'SOCKS4 ' + proxy;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function shouldBypassProxy(value) {
|
||||
if (value.includes("*")) {
|
||||
return () => true;
|
||||
}
|
||||
const filters = value
|
||||
.map(s => s.trim().split(':', 2))
|
||||
.map(([name, port]) => ({ name, port }))
|
||||
.filter(filter => !!filter.name)
|
||||
.map(({ name, port }) => {
|
||||
const domain = name[0] === '.' ? name : `.${name}`;
|
||||
return { domain, port };
|
||||
});
|
||||
if (!filters.length) {
|
||||
return () => false;
|
||||
}
|
||||
return (hostname, port) => filters.some(({ domain, port: filterPort }) => {
|
||||
return `.${hostname.toLowerCase()}`.endsWith(domain) && (!filterPort || port === filterPort);
|
||||
});
|
||||
}
|
||||
function noProxyFromEnv(envValue) {
|
||||
const value = (envValue || '')
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.split(',');
|
||||
return shouldBypassProxy(value);
|
||||
}
|
||||
function noProxyFromConfig(noProxy) {
|
||||
const value = noProxy
|
||||
.map((item) => item.trim().toLowerCase());
|
||||
return shouldBypassProxy(value);
|
||||
}
|
||||
function createHttpPatch(params, originals, resolveProxy) {
|
||||
return {
|
||||
get: patch(originals.get),
|
||||
request: patch(originals.request)
|
||||
};
|
||||
function patch(original) {
|
||||
function patched(url, options, callback) {
|
||||
if (typeof url !== 'string' && !(url && url.searchParams)) {
|
||||
callback = options;
|
||||
options = url;
|
||||
url = null;
|
||||
}
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
options = options || {};
|
||||
if (options.socketPath) {
|
||||
return original.apply(null, arguments);
|
||||
}
|
||||
const originalAgent = options.agent;
|
||||
if (originalAgent === true) {
|
||||
throw new Error('Unexpected agent option: true');
|
||||
}
|
||||
const isHttps = originals.globalAgent.protocol === 'https:';
|
||||
const optionsPatched = originalAgent instanceof agent_1.PacProxyAgent;
|
||||
const config = params.getProxySupport();
|
||||
const useProxySettings = !optionsPatched && (config === 'override' || config === 'fallback' || (config === 'on' && originalAgent === undefined));
|
||||
const addCertificatesV1 = !optionsPatched && params.addCertificatesV1() && isHttps && !options.ca;
|
||||
if (useProxySettings || addCertificatesV1) {
|
||||
if (url) {
|
||||
const parsed = typeof url === 'string' ? new nodeurl.URL(url) : url;
|
||||
const urlOptions = {
|
||||
protocol: parsed.protocol,
|
||||
hostname: parsed.hostname.lastIndexOf('[', 0) === 0 ? parsed.hostname.slice(1, -1) : parsed.hostname,
|
||||
port: parsed.port,
|
||||
path: `${parsed.pathname}${parsed.search}`
|
||||
};
|
||||
if (parsed.username || parsed.password) {
|
||||
options.auth = `${parsed.username}:${parsed.password}`;
|
||||
}
|
||||
options = Object.assign(Object.assign({}, urlOptions), options);
|
||||
}
|
||||
else {
|
||||
options = Object.assign({}, options);
|
||||
}
|
||||
const resolveP = (req, opts, url) => new Promise(resolve => resolveProxy({ useProxySettings, addCertificatesV1 }, req, opts, url, resolve));
|
||||
const host = options.hostname || options.host;
|
||||
const isLocalhost = !host || host === 'localhost' || host === '127.0.0.1'; // Avoiding https://github.com/microsoft/vscode/issues/120354
|
||||
options.agent = (0, agent_1.default)(resolveP, {
|
||||
originalAgent: (!useProxySettings || isLocalhost || config === 'fallback') ? originalAgent : undefined,
|
||||
lookupProxyAuthorization: params.lookupProxyAuthorization,
|
||||
});
|
||||
return original(options, callback);
|
||||
}
|
||||
return original.apply(null, arguments);
|
||||
}
|
||||
return patched;
|
||||
}
|
||||
}
|
||||
exports.createHttpPatch = createHttpPatch;
|
||||
function createNetPatch(params, originals) {
|
||||
return {
|
||||
connect: patchNetConnect(params, originals.connect),
|
||||
};
|
||||
}
|
||||
exports.createNetPatch = createNetPatch;
|
||||
function patchNetConnect(params, original) {
|
||||
function connect(...args) {
|
||||
if (params.getLogLevel() === LogLevel.Trace) {
|
||||
params.log.trace('ProxyResolver#net.connect', toLogString(args));
|
||||
}
|
||||
if (!params.addCertificatesV2()) {
|
||||
return original.apply(null, arguments);
|
||||
}
|
||||
const socket = new net.Socket();
|
||||
socket.connecting = true;
|
||||
getOrLoadAdditionalCertificates(params)
|
||||
.then(() => {
|
||||
const options = args.find(arg => arg && typeof arg === 'object');
|
||||
if (options === null || options === void 0 ? void 0 : options.timeout) {
|
||||
socket.setTimeout(options.timeout);
|
||||
}
|
||||
socket.connect.apply(socket, arguments);
|
||||
})
|
||||
.catch(err => {
|
||||
params.log.error('ProxyResolver#net.connect', toErrorMessage(err));
|
||||
});
|
||||
return socket;
|
||||
}
|
||||
return connect;
|
||||
}
|
||||
function createTlsPatch(params, originals) {
|
||||
return {
|
||||
connect: patchTlsConnect(params, originals.connect),
|
||||
createSecureContext: patchCreateSecureContext(originals.createSecureContext),
|
||||
};
|
||||
}
|
||||
exports.createTlsPatch = createTlsPatch;
|
||||
function patchTlsConnect(params, original) {
|
||||
function connect(...args) {
|
||||
if (params.getLogLevel() === LogLevel.Trace) {
|
||||
params.log.trace('ProxyResolver#tls.connect', toLogString(args));
|
||||
}
|
||||
let options = args.find(arg => arg && typeof arg === 'object');
|
||||
if (!params.addCertificatesV2() || (options === null || options === void 0 ? void 0 : options.ca)) {
|
||||
return original.apply(null, arguments);
|
||||
}
|
||||
let secureConnectListener = args.find(arg => typeof arg === 'function');
|
||||
if (!options) {
|
||||
options = {};
|
||||
const listenerIndex = args.findIndex(arg => typeof arg === 'function');
|
||||
if (listenerIndex !== -1) {
|
||||
args[listenerIndex - 1] = options;
|
||||
}
|
||||
else {
|
||||
args[2] = options;
|
||||
}
|
||||
}
|
||||
else {
|
||||
options = Object.assign({}, options);
|
||||
}
|
||||
const port = typeof args[0] === 'number' ? args[0]
|
||||
: typeof args[0] === 'string' && !isNaN(Number(args[0])) ? Number(args[0]) // E.g., http2 module passes port as string.
|
||||
: options.port;
|
||||
const host = typeof args[1] === 'string' ? args[1] : options.host;
|
||||
let tlsSocket;
|
||||
if (options.socket) {
|
||||
if (!options.secureContext) {
|
||||
options.secureContext = tls.createSecureContext(options);
|
||||
}
|
||||
if (!_certificates) {
|
||||
params.log.trace('ProxyResolver#tls.connect waiting for existing socket connect');
|
||||
options.socket.once('connect', () => {
|
||||
params.log.trace('ProxyResolver#tls.connect got existing socket connect - adding certs');
|
||||
for (const cert of _certificates || []) {
|
||||
options.secureContext.context.addCACert(cert);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
params.log.trace('ProxyResolver#tls.connect existing socket already connected - adding certs');
|
||||
for (const cert of _certificates) {
|
||||
options.secureContext.context.addCACert(cert);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!options.secureContext) {
|
||||
options.secureContext = tls.createSecureContext(options);
|
||||
}
|
||||
params.log.trace('ProxyResolver#tls.connect creating unconnected socket');
|
||||
const socket = options.socket = new net.Socket();
|
||||
socket.connecting = true;
|
||||
getOrLoadAdditionalCertificates(params)
|
||||
.then(caCertificates => {
|
||||
params.log.trace('ProxyResolver#tls.connect adding certs before connecting socket');
|
||||
for (const cert of caCertificates) {
|
||||
options.secureContext.context.addCACert(cert);
|
||||
}
|
||||
if (options === null || options === void 0 ? void 0 : options.timeout) {
|
||||
socket.setTimeout(options.timeout);
|
||||
socket.once('timeout', () => {
|
||||
tlsSocket.emit('timeout');
|
||||
});
|
||||
}
|
||||
socket.connect(Object.assign({ port: port, host }, options));
|
||||
})
|
||||
.catch(err => {
|
||||
params.log.error('ProxyResolver#tls.connect', toErrorMessage(err));
|
||||
});
|
||||
}
|
||||
if (typeof args[1] === 'string') {
|
||||
tlsSocket = original(port, host, options, secureConnectListener);
|
||||
}
|
||||
else if (typeof args[0] === 'number' || typeof args[0] === 'string' && !isNaN(Number(args[0]))) {
|
||||
tlsSocket = original(port, options, secureConnectListener);
|
||||
}
|
||||
else {
|
||||
tlsSocket = original(options, secureConnectListener);
|
||||
}
|
||||
return tlsSocket;
|
||||
}
|
||||
return connect;
|
||||
}
|
||||
function patchCreateSecureContext(original) {
|
||||
return function (details) {
|
||||
const context = original.apply(null, arguments);
|
||||
const certs = details === null || details === void 0 ? void 0 : details._vscodeAdditionalCaCerts;
|
||||
if (certs) {
|
||||
for (const cert of certs) {
|
||||
context.context.addCACert(cert);
|
||||
}
|
||||
}
|
||||
return context;
|
||||
};
|
||||
}
|
||||
function addCertificatesV1(params, addCertificatesV1, opts, callback) {
|
||||
if (addCertificatesV1) {
|
||||
getOrLoadAdditionalCertificates(params)
|
||||
.then(caCertificates => {
|
||||
opts._vscodeAdditionalCaCerts = caCertificates;
|
||||
callback();
|
||||
})
|
||||
.catch(err => {
|
||||
params.log.error('ProxyResolver#addCertificatesV1', toErrorMessage(err));
|
||||
});
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
let _certificatesPromise;
|
||||
let _certificates;
|
||||
function getOrLoadAdditionalCertificates(params) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!_certificatesPromise) {
|
||||
_certificatesPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
||||
return _certificates = yield params.loadAdditionalCertificates();
|
||||
}))();
|
||||
}
|
||||
return _certificatesPromise;
|
||||
});
|
||||
}
|
||||
let _systemCertificatesPromise;
|
||||
function loadSystemCertificates(params) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!_systemCertificatesPromise) {
|
||||
_systemCertificatesPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const certs = yield readSystemCertificates();
|
||||
params.log.debug('ProxyResolver#loadSystemCertificates count', certs.length);
|
||||
const now = Date.now();
|
||||
const filtered = certs
|
||||
.filter(cert => {
|
||||
try {
|
||||
const parsedCert = new crypto.X509Certificate(cert);
|
||||
const parsedDate = Date.parse(parsedCert.validTo);
|
||||
return isNaN(parsedDate) || parsedDate > now;
|
||||
}
|
||||
catch (err) {
|
||||
params.log.debug('ProxyResolver#loadSystemCertificates parse error', toErrorMessage(err));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
params.log.debug('ProxyResolver#loadSystemCertificates count filtered', filtered.length);
|
||||
return filtered;
|
||||
}
|
||||
catch (err) {
|
||||
params.log.error('ProxyResolver#loadSystemCertificates error', toErrorMessage(err));
|
||||
return [];
|
||||
}
|
||||
}))();
|
||||
}
|
||||
return _systemCertificatesPromise;
|
||||
});
|
||||
}
|
||||
exports.loadSystemCertificates = loadSystemCertificates;
|
||||
function resetCaches() {
|
||||
_certificatesPromise = undefined;
|
||||
_certificates = undefined;
|
||||
_systemCertificatesPromise = undefined;
|
||||
}
|
||||
exports.resetCaches = resetCaches;
|
||||
function readSystemCertificates() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (process.platform === 'win32') {
|
||||
return readWindowsCaCertificates();
|
||||
}
|
||||
if (process.platform === 'darwin') {
|
||||
return readMacCaCertificates();
|
||||
}
|
||||
if (process.platform === 'linux') {
|
||||
return readLinuxCaCertificates();
|
||||
}
|
||||
return [];
|
||||
});
|
||||
}
|
||||
function readWindowsCaCertificates() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// @ts-ignore Windows only
|
||||
const winCA = yield Promise.resolve().then(() => __importStar(require('@vscode/windows-ca-certs')));
|
||||
let ders = [];
|
||||
const store = new winCA.Crypt32();
|
||||
try {
|
||||
let der;
|
||||
while (der = store.next()) {
|
||||
ders.push(der);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
store.done();
|
||||
}
|
||||
const certs = new Set(ders.map(derToPem));
|
||||
return Array.from(certs);
|
||||
});
|
||||
}
|
||||
function readMacCaCertificates() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const stdout = yield new Promise((resolve, reject) => {
|
||||
const child = cp.spawn('/usr/bin/security', ['find-certificate', '-a', '-p']);
|
||||
const stdout = [];
|
||||
child.stdout.setEncoding('utf8');
|
||||
child.stdout.on('data', str => stdout.push(str));
|
||||
child.on('error', reject);
|
||||
child.on('exit', code => code ? reject(code) : resolve(stdout.join('')));
|
||||
});
|
||||
const certs = new Set(stdout.split(/(?=-----BEGIN CERTIFICATE-----)/g)
|
||||
.filter(pem => !!pem.length));
|
||||
return Array.from(certs);
|
||||
});
|
||||
}
|
||||
const linuxCaCertificatePaths = [
|
||||
'/etc/ssl/certs/ca-certificates.crt',
|
||||
'/etc/ssl/certs/ca-bundle.crt',
|
||||
'/etc/ssl/ca-bundle.pem', // OpenSUSE
|
||||
];
|
||||
function readLinuxCaCertificates() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
for (const certPath of linuxCaCertificatePaths) {
|
||||
try {
|
||||
const content = yield fs.promises.readFile(certPath, { encoding: 'utf8' });
|
||||
const certs = new Set(content.split(/(?=-----BEGIN CERTIFICATE-----)/g)
|
||||
.filter(pem => !!pem.length));
|
||||
return Array.from(certs);
|
||||
}
|
||||
catch (err) {
|
||||
if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [];
|
||||
});
|
||||
}
|
||||
function derToPem(blob) {
|
||||
const lines = ['-----BEGIN CERTIFICATE-----'];
|
||||
const der = blob.toString('base64');
|
||||
for (let i = 0; i < der.length; i += 64) {
|
||||
lines.push(der.substr(i, 64));
|
||||
}
|
||||
lines.push('-----END CERTIFICATE-----', '');
|
||||
return lines.join(os.EOL);
|
||||
}
|
||||
function toErrorMessage(err) {
|
||||
return err && (err.stack || err.message) || String(err);
|
||||
}
|
||||
function toLogString(args) {
|
||||
return `[${args.map(arg => JSON.stringify(arg, (key, value) => {
|
||||
const t = typeof value;
|
||||
if (t === 'object') {
|
||||
if (key) {
|
||||
if ((key === 'ca' || key === '_vscodeAdditionalCaCerts') && Array.isArray(value)) {
|
||||
return `[${value.length} certs]`;
|
||||
}
|
||||
if (key === 'ca' && (typeof value === 'string' || Buffer.isBuffer(value))) {
|
||||
return `[${(value.toString().match(/-----BEGIN CERTIFICATE-----/g) || []).length} certs]`;
|
||||
}
|
||||
return !value || value.toString ? String(value) : Object.prototype.toString.call(value);
|
||||
}
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
if (t === 'function') {
|
||||
return `[Function: ${value.name}]`;
|
||||
}
|
||||
if (t === 'bigint') {
|
||||
return String(value);
|
||||
}
|
||||
if (t === 'string' && value.length > 25) {
|
||||
const len = `[${value.length} chars]`;
|
||||
return `${value.substr(0, 25 - len.length)}${len}`;
|
||||
}
|
||||
return value;
|
||||
})).join(', ')}]`;
|
||||
}
|
||||
exports.toLogString = toLogString;
|
||||
/**
|
||||
* Certificates for testing. These are not automatically used, but can be added in
|
||||
* ProxyAgentParams#loadAdditionalCertificates(). This just provides a shared array
|
||||
* between production code and tests.
|
||||
*/
|
||||
exports.testCertificates = [];
|
50
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/package.json
generated
vendored
Normal file
50
vscode-server-linux-x64-web/node_modules/@vscode/proxy-agent/package.json
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "@vscode/proxy-agent",
|
||||
"version": "0.21.0",
|
||||
"description": "NodeJS http(s) agent implementation for VS Code",
|
||||
"main": "out/index.js",
|
||||
"types": "out/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/microsoft/vscode-proxy-agent.git"
|
||||
},
|
||||
"keywords": [
|
||||
"proxy",
|
||||
"agent",
|
||||
"http",
|
||||
"https",
|
||||
"socks",
|
||||
"request",
|
||||
"access"
|
||||
],
|
||||
"authors": [
|
||||
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
||||
"Félicien François <felicien@tweakstyle.com>",
|
||||
"Microsoft Corporation"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/microsoft/vscode-proxy-agent/issues"
|
||||
},
|
||||
"homepage": "https://github.com/microsoft/vscode-proxy-agent",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "^3.0.0",
|
||||
"agent-base": "^7.0.1",
|
||||
"debug": "^4.3.4",
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"socks-proxy-agent": "^8.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "^4.1.9",
|
||||
"@types/node": "^20.8.4",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@vscode/windows-ca-certs": "^0.3.1"
|
||||
}
|
||||
}
|
13
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/LICENSE
generated
vendored
Normal file
13
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/LICENSE
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
vscode-ripgrep
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
41
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
BIN
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/bin/rg
generated
vendored
Executable file
BIN
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/bin/rg
generated
vendored
Executable file
Binary file not shown.
46
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/build/pipeline.yml
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/build/pipeline.yml
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: $(Date:yyyyMMdd)$(Rev:.r)
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
pr: none
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: github
|
||||
name: microsoft/vscode-engineering
|
||||
ref: main
|
||||
endpoint: Monaco
|
||||
|
||||
parameters:
|
||||
- name: publishPackage
|
||||
displayName: 🚀 Publish @vscode/ripgrep
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/npm-package/pipeline.yml@templates
|
||||
parameters:
|
||||
npmPackages:
|
||||
- name: ripgrep
|
||||
|
||||
buildPlatforms:
|
||||
- name: Linux
|
||||
nodeVersions:
|
||||
- 18.x
|
||||
- name: MacOS
|
||||
nodeVersions:
|
||||
- 18.x
|
||||
- name: Windows
|
||||
nodeVersions:
|
||||
- 18.x
|
||||
|
||||
buildSteps:
|
||||
- script: npm i
|
||||
displayName: Install dependencies
|
||||
env:
|
||||
GITHUB_TOKEN: $(github-token-public-repos)
|
||||
|
||||
publishPackage: ${{ parameters.publishPackage }}
|
8
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/jsconfig.json
generated
vendored
Normal file
8
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/jsconfig.json
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"lib": [
|
||||
"esnext"
|
||||
]
|
||||
}
|
||||
}
|
356
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/lib/download.js
generated
vendored
Normal file
356
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/lib/download.js
generated
vendored
Normal file
@ -0,0 +1,356 @@
|
||||
// @ts-check
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const https = require('https');
|
||||
const util = require('util');
|
||||
const url = require('url');
|
||||
const stream = require('stream');
|
||||
const child_process = require('child_process');
|
||||
const proxy_from_env = require('proxy-from-env');
|
||||
const yauzl = require('yauzl'); // use yauzl ^2.9.2 because vscode already ships with it.
|
||||
const packageVersion = require('../package.json').version;
|
||||
const tmpDir = path.join(os.tmpdir(), `vscode-ripgrep-cache-${packageVersion}`);
|
||||
|
||||
const fsUnlink = util.promisify(fs.unlink);
|
||||
const fsExists = util.promisify(fs.exists);
|
||||
const fsMkdir = util.promisify(fs.mkdir);
|
||||
|
||||
const isWindows = os.platform() === 'win32';
|
||||
|
||||
const REPO = 'microsoft/ripgrep-prebuilt';
|
||||
const pipelineAsync = util.promisify(stream.pipeline);
|
||||
|
||||
/**
|
||||
* @param {string} _url
|
||||
*/
|
||||
function isGithubUrl(_url) {
|
||||
return url.parse(_url).hostname === 'api.github.com';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} _url
|
||||
* @param {fs.PathLike} dest
|
||||
* @param {any} opts
|
||||
*/
|
||||
function download(_url, dest, opts) {
|
||||
|
||||
const proxy = proxy_from_env.getProxyForUrl(url.parse(_url));
|
||||
if (proxy !== '') {
|
||||
var HttpsProxyAgent = require('https-proxy-agent');
|
||||
opts = {
|
||||
...opts,
|
||||
"agent": new HttpsProxyAgent.HttpsProxyAgent(proxy),
|
||||
proxy
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (opts.headers && opts.headers.authorization && !isGithubUrl(_url)) {
|
||||
delete opts.headers.authorization;
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(`Download options: ${JSON.stringify(opts)}`);
|
||||
const outFile = fs.createWriteStream(dest);
|
||||
const mergedOpts = {
|
||||
...url.parse(_url),
|
||||
...opts
|
||||
};
|
||||
https.get(mergedOpts, response => {
|
||||
console.log('statusCode: ' + response.statusCode);
|
||||
if (response.statusCode === 302) {
|
||||
console.log('Following redirect to: ' + response.headers.location);
|
||||
return download(response.headers.location, dest, opts)
|
||||
.then(resolve, reject);
|
||||
} else if (response.statusCode !== 200) {
|
||||
reject(new Error('Download failed with ' + response.statusCode));
|
||||
return;
|
||||
}
|
||||
|
||||
response.pipe(outFile);
|
||||
outFile.on('finish', () => {
|
||||
resolve();
|
||||
});
|
||||
}).on('error', async err => {
|
||||
await fsUnlink(dest);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} _url
|
||||
* @param {any} opts
|
||||
*/
|
||||
function get(_url, opts) {
|
||||
console.log(`GET ${_url}`);
|
||||
|
||||
const proxy = proxy_from_env.getProxyForUrl(url.parse(_url));
|
||||
if (proxy !== '') {
|
||||
var HttpsProxyAgent = require('https-proxy-agent');
|
||||
opts = {
|
||||
...opts,
|
||||
"agent": new HttpsProxyAgent.HttpsProxyAgent(proxy)
|
||||
};
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let result = '';
|
||||
opts = {
|
||||
...url.parse(_url),
|
||||
...opts
|
||||
};
|
||||
https.get(opts, response => {
|
||||
if (response.statusCode !== 200) {
|
||||
reject(new Error('Request failed: ' + response.statusCode));
|
||||
}
|
||||
|
||||
response.on('data', d => {
|
||||
result += d.toString();
|
||||
});
|
||||
|
||||
response.on('end', () => {
|
||||
resolve(result);
|
||||
});
|
||||
|
||||
response.on('error', e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} repo
|
||||
* @param {string} tag
|
||||
*/
|
||||
function getApiUrl(repo, tag) {
|
||||
return `https://api.github.com/repos/${repo}/releases/tags/${tag}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ force: boolean; token: string; version: string; }} opts
|
||||
* @param {string} assetName
|
||||
* @param {string} downloadFolder
|
||||
*/
|
||||
async function getAssetFromGithubApi(opts, assetName, downloadFolder) {
|
||||
const assetDownloadPath = path.join(downloadFolder, assetName);
|
||||
|
||||
// We can just use the cached binary
|
||||
if (!opts.force && await fsExists(assetDownloadPath)) {
|
||||
console.log('Using cached download: ' + assetDownloadPath);
|
||||
return assetDownloadPath;
|
||||
}
|
||||
|
||||
const downloadOpts = {
|
||||
headers: {
|
||||
'user-agent': 'vscode-ripgrep'
|
||||
}
|
||||
};
|
||||
|
||||
if (opts.token) {
|
||||
downloadOpts.headers.authorization = `token ${opts.token}`;
|
||||
}
|
||||
|
||||
console.log(`Finding release for ${opts.version}`);
|
||||
const release = await get(getApiUrl(REPO, opts.version), downloadOpts);
|
||||
let jsonRelease;
|
||||
try {
|
||||
jsonRelease = JSON.parse(release);
|
||||
} catch (e) {
|
||||
throw new Error('Malformed API response: ' + e.stack);
|
||||
}
|
||||
|
||||
if (!jsonRelease.assets) {
|
||||
throw new Error('Bad API response: ' + JSON.stringify(release));
|
||||
}
|
||||
|
||||
const asset = jsonRelease.assets.find(a => a.name === assetName);
|
||||
if (!asset) {
|
||||
throw new Error('Asset not found with name: ' + assetName);
|
||||
}
|
||||
|
||||
console.log(`Downloading from ${asset.url}`);
|
||||
console.log(`Downloading to ${assetDownloadPath}`);
|
||||
|
||||
downloadOpts.headers.accept = 'application/octet-stream';
|
||||
await download(asset.url, assetDownloadPath, downloadOpts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} zipPath
|
||||
* @param {string} destinationDir
|
||||
*/
|
||||
function unzipWindows(zipPath, destinationDir) {
|
||||
// code from https://stackoverflow.com/questions/63932027/how-to-unzip-to-a-folder-using-yauzl
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
// Create folder if not exists
|
||||
fs.promises.mkdir(path.dirname(destinationDir), { recursive: true });
|
||||
|
||||
// Same as example we open the zip.
|
||||
yauzl.open(zipPath, { lazyEntries: true }, (err, zipFile) => {
|
||||
if (err) {
|
||||
zipFile.close();
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
// This is the key. We start by reading the first entry.
|
||||
zipFile.readEntry();
|
||||
|
||||
// Now for every entry, we will write a file or dir
|
||||
// to disk. Then call zipFile.readEntry() again to
|
||||
// trigger the next cycle.
|
||||
zipFile.on('entry', (entry) => {
|
||||
try {
|
||||
// Directories
|
||||
if (/\/$/.test(entry.fileName)) {
|
||||
// Create the directory then read the next entry.
|
||||
fs.promises.mkdir(path.join(destinationDir, entry.fileName), { recursive: true });
|
||||
zipFile.readEntry();
|
||||
}
|
||||
// Files
|
||||
else {
|
||||
// Write the file to disk.
|
||||
zipFile.openReadStream(entry, (readErr, readStream) => {
|
||||
if (readErr) {
|
||||
zipFile.close();
|
||||
reject(readErr);
|
||||
return;
|
||||
}
|
||||
|
||||
const file = fs.createWriteStream(path.join(destinationDir, entry.fileName));
|
||||
readStream.pipe(file);
|
||||
file.on('finish', () => {
|
||||
// Wait until the file is finished writing, then read the next entry.
|
||||
// @ts-ignore: Typing for close() is wrong.
|
||||
file.close(() => {
|
||||
zipFile.readEntry();
|
||||
});
|
||||
|
||||
file.on('error', (err) => {
|
||||
zipFile.close();
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
zipFile.close();
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
zipFile.on('end', (err) => {
|
||||
resolve();
|
||||
});
|
||||
zipFile.on('error', (err) => {
|
||||
zipFile.close();
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle whitespace in filepath as powershell splits path with whitespaces
|
||||
* @param {string} path
|
||||
*/
|
||||
function sanitizePathForPowershell(path) {
|
||||
path = path.replace(/ /g, '` '); // replace whitespace with "` " as solution provided here https://stackoverflow.com/a/18537344/7374562
|
||||
return path;
|
||||
}
|
||||
|
||||
function untar(zipPath, destinationDir) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const unzipProc = child_process.spawn('tar', ['xvf', zipPath, '-C', destinationDir], { stdio: 'inherit' });
|
||||
unzipProc.on('error', err => {
|
||||
reject(err);
|
||||
});
|
||||
unzipProc.on('close', code => {
|
||||
console.log(`tar xvf exited with ${code}`);
|
||||
if (code !== 0) {
|
||||
reject(new Error(`tar xvf exited with ${code}`));
|
||||
return;
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} zipPath
|
||||
* @param {string} destinationDir
|
||||
*/
|
||||
async function unzipRipgrep(zipPath, destinationDir) {
|
||||
if (isWindows) {
|
||||
await unzipWindows(zipPath, destinationDir);
|
||||
} else {
|
||||
await untar(zipPath, destinationDir);
|
||||
}
|
||||
|
||||
const expectedName = path.join(destinationDir, 'rg');
|
||||
if (await fsExists(expectedName)) {
|
||||
return expectedName;
|
||||
}
|
||||
|
||||
if (await fsExists(expectedName + '.exe')) {
|
||||
return expectedName + '.exe';
|
||||
}
|
||||
|
||||
throw new Error(`Expecting rg or rg.exe unzipped into ${destinationDir}, didn't find one.`);
|
||||
}
|
||||
|
||||
module.exports = async opts => {
|
||||
if (!opts.version) {
|
||||
return Promise.reject(new Error('Missing version'));
|
||||
}
|
||||
|
||||
if (!opts.target) {
|
||||
return Promise.reject(new Error('Missing target'));
|
||||
}
|
||||
|
||||
const extension = isWindows ? '.zip' : '.tar.gz';
|
||||
const assetName = ['ripgrep', opts.version, opts.target].join('-') + extension;
|
||||
|
||||
if (!await fsExists(tmpDir)) {
|
||||
await fsMkdir(tmpDir);
|
||||
}
|
||||
|
||||
const assetDownloadPath = path.join(tmpDir, assetName);
|
||||
try {
|
||||
await getAssetFromGithubApi(opts, assetName, tmpDir)
|
||||
} catch (e) {
|
||||
console.log('Deleting invalid download cache');
|
||||
try {
|
||||
await fsUnlink(assetDownloadPath);
|
||||
} catch (e) { }
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
console.log(`Unzipping to ${opts.destDir}`);
|
||||
try {
|
||||
const destinationPath = await unzipRipgrep(assetDownloadPath, opts.destDir);
|
||||
if (!isWindows) {
|
||||
await util.promisify(fs.chmod)(destinationPath, '755');
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Deleting invalid download');
|
||||
|
||||
try {
|
||||
await fsUnlink(assetDownloadPath);
|
||||
} catch (e) { }
|
||||
|
||||
throw e;
|
||||
}
|
||||
};
|
5
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/lib/index.js
generated
vendored
Normal file
5
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
module.exports.rgPath = path.join(__dirname, `../bin/rg${process.platform === 'win32' ? '.exe' : ''}`);
|
79
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/lib/postinstall.js
generated
vendored
Normal file
79
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/lib/postinstall.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
// @ts-check
|
||||
'use strict';
|
||||
|
||||
const os = require('os');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
const child_process = require('child_process');
|
||||
|
||||
const download = require('./download');
|
||||
|
||||
const fsExists = util.promisify(fs.exists);
|
||||
const mkdir = util.promisify(fs.mkdir);
|
||||
const exec = util.promisify(child_process.exec);
|
||||
|
||||
const forceInstall = process.argv.includes('--force');
|
||||
if (forceInstall) {
|
||||
console.log('--force, ignoring caches');
|
||||
}
|
||||
|
||||
const VERSION = 'v13.0.0-10';
|
||||
const MULTI_ARCH_LINUX_VERSION = 'v13.0.0-4';// use this for arm-unknown-linux-gnueabihf and powerpc64le-unknown-linux-gnu until we can fix https://github.com/microsoft/ripgrep-prebuilt/issues/24 and https://github.com/microsoft/ripgrep-prebuilt/issues/32 respectively.
|
||||
const BIN_PATH = path.join(__dirname, '../bin');
|
||||
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
console.log('Unhandled rejection: ', promise, 'reason:', reason);
|
||||
});
|
||||
|
||||
async function getTarget() {
|
||||
const arch = process.env.npm_config_arch || os.arch();
|
||||
|
||||
switch (os.platform()) {
|
||||
case 'darwin':
|
||||
return arch === 'arm64' ? 'aarch64-apple-darwin' :
|
||||
'x86_64-apple-darwin';
|
||||
case 'win32':
|
||||
return arch === 'x64' ? 'x86_64-pc-windows-msvc' :
|
||||
arch === 'arm' ? 'aarch64-pc-windows-msvc' :
|
||||
'i686-pc-windows-msvc';
|
||||
case 'linux':
|
||||
return arch === 'x64' ? 'x86_64-unknown-linux-musl' :
|
||||
arch === 'arm' ? 'arm-unknown-linux-gnueabihf' :
|
||||
arch === 'armv7l' ? 'arm-unknown-linux-gnueabihf' :
|
||||
arch === 'arm64' ? 'aarch64-unknown-linux-musl':
|
||||
arch === 'ppc64' ? 'powerpc64le-unknown-linux-gnu' :
|
||||
arch === 's390x' ? 's390x-unknown-linux-gnu' :
|
||||
'i686-unknown-linux-musl'
|
||||
default: throw new Error('Unknown platform: ' + os.platform());
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const binExists = await fsExists(BIN_PATH);
|
||||
if (!forceInstall && binExists) {
|
||||
console.log('bin/ folder already exists, exiting');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!binExists) {
|
||||
await mkdir(BIN_PATH);
|
||||
}
|
||||
|
||||
const target = await getTarget();
|
||||
const opts = {
|
||||
version: target === "arm-unknown-linux-gnueabihf" || target === "powerpc64le-unknown-linux-gnu" || target === "s390x-unknown-linux-gnu" ? MULTI_ARCH_LINUX_VERSION: VERSION,
|
||||
token: process.env['GITHUB_TOKEN'],
|
||||
target: await getTarget(),
|
||||
destDir: BIN_PATH,
|
||||
force: forceInstall
|
||||
};
|
||||
try {
|
||||
await download(opts);
|
||||
} catch (err) {
|
||||
console.error(`Downloading ripgrep failed: ${err.stack}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
21
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/node_modules/yauzl/LICENSE
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/node_modules/yauzl/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Josh Wolfe
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
796
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/node_modules/yauzl/index.js
generated
vendored
Normal file
796
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/node_modules/yauzl/index.js
generated
vendored
Normal file
@ -0,0 +1,796 @@
|
||||
var fs = require("fs");
|
||||
var zlib = require("zlib");
|
||||
var fd_slicer = require("fd-slicer");
|
||||
var crc32 = require("buffer-crc32");
|
||||
var util = require("util");
|
||||
var EventEmitter = require("events").EventEmitter;
|
||||
var Transform = require("stream").Transform;
|
||||
var PassThrough = require("stream").PassThrough;
|
||||
var Writable = require("stream").Writable;
|
||||
|
||||
exports.open = open;
|
||||
exports.fromFd = fromFd;
|
||||
exports.fromBuffer = fromBuffer;
|
||||
exports.fromRandomAccessReader = fromRandomAccessReader;
|
||||
exports.dosDateTimeToDate = dosDateTimeToDate;
|
||||
exports.validateFileName = validateFileName;
|
||||
exports.ZipFile = ZipFile;
|
||||
exports.Entry = Entry;
|
||||
exports.RandomAccessReader = RandomAccessReader;
|
||||
|
||||
function open(path, options, callback) {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
if (options == null) options = {};
|
||||
if (options.autoClose == null) options.autoClose = true;
|
||||
if (options.lazyEntries == null) options.lazyEntries = false;
|
||||
if (options.decodeStrings == null) options.decodeStrings = true;
|
||||
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
||||
if (options.strictFileNames == null) options.strictFileNames = false;
|
||||
if (callback == null) callback = defaultCallback;
|
||||
fs.open(path, "r", function(err, fd) {
|
||||
if (err) return callback(err);
|
||||
fromFd(fd, options, function(err, zipfile) {
|
||||
if (err) fs.close(fd, defaultCallback);
|
||||
callback(err, zipfile);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function fromFd(fd, options, callback) {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
if (options == null) options = {};
|
||||
if (options.autoClose == null) options.autoClose = false;
|
||||
if (options.lazyEntries == null) options.lazyEntries = false;
|
||||
if (options.decodeStrings == null) options.decodeStrings = true;
|
||||
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
||||
if (options.strictFileNames == null) options.strictFileNames = false;
|
||||
if (callback == null) callback = defaultCallback;
|
||||
fs.fstat(fd, function(err, stats) {
|
||||
if (err) return callback(err);
|
||||
var reader = fd_slicer.createFromFd(fd, {autoClose: true});
|
||||
fromRandomAccessReader(reader, stats.size, options, callback);
|
||||
});
|
||||
}
|
||||
|
||||
function fromBuffer(buffer, options, callback) {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
if (options == null) options = {};
|
||||
options.autoClose = false;
|
||||
if (options.lazyEntries == null) options.lazyEntries = false;
|
||||
if (options.decodeStrings == null) options.decodeStrings = true;
|
||||
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
||||
if (options.strictFileNames == null) options.strictFileNames = false;
|
||||
// limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87
|
||||
var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000});
|
||||
fromRandomAccessReader(reader, buffer.length, options, callback);
|
||||
}
|
||||
|
||||
function fromRandomAccessReader(reader, totalSize, options, callback) {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
if (options == null) options = {};
|
||||
if (options.autoClose == null) options.autoClose = true;
|
||||
if (options.lazyEntries == null) options.lazyEntries = false;
|
||||
if (options.decodeStrings == null) options.decodeStrings = true;
|
||||
var decodeStrings = !!options.decodeStrings;
|
||||
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
||||
if (options.strictFileNames == null) options.strictFileNames = false;
|
||||
if (callback == null) callback = defaultCallback;
|
||||
if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
|
||||
if (totalSize > Number.MAX_SAFE_INTEGER) {
|
||||
throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
|
||||
}
|
||||
|
||||
// the matching unref() call is in zipfile.close()
|
||||
reader.ref();
|
||||
|
||||
// eocdr means End of Central Directory Record.
|
||||
// search backwards for the eocdr signature.
|
||||
// the last field of the eocdr is a variable-length comment.
|
||||
// the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it.
|
||||
// as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment.
|
||||
// we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment.
|
||||
var eocdrWithoutCommentSize = 22;
|
||||
var maxCommentSize = 0xffff; // 2-byte size
|
||||
var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);
|
||||
var buffer = newBuffer(bufferSize);
|
||||
var bufferReadStart = totalSize - buffer.length;
|
||||
readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
|
||||
if (err) return callback(err);
|
||||
for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
|
||||
if (buffer.readUInt32LE(i) !== 0x06054b50) continue;
|
||||
// found eocdr
|
||||
var eocdrBuffer = buffer.slice(i);
|
||||
|
||||
// 0 - End of central directory signature = 0x06054b50
|
||||
// 4 - Number of this disk
|
||||
var diskNumber = eocdrBuffer.readUInt16LE(4);
|
||||
if (diskNumber !== 0) {
|
||||
return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
|
||||
}
|
||||
// 6 - Disk where central directory starts
|
||||
// 8 - Number of central directory records on this disk
|
||||
// 10 - Total number of central directory records
|
||||
var entryCount = eocdrBuffer.readUInt16LE(10);
|
||||
// 12 - Size of central directory (bytes)
|
||||
// 16 - Offset of start of central directory, relative to start of archive
|
||||
var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
|
||||
// 20 - Comment length
|
||||
var commentLength = eocdrBuffer.readUInt16LE(20);
|
||||
var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
|
||||
if (commentLength !== expectedCommentLength) {
|
||||
return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength));
|
||||
}
|
||||
// 22 - Comment
|
||||
// the encoding is always cp437.
|
||||
var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false)
|
||||
: eocdrBuffer.slice(22);
|
||||
|
||||
if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) {
|
||||
return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
|
||||
}
|
||||
|
||||
// ZIP64 format
|
||||
|
||||
// ZIP64 Zip64 end of central directory locator
|
||||
var zip64EocdlBuffer = newBuffer(20);
|
||||
var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;
|
||||
readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) {
|
||||
if (err) return callback(err);
|
||||
|
||||
// 0 - zip64 end of central dir locator signature = 0x07064b50
|
||||
if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) {
|
||||
return callback(new Error("invalid zip64 end of central directory locator signature"));
|
||||
}
|
||||
// 4 - number of the disk with the start of the zip64 end of central directory
|
||||
// 8 - relative offset of the zip64 end of central directory record
|
||||
var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
|
||||
// 16 - total number of disks
|
||||
|
||||
// ZIP64 end of central directory record
|
||||
var zip64EocdrBuffer = newBuffer(56);
|
||||
readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {
|
||||
if (err) return callback(err);
|
||||
|
||||
// 0 - zip64 end of central dir signature 4 bytes (0x06064b50)
|
||||
if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) {
|
||||
return callback(new Error("invalid zip64 end of central directory record signature"));
|
||||
}
|
||||
// 4 - size of zip64 end of central directory record 8 bytes
|
||||
// 12 - version made by 2 bytes
|
||||
// 14 - version needed to extract 2 bytes
|
||||
// 16 - number of this disk 4 bytes
|
||||
// 20 - number of the disk with the start of the central directory 4 bytes
|
||||
// 24 - total number of entries in the central directory on this disk 8 bytes
|
||||
// 32 - total number of entries in the central directory 8 bytes
|
||||
entryCount = readUInt64LE(zip64EocdrBuffer, 32);
|
||||
// 40 - size of the central directory 8 bytes
|
||||
// 48 - offset of start of central directory with respect to the starting disk number 8 bytes
|
||||
centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
|
||||
// 56 - zip64 extensible data sector (variable size)
|
||||
return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
callback(new Error("end of central directory record signature not found"));
|
||||
});
|
||||
}
|
||||
|
||||
util.inherits(ZipFile, EventEmitter);
|
||||
function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
||||
var self = this;
|
||||
EventEmitter.call(self);
|
||||
self.reader = reader;
|
||||
// forward close events
|
||||
self.reader.on("error", function(err) {
|
||||
// error closing the fd
|
||||
emitError(self, err);
|
||||
});
|
||||
self.reader.once("close", function() {
|
||||
self.emit("close");
|
||||
});
|
||||
self.readEntryCursor = centralDirectoryOffset;
|
||||
self.fileSize = fileSize;
|
||||
self.entryCount = entryCount;
|
||||
self.comment = comment;
|
||||
self.entriesRead = 0;
|
||||
self.autoClose = !!autoClose;
|
||||
self.lazyEntries = !!lazyEntries;
|
||||
self.decodeStrings = !!decodeStrings;
|
||||
self.validateEntrySizes = !!validateEntrySizes;
|
||||
self.strictFileNames = !!strictFileNames;
|
||||
self.isOpen = true;
|
||||
self.emittedError = false;
|
||||
|
||||
if (!self.lazyEntries) self._readEntry();
|
||||
}
|
||||
ZipFile.prototype.close = function() {
|
||||
if (!this.isOpen) return;
|
||||
this.isOpen = false;
|
||||
this.reader.unref();
|
||||
};
|
||||
|
||||
function emitErrorAndAutoClose(self, err) {
|
||||
if (self.autoClose) self.close();
|
||||
emitError(self, err);
|
||||
}
|
||||
function emitError(self, err) {
|
||||
if (self.emittedError) return;
|
||||
self.emittedError = true;
|
||||
self.emit("error", err);
|
||||
}
|
||||
|
||||
ZipFile.prototype.readEntry = function() {
|
||||
if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
|
||||
this._readEntry();
|
||||
};
|
||||
ZipFile.prototype._readEntry = function() {
|
||||
var self = this;
|
||||
if (self.entryCount === self.entriesRead) {
|
||||
// done with metadata
|
||||
setImmediate(function() {
|
||||
if (self.autoClose) self.close();
|
||||
if (self.emittedError) return;
|
||||
self.emit("end");
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (self.emittedError) return;
|
||||
var buffer = newBuffer(46);
|
||||
readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
|
||||
if (err) return emitErrorAndAutoClose(self, err);
|
||||
if (self.emittedError) return;
|
||||
var entry = new Entry();
|
||||
// 0 - Central directory file header signature
|
||||
var signature = buffer.readUInt32LE(0);
|
||||
if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
|
||||
// 4 - Version made by
|
||||
entry.versionMadeBy = buffer.readUInt16LE(4);
|
||||
// 6 - Version needed to extract (minimum)
|
||||
entry.versionNeededToExtract = buffer.readUInt16LE(6);
|
||||
// 8 - General purpose bit flag
|
||||
entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
|
||||
// 10 - Compression method
|
||||
entry.compressionMethod = buffer.readUInt16LE(10);
|
||||
// 12 - File last modification time
|
||||
entry.lastModFileTime = buffer.readUInt16LE(12);
|
||||
// 14 - File last modification date
|
||||
entry.lastModFileDate = buffer.readUInt16LE(14);
|
||||
// 16 - CRC-32
|
||||
entry.crc32 = buffer.readUInt32LE(16);
|
||||
// 20 - Compressed size
|
||||
entry.compressedSize = buffer.readUInt32LE(20);
|
||||
// 24 - Uncompressed size
|
||||
entry.uncompressedSize = buffer.readUInt32LE(24);
|
||||
// 28 - File name length (n)
|
||||
entry.fileNameLength = buffer.readUInt16LE(28);
|
||||
// 30 - Extra field length (m)
|
||||
entry.extraFieldLength = buffer.readUInt16LE(30);
|
||||
// 32 - File comment length (k)
|
||||
entry.fileCommentLength = buffer.readUInt16LE(32);
|
||||
// 34 - Disk number where file starts
|
||||
// 36 - Internal file attributes
|
||||
entry.internalFileAttributes = buffer.readUInt16LE(36);
|
||||
// 38 - External file attributes
|
||||
entry.externalFileAttributes = buffer.readUInt32LE(38);
|
||||
// 42 - Relative offset of local file header
|
||||
entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
|
||||
|
||||
if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
|
||||
|
||||
self.readEntryCursor += 46;
|
||||
|
||||
buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
|
||||
readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
|
||||
if (err) return emitErrorAndAutoClose(self, err);
|
||||
if (self.emittedError) return;
|
||||
// 46 - File name
|
||||
var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0;
|
||||
entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8)
|
||||
: buffer.slice(0, entry.fileNameLength);
|
||||
|
||||
// 46+n - Extra field
|
||||
var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
|
||||
var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
|
||||
entry.extraFields = [];
|
||||
var i = 0;
|
||||
while (i < extraFieldBuffer.length - 3) {
|
||||
var headerId = extraFieldBuffer.readUInt16LE(i + 0);
|
||||
var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
|
||||
var dataStart = i + 4;
|
||||
var dataEnd = dataStart + dataSize;
|
||||
if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size"));
|
||||
var dataBuffer = newBuffer(dataSize);
|
||||
extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);
|
||||
entry.extraFields.push({
|
||||
id: headerId,
|
||||
data: dataBuffer,
|
||||
});
|
||||
i = dataEnd;
|
||||
}
|
||||
|
||||
// 46+n+m - File comment
|
||||
entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8)
|
||||
: buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
|
||||
// compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47
|
||||
entry.comment = entry.fileComment;
|
||||
|
||||
self.readEntryCursor += buffer.length;
|
||||
self.entriesRead += 1;
|
||||
|
||||
if (entry.uncompressedSize === 0xffffffff ||
|
||||
entry.compressedSize === 0xffffffff ||
|
||||
entry.relativeOffsetOfLocalHeader === 0xffffffff) {
|
||||
// ZIP64 format
|
||||
// find the Zip64 Extended Information Extra Field
|
||||
var zip64EiefBuffer = null;
|
||||
for (var i = 0; i < entry.extraFields.length; i++) {
|
||||
var extraField = entry.extraFields[i];
|
||||
if (extraField.id === 0x0001) {
|
||||
zip64EiefBuffer = extraField.data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (zip64EiefBuffer == null) {
|
||||
return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field"));
|
||||
}
|
||||
var index = 0;
|
||||
// 0 - Original Size 8 bytes
|
||||
if (entry.uncompressedSize === 0xffffffff) {
|
||||
if (index + 8 > zip64EiefBuffer.length) {
|
||||
return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
|
||||
}
|
||||
entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
|
||||
index += 8;
|
||||
}
|
||||
// 8 - Compressed Size 8 bytes
|
||||
if (entry.compressedSize === 0xffffffff) {
|
||||
if (index + 8 > zip64EiefBuffer.length) {
|
||||
return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
|
||||
}
|
||||
entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
|
||||
index += 8;
|
||||
}
|
||||
// 16 - Relative Header Offset 8 bytes
|
||||
if (entry.relativeOffsetOfLocalHeader === 0xffffffff) {
|
||||
if (index + 8 > zip64EiefBuffer.length) {
|
||||
return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
|
||||
}
|
||||
entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
|
||||
index += 8;
|
||||
}
|
||||
// 24 - Disk Start Number 4 bytes
|
||||
}
|
||||
|
||||
// check for Info-ZIP Unicode Path Extra Field (0x7075)
|
||||
// see https://github.com/thejoshwolfe/yauzl/issues/33
|
||||
if (self.decodeStrings) {
|
||||
for (var i = 0; i < entry.extraFields.length; i++) {
|
||||
var extraField = entry.extraFields[i];
|
||||
if (extraField.id === 0x7075) {
|
||||
if (extraField.data.length < 6) {
|
||||
// too short to be meaningful
|
||||
continue;
|
||||
}
|
||||
// Version 1 byte version of this extra field, currently 1
|
||||
if (extraField.data.readUInt8(0) !== 1) {
|
||||
// > Changes may not be backward compatible so this extra
|
||||
// > field should not be used if the version is not recognized.
|
||||
continue;
|
||||
}
|
||||
// NameCRC32 4 bytes File Name Field CRC32 Checksum
|
||||
var oldNameCrc32 = extraField.data.readUInt32LE(1);
|
||||
if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {
|
||||
// > If the CRC check fails, this UTF-8 Path Extra Field should be
|
||||
// > ignored and the File Name field in the header should be used instead.
|
||||
continue;
|
||||
}
|
||||
// UnicodeName Variable UTF-8 version of the entry File Name
|
||||
entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// validate file size
|
||||
if (self.validateEntrySizes && entry.compressionMethod === 0) {
|
||||
var expectedCompressedSize = entry.uncompressedSize;
|
||||
if (entry.isEncrypted()) {
|
||||
// traditional encryption prefixes the file data with a header
|
||||
expectedCompressedSize += 12;
|
||||
}
|
||||
if (entry.compressedSize !== expectedCompressedSize) {
|
||||
var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
|
||||
return emitErrorAndAutoClose(self, new Error(msg));
|
||||
}
|
||||
}
|
||||
|
||||
if (self.decodeStrings) {
|
||||
if (!self.strictFileNames) {
|
||||
// allow backslash
|
||||
entry.fileName = entry.fileName.replace(/\\/g, "/");
|
||||
}
|
||||
var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);
|
||||
if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
|
||||
}
|
||||
self.emit("entry", entry);
|
||||
|
||||
if (!self.lazyEntries) self._readEntry();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
ZipFile.prototype.openReadStream = function(entry, options, callback) {
|
||||
var self = this;
|
||||
// parameter validation
|
||||
var relativeStart = 0;
|
||||
var relativeEnd = entry.compressedSize;
|
||||
if (callback == null) {
|
||||
callback = options;
|
||||
options = {};
|
||||
} else {
|
||||
// validate options that the caller has no excuse to get wrong
|
||||
if (options.decrypt != null) {
|
||||
if (!entry.isEncrypted()) {
|
||||
throw new Error("options.decrypt can only be specified for encrypted entries");
|
||||
}
|
||||
if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt);
|
||||
if (entry.isCompressed()) {
|
||||
if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false");
|
||||
}
|
||||
}
|
||||
if (options.decompress != null) {
|
||||
if (!entry.isCompressed()) {
|
||||
throw new Error("options.decompress can only be specified for compressed entries");
|
||||
}
|
||||
if (!(options.decompress === false || options.decompress === true)) {
|
||||
throw new Error("invalid options.decompress value: " + options.decompress);
|
||||
}
|
||||
}
|
||||
if (options.start != null || options.end != null) {
|
||||
if (entry.isCompressed() && options.decompress !== false) {
|
||||
throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
|
||||
}
|
||||
if (entry.isEncrypted() && options.decrypt !== false) {
|
||||
throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
|
||||
}
|
||||
}
|
||||
if (options.start != null) {
|
||||
relativeStart = options.start;
|
||||
if (relativeStart < 0) throw new Error("options.start < 0");
|
||||
if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
|
||||
}
|
||||
if (options.end != null) {
|
||||
relativeEnd = options.end;
|
||||
if (relativeEnd < 0) throw new Error("options.end < 0");
|
||||
if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
|
||||
if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
|
||||
}
|
||||
}
|
||||
// any further errors can either be caused by the zipfile,
|
||||
// or were introduced in a minor version of yauzl,
|
||||
// so should be passed to the client rather than thrown.
|
||||
if (!self.isOpen) return callback(new Error("closed"));
|
||||
if (entry.isEncrypted()) {
|
||||
if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false"));
|
||||
}
|
||||
// make sure we don't lose the fd before we open the actual read stream
|
||||
self.reader.ref();
|
||||
var buffer = newBuffer(30);
|
||||
readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
|
||||
try {
|
||||
if (err) return callback(err);
|
||||
// 0 - Local file header signature = 0x04034b50
|
||||
var signature = buffer.readUInt32LE(0);
|
||||
if (signature !== 0x04034b50) {
|
||||
return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
|
||||
}
|
||||
// all this should be redundant
|
||||
// 4 - Version needed to extract (minimum)
|
||||
// 6 - General purpose bit flag
|
||||
// 8 - Compression method
|
||||
// 10 - File last modification time
|
||||
// 12 - File last modification date
|
||||
// 14 - CRC-32
|
||||
// 18 - Compressed size
|
||||
// 22 - Uncompressed size
|
||||
// 26 - File name length (n)
|
||||
var fileNameLength = buffer.readUInt16LE(26);
|
||||
// 28 - Extra field length (m)
|
||||
var extraFieldLength = buffer.readUInt16LE(28);
|
||||
// 30 - File name
|
||||
// 30+n - Extra field
|
||||
var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;
|
||||
var decompress;
|
||||
if (entry.compressionMethod === 0) {
|
||||
// 0 - The file is stored (no compression)
|
||||
decompress = false;
|
||||
} else if (entry.compressionMethod === 8) {
|
||||
// 8 - The file is Deflated
|
||||
decompress = options.decompress != null ? options.decompress : true;
|
||||
} else {
|
||||
return callback(new Error("unsupported compression method: " + entry.compressionMethod));
|
||||
}
|
||||
var fileDataStart = localFileHeaderEnd;
|
||||
var fileDataEnd = fileDataStart + entry.compressedSize;
|
||||
if (entry.compressedSize !== 0) {
|
||||
// bounds check now, because the read streams will probably not complain loud enough.
|
||||
// since we're dealing with an unsigned offset plus an unsigned size,
|
||||
// we only have 1 thing to check for.
|
||||
if (fileDataEnd > self.fileSize) {
|
||||
return callback(new Error("file data overflows file bounds: " +
|
||||
fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
|
||||
}
|
||||
}
|
||||
var readStream = self.reader.createReadStream({
|
||||
start: fileDataStart + relativeStart,
|
||||
end: fileDataStart + relativeEnd,
|
||||
});
|
||||
var endpointStream = readStream;
|
||||
if (decompress) {
|
||||
var destroyed = false;
|
||||
var inflateFilter = zlib.createInflateRaw();
|
||||
readStream.on("error", function(err) {
|
||||
// setImmediate here because errors can be emitted during the first call to pipe()
|
||||
setImmediate(function() {
|
||||
if (!destroyed) inflateFilter.emit("error", err);
|
||||
});
|
||||
});
|
||||
readStream.pipe(inflateFilter);
|
||||
|
||||
if (self.validateEntrySizes) {
|
||||
endpointStream = new AssertByteCountStream(entry.uncompressedSize);
|
||||
inflateFilter.on("error", function(err) {
|
||||
// forward zlib errors to the client-visible stream
|
||||
setImmediate(function() {
|
||||
if (!destroyed) endpointStream.emit("error", err);
|
||||
});
|
||||
});
|
||||
inflateFilter.pipe(endpointStream);
|
||||
} else {
|
||||
// the zlib filter is the client-visible stream
|
||||
endpointStream = inflateFilter;
|
||||
}
|
||||
// this is part of yauzl's API, so implement this function on the client-visible stream
|
||||
endpointStream.destroy = function() {
|
||||
destroyed = true;
|
||||
if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
|
||||
readStream.unpipe(inflateFilter);
|
||||
// TODO: the inflateFilter may cause a memory leak. see Issue #27.
|
||||
readStream.destroy();
|
||||
};
|
||||
}
|
||||
callback(null, endpointStream);
|
||||
} finally {
|
||||
self.reader.unref();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function Entry() {
|
||||
}
|
||||
Entry.prototype.getLastModDate = function() {
|
||||
return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
|
||||
};
|
||||
Entry.prototype.isEncrypted = function() {
|
||||
return (this.generalPurposeBitFlag & 0x1) !== 0;
|
||||
};
|
||||
Entry.prototype.isCompressed = function() {
|
||||
return this.compressionMethod === 8;
|
||||
};
|
||||
|
||||
function dosDateTimeToDate(date, time) {
|
||||
var day = date & 0x1f; // 1-31
|
||||
var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11
|
||||
var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108
|
||||
|
||||
var millisecond = 0;
|
||||
var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)
|
||||
var minute = time >> 5 & 0x3f; // 0-59
|
||||
var hour = time >> 11 & 0x1f; // 0-23
|
||||
|
||||
return new Date(year, month, day, hour, minute, second, millisecond);
|
||||
}
|
||||
|
||||
function validateFileName(fileName) {
|
||||
if (fileName.indexOf("\\") !== -1) {
|
||||
return "invalid characters in fileName: " + fileName;
|
||||
}
|
||||
if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
|
||||
return "absolute path: " + fileName;
|
||||
}
|
||||
if (fileName.split("/").indexOf("..") !== -1) {
|
||||
return "invalid relative path: " + fileName;
|
||||
}
|
||||
// all good
|
||||
return null;
|
||||
}
|
||||
|
||||
function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
|
||||
if (length === 0) {
|
||||
// fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file
|
||||
return setImmediate(function() { callback(null, newBuffer(0)); });
|
||||
}
|
||||
reader.read(buffer, offset, length, position, function(err, bytesRead) {
|
||||
if (err) return callback(err);
|
||||
if (bytesRead < length) {
|
||||
return callback(new Error("unexpected EOF"));
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
util.inherits(AssertByteCountStream, Transform);
|
||||
function AssertByteCountStream(byteCount) {
|
||||
Transform.call(this);
|
||||
this.actualByteCount = 0;
|
||||
this.expectedByteCount = byteCount;
|
||||
}
|
||||
AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
|
||||
this.actualByteCount += chunk.length;
|
||||
if (this.actualByteCount > this.expectedByteCount) {
|
||||
var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
|
||||
return cb(new Error(msg));
|
||||
}
|
||||
cb(null, chunk);
|
||||
};
|
||||
AssertByteCountStream.prototype._flush = function(cb) {
|
||||
if (this.actualByteCount < this.expectedByteCount) {
|
||||
var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
|
||||
return cb(new Error(msg));
|
||||
}
|
||||
cb();
|
||||
};
|
||||
|
||||
util.inherits(RandomAccessReader, EventEmitter);
|
||||
function RandomAccessReader() {
|
||||
EventEmitter.call(this);
|
||||
this.refCount = 0;
|
||||
}
|
||||
RandomAccessReader.prototype.ref = function() {
|
||||
this.refCount += 1;
|
||||
};
|
||||
RandomAccessReader.prototype.unref = function() {
|
||||
var self = this;
|
||||
self.refCount -= 1;
|
||||
|
||||
if (self.refCount > 0) return;
|
||||
if (self.refCount < 0) throw new Error("invalid unref");
|
||||
|
||||
self.close(onCloseDone);
|
||||
|
||||
function onCloseDone(err) {
|
||||
if (err) return self.emit('error', err);
|
||||
self.emit('close');
|
||||
}
|
||||
};
|
||||
RandomAccessReader.prototype.createReadStream = function(options) {
|
||||
var start = options.start;
|
||||
var end = options.end;
|
||||
if (start === end) {
|
||||
var emptyStream = new PassThrough();
|
||||
setImmediate(function() {
|
||||
emptyStream.end();
|
||||
});
|
||||
return emptyStream;
|
||||
}
|
||||
var stream = this._readStreamForRange(start, end);
|
||||
|
||||
var destroyed = false;
|
||||
var refUnrefFilter = new RefUnrefFilter(this);
|
||||
stream.on("error", function(err) {
|
||||
setImmediate(function() {
|
||||
if (!destroyed) refUnrefFilter.emit("error", err);
|
||||
});
|
||||
});
|
||||
refUnrefFilter.destroy = function() {
|
||||
stream.unpipe(refUnrefFilter);
|
||||
refUnrefFilter.unref();
|
||||
stream.destroy();
|
||||
};
|
||||
|
||||
var byteCounter = new AssertByteCountStream(end - start);
|
||||
refUnrefFilter.on("error", function(err) {
|
||||
setImmediate(function() {
|
||||
if (!destroyed) byteCounter.emit("error", err);
|
||||
});
|
||||
});
|
||||
byteCounter.destroy = function() {
|
||||
destroyed = true;
|
||||
refUnrefFilter.unpipe(byteCounter);
|
||||
refUnrefFilter.destroy();
|
||||
};
|
||||
|
||||
return stream.pipe(refUnrefFilter).pipe(byteCounter);
|
||||
};
|
||||
RandomAccessReader.prototype._readStreamForRange = function(start, end) {
|
||||
throw new Error("not implemented");
|
||||
};
|
||||
RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
|
||||
var readStream = this.createReadStream({start: position, end: position + length});
|
||||
var writeStream = new Writable();
|
||||
var written = 0;
|
||||
writeStream._write = function(chunk, encoding, cb) {
|
||||
chunk.copy(buffer, offset + written, 0, chunk.length);
|
||||
written += chunk.length;
|
||||
cb();
|
||||
};
|
||||
writeStream.on("finish", callback);
|
||||
readStream.on("error", function(error) {
|
||||
callback(error);
|
||||
});
|
||||
readStream.pipe(writeStream);
|
||||
};
|
||||
RandomAccessReader.prototype.close = function(callback) {
|
||||
setImmediate(callback);
|
||||
};
|
||||
|
||||
util.inherits(RefUnrefFilter, PassThrough);
|
||||
function RefUnrefFilter(context) {
|
||||
PassThrough.call(this);
|
||||
this.context = context;
|
||||
this.context.ref();
|
||||
this.unreffedYet = false;
|
||||
}
|
||||
RefUnrefFilter.prototype._flush = function(cb) {
|
||||
this.unref();
|
||||
cb();
|
||||
};
|
||||
RefUnrefFilter.prototype.unref = function(cb) {
|
||||
if (this.unreffedYet) return;
|
||||
this.unreffedYet = true;
|
||||
this.context.unref();
|
||||
};
|
||||
|
||||
var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';
|
||||
function decodeBuffer(buffer, start, end, isUtf8) {
|
||||
if (isUtf8) {
|
||||
return buffer.toString("utf8", start, end);
|
||||
} else {
|
||||
var result = "";
|
||||
for (var i = start; i < end; i++) {
|
||||
result += cp437[buffer[i]];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function readUInt64LE(buffer, offset) {
|
||||
// there is no native function for this, because we can't actually store 64-bit integers precisely.
|
||||
// after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore.
|
||||
// but since 53 bits is a whole lot more than 32 bits, we do our best anyway.
|
||||
var lower32 = buffer.readUInt32LE(offset);
|
||||
var upper32 = buffer.readUInt32LE(offset + 4);
|
||||
// we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers.
|
||||
return upper32 * 0x100000000 + lower32;
|
||||
// as long as we're bounds checking the result of this function against the total file size,
|
||||
// we'll catch any overflow errors, because we already made sure the total file size was within reason.
|
||||
}
|
||||
|
||||
// Node 10 deprecated new Buffer().
|
||||
var newBuffer;
|
||||
if (typeof Buffer.allocUnsafe === "function") {
|
||||
newBuffer = function(len) {
|
||||
return Buffer.allocUnsafe(len);
|
||||
};
|
||||
} else {
|
||||
newBuffer = function(len) {
|
||||
return new Buffer(len);
|
||||
};
|
||||
}
|
||||
|
||||
function defaultCallback(err) {
|
||||
if (err) throw err;
|
||||
}
|
40
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/node_modules/yauzl/package.json
generated
vendored
Normal file
40
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/node_modules/yauzl/package.json
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "yauzl",
|
||||
"version": "2.10.0",
|
||||
"description": "yet another unzip library for node",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "node test/test.js",
|
||||
"test-cov": "istanbul cover test/test.js",
|
||||
"test-travis": "istanbul cover --report lcovonly test/test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thejoshwolfe/yauzl.git"
|
||||
},
|
||||
"keywords": [
|
||||
"unzip",
|
||||
"zip",
|
||||
"stream",
|
||||
"archive",
|
||||
"file"
|
||||
],
|
||||
"author": "Josh Wolfe <thejoshwolfe@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/thejoshwolfe/yauzl/issues"
|
||||
},
|
||||
"homepage": "https://github.com/thejoshwolfe/yauzl",
|
||||
"dependencies": {
|
||||
"fd-slicer": "~1.1.0",
|
||||
"buffer-crc32": "~0.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bl": "~1.0.0",
|
||||
"istanbul": "~0.3.4",
|
||||
"pend": "~1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
]
|
||||
}
|
24
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/package.json
generated
vendored
Normal file
24
vscode-server-linux-x64-web/node_modules/@vscode/ripgrep/package.json
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@vscode/ripgrep",
|
||||
"version": "1.15.9",
|
||||
"description": "A module for using ripgrep in a Node project",
|
||||
"main": "lib/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/vscode-ripgrep"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./lib/postinstall.js"
|
||||
},
|
||||
"author": "Rob Lourens",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"yauzl": "^2.9.2",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.4"
|
||||
}
|
||||
}
|
21
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/LICENSE
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
41
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
15
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/azure-pipelines/build.yml
generated
vendored
Normal file
15
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/azure-pipelines/build.yml
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "18.x"
|
||||
|
||||
- powershell: |
|
||||
git submodule update --init
|
||||
$env:npm_config_arch="$(NPM_ARCH)"
|
||||
npm install
|
||||
displayName: Install Dependencies
|
||||
|
||||
- powershell: |
|
||||
npm test
|
||||
displayName: Run Tests
|
||||
condition: eq(variables.NPM_ARCH, 'x64')
|
30
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/azure-pipelines/ci.yml
generated
vendored
Normal file
30
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/azure-pipelines/ci.yml
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
trigger:
|
||||
branches:
|
||||
include: ['*']
|
||||
tags:
|
||||
include: ['*']
|
||||
|
||||
jobs:
|
||||
- job: Windows
|
||||
pool:
|
||||
vmImage: 'windows-latest'
|
||||
variables:
|
||||
NPM_ARCH: 'x64'
|
||||
steps:
|
||||
- template: build.yml
|
||||
|
||||
- job: macOS
|
||||
pool:
|
||||
vmImage: 'macOS-latest'
|
||||
variables:
|
||||
NPM_ARCH: 'x64'
|
||||
steps:
|
||||
- template: build.yml
|
||||
|
||||
- job: Linux
|
||||
pool:
|
||||
vmImage: 'Ubuntu-latest'
|
||||
variables:
|
||||
NPM_ARCH: 'x64'
|
||||
steps:
|
||||
- template: build.yml
|
55
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/azure-pipelines/publish.yml
generated
vendored
Normal file
55
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/azure-pipelines/publish.yml
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
name: $(Date:yyyyMMdd)$(Rev:.r)
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
pr: none
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: github
|
||||
name: microsoft/vscode-engineering
|
||||
ref: main
|
||||
endpoint: Monaco
|
||||
|
||||
parameters:
|
||||
- name: publishPackage
|
||||
displayName: 🚀 Publish node-spdlog
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/npm-package/pipeline.yml@templates
|
||||
parameters:
|
||||
npmPackages:
|
||||
- name: node-spdlog
|
||||
|
||||
buildSteps:
|
||||
- script: |
|
||||
git submodule update --init
|
||||
npm ci
|
||||
displayName: Install dependencies
|
||||
|
||||
testPlatforms:
|
||||
- name: Linux
|
||||
nodeVersions:
|
||||
- 18.x
|
||||
- name: MacOS
|
||||
nodeVersions:
|
||||
- 18.x
|
||||
- name: Windows
|
||||
nodeVersions:
|
||||
- 18.x
|
||||
|
||||
testSteps:
|
||||
- script: |
|
||||
git submodule update --init
|
||||
npm ci
|
||||
displayName: Install dependencies
|
||||
|
||||
- script: npm run test
|
||||
displayName: Compile & test npm package
|
||||
|
||||
publishPackage: ${{ parameters.publishPackage }}
|
BIN
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/build/Release/spdlog.node
generated
vendored
Executable file
BIN
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/build/Release/spdlog.node
generated
vendored
Executable file
Binary file not shown.
25
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/index.js
generated
vendored
Normal file
25
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/index.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
const path = require('path');
|
||||
const mkdirp = require('mkdirp');
|
||||
const spdlog = require('bindings')('spdlog');
|
||||
|
||||
exports.version = spdlog.version;
|
||||
exports.setLevel = spdlog.setLevel;
|
||||
exports.setFlushOn = spdlog.setFlushOn;
|
||||
exports.Logger = spdlog.Logger;
|
||||
|
||||
function createRotatingLogger(name, filepath, maxFileSize, maxFiles) {
|
||||
return createLogger('rotating', name, filepath, maxFileSize, maxFiles);
|
||||
}
|
||||
|
||||
function createAsyncRotatingLogger(name, filepath, maxFileSize, maxFiles) {
|
||||
return createLogger('rotating_async', name, filepath, maxFileSize, maxFiles);
|
||||
}
|
||||
|
||||
async function createLogger(loggerType, name, filepath, maxFileSize, maxFiles) {
|
||||
const dirname = path.dirname(filepath);
|
||||
await mkdirp(dirname);
|
||||
return new spdlog.Logger(loggerType, name, filepath, maxFileSize, maxFiles);
|
||||
}
|
||||
|
||||
exports.createRotatingLogger = createRotatingLogger;
|
||||
exports.createAsyncRotatingLogger = createAsyncRotatingLogger;
|
40
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/package.json
generated
vendored
Normal file
40
vscode-server-linux-x64-web/node_modules/@vscode/spdlog/package.json
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "@vscode/spdlog",
|
||||
"version": "0.15.0",
|
||||
"description": "Node bindings for spdlog",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"mocha": {
|
||||
"ui": "tdd"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/microsoft/node-spdlog.git"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"spdlog",
|
||||
"logging",
|
||||
"logger",
|
||||
"log"
|
||||
],
|
||||
"author": "Microsoft",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/microsoft/node-spdlog/issues"
|
||||
},
|
||||
"homepage": "https://github.com/microsoft/node-spdlog#readme",
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"mkdirp": "^1.0.4",
|
||||
"node-addon-api": "7.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^10.0.0",
|
||||
"@types/node": "^16.0.0",
|
||||
"mocha": "^10.1.0"
|
||||
}
|
||||
}
|
BIN
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/bin/vsce-sign
generated
vendored
Executable file
BIN
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/bin/vsce-sign
generated
vendored
Executable file
Binary file not shown.
31
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/package.json
generated
vendored
Normal file
31
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/package.json
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@vscode/vsce-sign",
|
||||
"description": "Visual Studio Code extension package signing and verification module",
|
||||
"version": "2.0.4",
|
||||
"author": {
|
||||
"name": "Microsoft"
|
||||
},
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
"devDependencies": {
|
||||
"mocha": "^10.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@vscode/vsce-sign-darwin-arm64": "2.0.2",
|
||||
"@vscode/vsce-sign-darwin-x64": "2.0.2",
|
||||
"@vscode/vsce-sign-win32-arm64": "2.0.2",
|
||||
"@vscode/vsce-sign-win32-x64": "2.0.2",
|
||||
"@vscode/vsce-sign-linux-arm64": "2.0.2",
|
||||
"@vscode/vsce-sign-linux-arm": "2.0.2",
|
||||
"@vscode/vsce-sign-linux-x64": "2.0.2",
|
||||
"@vscode/vsce-sign-alpine-arm64": "2.0.2",
|
||||
"@vscode/vsce-sign-alpine-x64": "2.0.2"
|
||||
},
|
||||
"homepage": "https://github.com/Microsoft/node-vsce-sign",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"postinstall": "node ./src/postinstall.js",
|
||||
"package": "node ./build/package.js",
|
||||
"download": "node ./build/download.js",
|
||||
"test": "mocha ./src/test/*.test.js --timeout 5s --fail-zero --exit"
|
||||
}
|
||||
}
|
46
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/src/main.d.ts
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/src/main.d.ts
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for
|
||||
* license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function verify(vsixFilePath: string, signatureArchiveFilePath: string, verbose?: boolean): Promise<ExtensionSignatureVerificationResult>;
|
||||
export function generateManifest(vsixFilePath: string, manifestFilePath?: string, verbose?: boolean): Promise<string>;
|
||||
export function zip(manifestFilePath: string, signatureFilePath: string, signatureArchiveFilePath?: string, verbose?: boolean): Promise<string>;
|
||||
|
||||
export enum ExtensionSignatureVerificationCode {
|
||||
'Success' = 'Success',
|
||||
'RequiredArgumentMissing' = 'RequiredArgumentMissing',
|
||||
'InvalidArgument' = 'InvalidArgument',
|
||||
'PackageIsUnreadable' = 'PackageIsUnreadable',
|
||||
'UnhandledException' = 'UnhandledException',
|
||||
'SignatureManifestIsMissing' = 'SignatureManifestIsMissing',
|
||||
'SignatureManifestIsUnreadable' = 'SignatureManifestIsUnreadable',
|
||||
'SignatureIsMissing' = 'SignatureIsMissing',
|
||||
'SignatureIsUnreadable' = 'SignatureIsUnreadable',
|
||||
'CertificateIsUnreadable' = 'CertificateIsUnreadable',
|
||||
'SignatureArchiveIsUnreadable' = 'SignatureArchiveIsUnreadable',
|
||||
'FileAlreadyExists' = 'FileAlreadyExists',
|
||||
'SignatureArchiveIsInvalidZip' = 'SignatureArchiveIsInvalidZip',
|
||||
'SignatureArchiveHasSameSignatureFile' = 'SignatureArchiveHasSameSignatureFile',
|
||||
|
||||
'PackageIntegrityCheckFailed' = 'PackageIntegrityCheckFailed',
|
||||
'SignatureIsInvalid' = 'SignatureIsInvalid',
|
||||
'SignatureManifestIsInvalid' = 'SignatureManifestIsInvalid',
|
||||
'SignatureIntegrityCheckFailed' = 'SignatureIntegrityCheckFailed',
|
||||
'EntryIsMissing' = 'EntryIsMissing',
|
||||
'EntryIsTampered' = 'EntryIsTampered',
|
||||
'Untrusted' = 'Untrusted',
|
||||
'CertificateRevoked' = 'CertificateRevoked',
|
||||
'SignatureIsNotValid' = 'SignatureIsNotValid',
|
||||
'UnknownError' = 'UnknownError',
|
||||
'PackageIsInvalidZip' = 'PackageIsInvalidZip',
|
||||
'SignatureArchiveHasTooManyEntries' = 'SignatureArchiveHasTooManyEntries',
|
||||
}
|
||||
|
||||
export class ExtensionSignatureVerificationResult {
|
||||
readonly code: ExtensionSignatureVerificationCode;
|
||||
readonly didExecute: boolean;
|
||||
readonly internalCode?: number;
|
||||
readonly output?: string;
|
||||
}
|
194
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/src/main.js
generated
vendored
Normal file
194
vscode-server-linux-x64-web/node_modules/@vscode/vsce-sign/src/main.js
generated
vendored
Normal file
@ -0,0 +1,194 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* See LICENSE.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// @ts-check
|
||||
'use strict';
|
||||
|
||||
const { execFile } = require('child_process');
|
||||
const Path = require('path');
|
||||
|
||||
const command = process.platform === 'win32' ? 'vsce-sign.exe' : 'vsce-sign';
|
||||
const vsceSignFilePath = Path.join(__dirname, '..', 'bin', command);
|
||||
|
||||
// If this module is in an .asar file, then the binary is unpacked.
|
||||
const vsceSignOnDiskFilePath = vsceSignFilePath.replace(/\bnode_modules\.asar\b/, 'node_modules.asar.unpacked');
|
||||
|
||||
const ExtensionSignatureVerificationCode = {
|
||||
'Success': 'Success',
|
||||
'RequiredArgumentMissing': 'RequiredArgumentMissing',
|
||||
'InvalidArgument': 'InvalidArgument',
|
||||
'PackageIsUnreadable': 'PackageIsUnreadable',
|
||||
'UnhandledException': 'UnhandledException',
|
||||
'SignatureManifestIsMissing': 'SignatureManifestIsMissing',
|
||||
'SignatureManifestIsUnreadable': 'SignatureManifestIsUnreadable',
|
||||
'SignatureIsMissing': 'SignatureIsMissing',
|
||||
'SignatureIsUnreadable': 'SignatureIsUnreadable',
|
||||
'CertificateIsUnreadable': 'CertificateIsUnreadable',
|
||||
'SignatureArchiveIsUnreadable': 'SignatureArchiveIsUnreadable',
|
||||
'FileAlreadyExists': 'FileAlreadyExists',
|
||||
'SignatureArchiveIsInvalidZip': 'SignatureArchiveIsInvalidZip',
|
||||
'SignatureArchiveHasSameSignatureFile': 'SignatureArchiveHasSameSignatureFile',
|
||||
|
||||
'PackageIntegrityCheckFailed': 'PackageIntegrityCheckFailed',
|
||||
'SignatureIsInvalid': 'SignatureIsInvalid',
|
||||
'SignatureManifestIsInvalid': 'SignatureManifestIsInvalid',
|
||||
'SignatureIntegrityCheckFailed': 'SignatureIntegrityCheckFailed',
|
||||
'EntryIsMissing': 'EntryIsMissing',
|
||||
'EntryIsTampered': 'EntryIsTampered',
|
||||
'Untrusted': 'Untrusted',
|
||||
'CertificateRevoked': 'CertificateRevoked',
|
||||
'SignatureIsNotValid': 'SignatureIsNotValid',
|
||||
'UnknownError': 'UnknownError',
|
||||
'PackageIsInvalidZip': 'PackageIsInvalidZip',
|
||||
'SignatureArchiveHasTooManyEntries': 'SignatureArchiveHasTooManyEntries',
|
||||
};
|
||||
|
||||
// Must stay in sync with Microsoft.VisualStudio.Extensions.Signing.ReturnCode (https://github.com/microsoft/vsce-sign/blob/main/src/Core/ReturnCode.cs).
|
||||
const ReturnCode = {};
|
||||
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.Success] = 0] = ExtensionSignatureVerificationCode.Success; // The operation succeeded.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.RequiredArgumentMissing] = 3] = ExtensionSignatureVerificationCode.RequiredArgumentMissing; // A required argument is missing.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.InvalidArgument] = 4] = ExtensionSignatureVerificationCode.InvalidArgument; // An argument is invalid.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.PackageIsUnreadable] = 5] = ExtensionSignatureVerificationCode.PackageIsUnreadable; // The extension package is unreadable.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.UnhandledException] = 6] = ExtensionSignatureVerificationCode.UnhandledException; // An unhandled exception occurred.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureManifestIsMissing] = 7] = ExtensionSignatureVerificationCode.SignatureManifestIsMissing; // The extension is missing a signature manifest file (.signature.manifest).
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureManifestIsUnreadable] = 8] = ExtensionSignatureVerificationCode.SignatureManifestIsUnreadable; // The signature manifest is unreadable.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureIsMissing] = 9] = ExtensionSignatureVerificationCode.SignatureIsMissing; // The extension is missing a signature file (.signature.p7s).
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureIsUnreadable] = 10] = ExtensionSignatureVerificationCode.SignatureIsUnreadable; // The signature is unreadable.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.CertificateIsUnreadable] = 11] = ExtensionSignatureVerificationCode.CertificateIsUnreadable; // The certificate is unreadable.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureArchiveIsUnreadable] = 12] = ExtensionSignatureVerificationCode.SignatureArchiveIsUnreadable; // The signature archive is unreadable.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.FileAlreadyExists] = 13] = ExtensionSignatureVerificationCode.FileAlreadyExists; // The output file already exists.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureArchiveIsInvalidZip] = 14] = ExtensionSignatureVerificationCode.SignatureArchiveIsInvalidZip; // The signature archive is not valid ZIP format.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureArchiveHasSameSignatureFile] = 15] = ExtensionSignatureVerificationCode.SignatureArchiveHasSameSignatureFile; // The signature archive has the same signature file.
|
||||
|
||||
// Space reserved for additional CLI-specific return codes.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.PackageIntegrityCheckFailed] = 30] = ExtensionSignatureVerificationCode.PackageIntegrityCheckFailed; // The package integrity check failed.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureIsInvalid] = 31] = ExtensionSignatureVerificationCode.SignatureIsInvalid; // The extension has an invalid signature file (.signature.p7s).
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureManifestIsInvalid] = 32] = ExtensionSignatureVerificationCode.SignatureManifestIsInvalid; // The extension has an invalid signature manifest file (.signature.manifest).
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureIntegrityCheckFailed] = 33] = ExtensionSignatureVerificationCode.SignatureIntegrityCheckFailed; // The extension's signature integrity check failed. Extension integrity is suspect.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.EntryIsMissing] = 34] = ExtensionSignatureVerificationCode.EntryIsMissing; // An entry referenced in the signature manifest was not found in the extension.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.EntryIsTampered] = 35] = ExtensionSignatureVerificationCode.EntryIsTampered; // The integrity check for an entry referenced in the signature manifest failed.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.Untrusted] = 36] = ExtensionSignatureVerificationCode.Untrusted; // An X.509 certificate in the extension signature is untrusted.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.CertificateRevoked] = 37] = ExtensionSignatureVerificationCode.CertificateRevoked; // An X.509 certificate in the extension signature has been revoked.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureIsNotValid] = 38] = ExtensionSignatureVerificationCode.SignatureIsNotValid; // The extension signature is invalid.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.UnknownError] = 39] = ExtensionSignatureVerificationCode.UnknownError; // An unknown error occurred.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.PackageIsInvalidZip] = 40] = ExtensionSignatureVerificationCode.PackageIsInvalidZip; // The extension package is not valid ZIP format.
|
||||
ReturnCode[ReturnCode[ExtensionSignatureVerificationCode.SignatureArchiveHasTooManyEntries] = 41] = ExtensionSignatureVerificationCode.SignatureArchiveHasTooManyEntries; // The signature archive has too many entries.
|
||||
|
||||
class ExtensionSignatureVerificationResult {
|
||||
/**
|
||||
* @param {string} code
|
||||
* @param {boolean} didExecute
|
||||
* @param {number | undefined} internalCode
|
||||
* @param {string | undefined} output
|
||||
*/
|
||||
constructor(code, didExecute, internalCode, output) {
|
||||
this.code = code;
|
||||
this.internalCode = internalCode;
|
||||
this.didExecute = didExecute;
|
||||
this.output = output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} vsixFilePath
|
||||
* @param {string} signatureArchiveFilePath
|
||||
* @param {boolean} verbose
|
||||
* @returns {Promise<ExtensionSignatureVerificationResult>}
|
||||
*/
|
||||
async function verify(vsixFilePath, signatureArchiveFilePath, verbose) {
|
||||
const args = ['verify', '--package', vsixFilePath, '--signaturearchive', signatureArchiveFilePath];
|
||||
return await execCommand(args, verbose, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} vsixFilePath
|
||||
* @param {string | undefined} manifestFilePath
|
||||
* @param {boolean} verbose
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
async function generateManifest(vsixFilePath, manifestFilePath, verbose) {
|
||||
const args = ['generatemanifest', '--package', vsixFilePath];
|
||||
|
||||
if (typeof manifestFilePath === 'string') {
|
||||
args.push('--output');
|
||||
args.push(manifestFilePath);
|
||||
}
|
||||
|
||||
await execCommand(args, verbose, true);
|
||||
|
||||
return manifestFilePath ?? Path.join(Path.dirname(vsixFilePath), '.signature.manifest');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} manifestFilePath
|
||||
* @param {string} signatureFilePath
|
||||
* @param {string | undefined} signatureArchiveFilePath
|
||||
* @param {boolean} verbose
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
async function zip(manifestFilePath, signatureFilePath, signatureArchiveFilePath, verbose) {
|
||||
const args = ['zip', '--manifest', manifestFilePath, '--signature', signatureFilePath];
|
||||
|
||||
if (typeof signatureArchiveFilePath === 'string') {
|
||||
args.push('--output');
|
||||
args.push(signatureArchiveFilePath);
|
||||
}
|
||||
|
||||
await execCommand(args, verbose, true);
|
||||
|
||||
return signatureArchiveFilePath ?? Path.join(Path.dirname(manifestFilePath), '.signature.zip');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string[]} args
|
||||
* @param {boolean} verbose
|
||||
* @param {boolean} throwIfNotSuccess
|
||||
* @returns {Promise<ExtensionSignatureVerificationResult>}
|
||||
*/
|
||||
function execCommand(args, verbose, throwIfNotSuccess) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
if (verbose === true) {
|
||||
args.push('--verbose');
|
||||
}
|
||||
|
||||
execFile(vsceSignOnDiskFilePath, args, (error, stdout) => {
|
||||
let internalCode = undefined;
|
||||
let returnCode;
|
||||
let didExecute = false;
|
||||
|
||||
const code = error === null ? 0 : error?.code;
|
||||
const output = verbose ? stdout : undefined;
|
||||
|
||||
// vsce-sign returns exit codes (numbers), whereas execFile(...), in the absence of an exit code, returns an error code (string) (e.g.: ENOENT) to indicate failure.
|
||||
if (typeof code === 'number') {
|
||||
didExecute = true;
|
||||
internalCode = code;
|
||||
returnCode = ReturnCode[code];
|
||||
} else if (typeof code === 'string') {
|
||||
returnCode = code;
|
||||
}
|
||||
|
||||
returnCode = returnCode ?? ExtensionSignatureVerificationCode.UnknownError;
|
||||
|
||||
if (throwIfNotSuccess && returnCode !== ExtensionSignatureVerificationCode.Success) {
|
||||
reject(new ExtensionSignatureVerificationResult(returnCode, didExecute, internalCode, output));
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(new ExtensionSignatureVerificationResult(returnCode, didExecute, internalCode, output));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
verify,
|
||||
generateManifest,
|
||||
zip,
|
||||
ReturnCode,
|
||||
ExtensionSignatureVerificationCode,
|
||||
ExtensionSignatureVerificationResult
|
||||
};
|
21
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/LICENSE
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
41
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
23
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/cli/index.js
generated
vendored
Executable file
23
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/cli/index.js
generated
vendored
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const { ModelOperations } = require('../dist/lib/index');
|
||||
const os = require('os');
|
||||
|
||||
(function (params) {
|
||||
console.warn('Note: this CLI is only for diagnosing the model results in @vscode/vscode-languagedetection. It should not be depended on in any production system.');
|
||||
const args = process.argv.slice(2);
|
||||
const content = args.join(os.EOL);
|
||||
|
||||
if (!content) {
|
||||
console.error('No content specified. Please pass in the content as the first argument of invocation.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (content.length <= 20) {
|
||||
console.error('Not enough content specified. Please include more content in your invocation.');
|
||||
return;
|
||||
}
|
||||
|
||||
const modelOperations = new ModelOperations();
|
||||
modelOperations.runModel(content).then((result) => console.log(result));
|
||||
})();
|
2
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js
generated
vendored
Normal file
2
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
154
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js.LICENSE.txt
generated
vendored
Normal file
154
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js.LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the License);
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
/** @license See the LICENSE file. */
|
BIN
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/model/group1-shard1of1.bin
generated
vendored
Normal file
BIN
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/model/group1-shard1of1.bin
generated
vendored
Normal file
Binary file not shown.
1
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/model/model.json
generated
vendored
Normal file
1
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/model/model.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
49
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/package.json
generated
vendored
Normal file
49
vscode-server-linux-x64-web/node_modules/@vscode/vscode-languagedetection/package.json
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "@vscode/vscode-languagedetection",
|
||||
"version": "1.0.21",
|
||||
"description": "An npm package that uses guesslang's ML model to detect source code languages",
|
||||
"main": "dist/lib/index.js",
|
||||
"bin": {
|
||||
"vscode-languagedetection": "cli/index.js"
|
||||
},
|
||||
"module": "dist/lib/index.js",
|
||||
"types": "dist/lib/index.d.ts",
|
||||
"scripts": {
|
||||
"pretest": "npm run clean && tsc --build ./test",
|
||||
"prepublish": "npm test && npm run build",
|
||||
"prepack": "npm run build",
|
||||
"clean": "rimraf dist",
|
||||
"watch": "npm run clean && webpack --watch",
|
||||
"test": "mocha --recursive dist/test/**/*.test.js",
|
||||
"build": "npm run clean && webpack --mode production"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/microsoft/vscode-languagedetection.git"
|
||||
},
|
||||
"author": "Tyler Leonhardt",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/microsoft/vscode-languagedetection/issues"
|
||||
},
|
||||
"homepage": "https://github.com/microsoft/vscode-languagedetection#readme",
|
||||
"devDependencies": {
|
||||
"@tensorflow/tfjs-backend-cpu": "^3.9.0",
|
||||
"@tensorflow/tfjs-converter": "^3.9.0",
|
||||
"@tensorflow/tfjs-core": "^3.9.0",
|
||||
"@types/chai": "^4.2.21",
|
||||
"@types/mocha": "8.2.3",
|
||||
"@types/node": "^16.3.1",
|
||||
"chai": "^4.3.4",
|
||||
"esbuild": "^0.12.15",
|
||||
"mocha": "9.0.2",
|
||||
"node-fetch": "^2.6.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "3.0.2",
|
||||
"terser-webpack-plugin": "^5.1.4",
|
||||
"ts-loader": "^9.2.3",
|
||||
"typescript": "^4.3.5",
|
||||
"webpack": "~5.44.0",
|
||||
"webpack-cli": "^4.7.2"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user