mirror of
https://github.com/gradle/wrapper-validation-action.git
synced 2025-04-22 15:19:19 +08:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c96026c4a4 | ||
|
e60abf8b0f | ||
|
c924edf7c8 | ||
|
38d0eb7924 | ||
|
52477604a4 | ||
|
0dcfa68721 | ||
|
0484d9d18a | ||
|
4c4187a173 |
140
node_modules/@actions/core/README.md
generated
vendored
Normal file
140
node_modules/@actions/core/README.md
generated
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
# `@actions/core`
|
||||
|
||||
> Core functions for setting results, logging, registering secrets and exporting variables across actions
|
||||
|
||||
## Usage
|
||||
|
||||
### Import the package
|
||||
|
||||
```js
|
||||
// javascript
|
||||
const core = require('@actions/core');
|
||||
|
||||
// typescript
|
||||
import * as core from '@actions/core';
|
||||
```
|
||||
|
||||
#### Inputs/Outputs
|
||||
|
||||
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
||||
|
||||
```js
|
||||
const myInput = core.getInput('inputName', { required: true });
|
||||
|
||||
core.setOutput('outputKey', 'outputVal');
|
||||
```
|
||||
|
||||
#### Exporting variables
|
||||
|
||||
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
||||
|
||||
```js
|
||||
core.exportVariable('envVar', 'Val');
|
||||
```
|
||||
|
||||
#### Setting a secret
|
||||
|
||||
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
||||
|
||||
```js
|
||||
core.setSecret('myPassword');
|
||||
```
|
||||
|
||||
#### PATH Manipulation
|
||||
|
||||
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
||||
|
||||
```js
|
||||
core.addPath('/path/to/mytool');
|
||||
```
|
||||
|
||||
#### Exit codes
|
||||
|
||||
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
||||
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
try {
|
||||
// Do stuff
|
||||
}
|
||||
catch (err) {
|
||||
// setFailed logs the message and sets a failing exit code
|
||||
core.setFailed(`Action failed with error ${err}`);
|
||||
}
|
||||
|
||||
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
||||
|
||||
```
|
||||
|
||||
#### Logging
|
||||
|
||||
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
||||
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
const myInput = core.getInput('input');
|
||||
try {
|
||||
core.debug('Inside try block');
|
||||
|
||||
if (!myInput) {
|
||||
core.warning('myInput was not set');
|
||||
}
|
||||
|
||||
// Do stuff
|
||||
}
|
||||
catch (err) {
|
||||
core.error(`Error ${err}, action may still succeed though`);
|
||||
}
|
||||
```
|
||||
|
||||
This library can also wrap chunks of output in foldable groups.
|
||||
|
||||
```js
|
||||
const core = require('@actions/core')
|
||||
|
||||
// Manually wrap output
|
||||
core.startGroup('Do some function')
|
||||
doSomeFunction()
|
||||
core.endGroup()
|
||||
|
||||
// Wrap an asynchronous function call
|
||||
const result = await core.group('Do something async', async () => {
|
||||
const response = await doSomeHTTPRequest()
|
||||
return response
|
||||
})
|
||||
```
|
||||
|
||||
#### Action state
|
||||
|
||||
You can use this library to save state and get state for sharing information between a given wrapper action:
|
||||
|
||||
**action.yml**
|
||||
```yaml
|
||||
name: 'Wrapper action sample'
|
||||
inputs:
|
||||
name:
|
||||
default: 'GitHub'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'main.js'
|
||||
post: 'cleanup.js'
|
||||
```
|
||||
|
||||
In action's `main.js`:
|
||||
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
core.saveState("pidToKill", 12345);
|
||||
```
|
||||
|
||||
In action's `cleanup.js`:
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
var pid = core.getState("pidToKill");
|
||||
|
||||
process.kill(pid);
|
||||
```
|
16
node_modules/@actions/core/lib/command.d.ts
generated
vendored
Normal file
16
node_modules/@actions/core/lib/command.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
interface CommandProperties {
|
||||
[key: string]: string;
|
||||
}
|
||||
/**
|
||||
* Commands
|
||||
*
|
||||
* Command Format:
|
||||
* ##[name key=value;key=value]message
|
||||
*
|
||||
* Examples:
|
||||
* ##[warning]This is the user warning message
|
||||
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
||||
*/
|
||||
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
|
||||
export declare function issue(name: string, message?: string): void;
|
||||
export {};
|
66
node_modules/@actions/core/lib/command.js
generated
vendored
Normal file
66
node_modules/@actions/core/lib/command.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const os = require("os");
|
||||
/**
|
||||
* Commands
|
||||
*
|
||||
* Command Format:
|
||||
* ##[name key=value;key=value]message
|
||||
*
|
||||
* Examples:
|
||||
* ##[warning]This is the user warning message
|
||||
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
||||
*/
|
||||
function issueCommand(command, properties, message) {
|
||||
const cmd = new Command(command, properties, message);
|
||||
process.stdout.write(cmd.toString() + os.EOL);
|
||||
}
|
||||
exports.issueCommand = issueCommand;
|
||||
function issue(name, message = '') {
|
||||
issueCommand(name, {}, message);
|
||||
}
|
||||
exports.issue = issue;
|
||||
const CMD_STRING = '::';
|
||||
class Command {
|
||||
constructor(command, properties, message) {
|
||||
if (!command) {
|
||||
command = 'missing.command';
|
||||
}
|
||||
this.command = command;
|
||||
this.properties = properties;
|
||||
this.message = message;
|
||||
}
|
||||
toString() {
|
||||
let cmdStr = CMD_STRING + this.command;
|
||||
if (this.properties && Object.keys(this.properties).length > 0) {
|
||||
cmdStr += ' ';
|
||||
for (const key in this.properties) {
|
||||
if (this.properties.hasOwnProperty(key)) {
|
||||
const val = this.properties[key];
|
||||
if (val) {
|
||||
// safely append the val - avoid blowing up when attempting to
|
||||
// call .replace() if message is not a string for some reason
|
||||
cmdStr += `${key}=${escape(`${val || ''}`)},`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cmdStr += CMD_STRING;
|
||||
// safely append the message - avoid blowing up when attempting to
|
||||
// call .replace() if message is not a string for some reason
|
||||
const message = `${this.message || ''}`;
|
||||
cmdStr += escapeData(message);
|
||||
return cmdStr;
|
||||
}
|
||||
}
|
||||
function escapeData(s) {
|
||||
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
|
||||
}
|
||||
function escape(s) {
|
||||
return s
|
||||
.replace(/\r/g, '%0D')
|
||||
.replace(/\n/g, '%0A')
|
||||
.replace(/]/g, '%5D')
|
||||
.replace(/;/g, '%3B');
|
||||
}
|
||||
//# sourceMappingURL=command.js.map
|
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,8DAA8D;wBAC9D,6DAA6D;wBAC7D,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,GAAG,CAAA;qBAC9C;iBACF;aACF;SACF;QAED,MAAM,IAAI,UAAU,CAAA;QAEpB,kEAAkE;QAClE,6DAA6D;QAC7D,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAA;QACvC,MAAM,IAAI,UAAU,CAAC,OAAO,CAAC,CAAA;QAE7B,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
112
node_modules/@actions/core/lib/core.d.ts
generated
vendored
Normal file
112
node_modules/@actions/core/lib/core.d.ts
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
/**
|
||||
* Interface for getInput options
|
||||
*/
|
||||
export interface InputOptions {
|
||||
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
||||
required?: boolean;
|
||||
}
|
||||
/**
|
||||
* The code to exit an action
|
||||
*/
|
||||
export declare enum ExitCode {
|
||||
/**
|
||||
* A code indicating that the action was successful
|
||||
*/
|
||||
Success = 0,
|
||||
/**
|
||||
* A code indicating that the action was a failure
|
||||
*/
|
||||
Failure = 1
|
||||
}
|
||||
/**
|
||||
* Sets env variable for this action and future actions in the job
|
||||
* @param name the name of the variable to set
|
||||
* @param val the value of the variable
|
||||
*/
|
||||
export declare function exportVariable(name: string, val: string): void;
|
||||
/**
|
||||
* Registers a secret which will get masked from logs
|
||||
* @param secret value of the secret
|
||||
*/
|
||||
export declare function setSecret(secret: string): void;
|
||||
/**
|
||||
* Prepends inputPath to the PATH (for this action and future actions)
|
||||
* @param inputPath
|
||||
*/
|
||||
export declare function addPath(inputPath: string): void;
|
||||
/**
|
||||
* Gets the value of an input. The value is also trimmed.
|
||||
*
|
||||
* @param name name of the input to get
|
||||
* @param options optional. See InputOptions.
|
||||
* @returns string
|
||||
*/
|
||||
export declare function getInput(name: string, options?: InputOptions): string;
|
||||
/**
|
||||
* Sets the value of an output.
|
||||
*
|
||||
* @param name name of the output to set
|
||||
* @param value value to store
|
||||
*/
|
||||
export declare function setOutput(name: string, value: string): void;
|
||||
/**
|
||||
* Sets the action status to failed.
|
||||
* When the action exits it will be with an exit code of 1
|
||||
* @param message add error issue message
|
||||
*/
|
||||
export declare function setFailed(message: string): void;
|
||||
/**
|
||||
* Writes debug message to user log
|
||||
* @param message debug message
|
||||
*/
|
||||
export declare function debug(message: string): void;
|
||||
/**
|
||||
* Adds an error issue
|
||||
* @param message error issue message
|
||||
*/
|
||||
export declare function error(message: string): void;
|
||||
/**
|
||||
* Adds an warning issue
|
||||
* @param message warning issue message
|
||||
*/
|
||||
export declare function warning(message: string): void;
|
||||
/**
|
||||
* Writes info to log with console.log.
|
||||
* @param message info message
|
||||
*/
|
||||
export declare function info(message: string): void;
|
||||
/**
|
||||
* Begin an output group.
|
||||
*
|
||||
* Output until the next `groupEnd` will be foldable in this group
|
||||
*
|
||||
* @param name The name of the output group
|
||||
*/
|
||||
export declare function startGroup(name: string): void;
|
||||
/**
|
||||
* End an output group.
|
||||
*/
|
||||
export declare function endGroup(): void;
|
||||
/**
|
||||
* Wrap an asynchronous function call in a group.
|
||||
*
|
||||
* Returns the same type as the function itself.
|
||||
*
|
||||
* @param name The name of the group
|
||||
* @param fn The function to wrap in the group
|
||||
*/
|
||||
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
||||
/**
|
||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||
*
|
||||
* @param name name of the state to store
|
||||
* @param value value to store
|
||||
*/
|
||||
export declare function saveState(name: string, value: string): void;
|
||||
/**
|
||||
* Gets the value of an state set by this action's main execution.
|
||||
*
|
||||
* @param name name of the state to get
|
||||
* @returns string
|
||||
*/
|
||||
export declare function getState(name: string): string;
|
195
node_modules/@actions/core/lib/core.js
generated
vendored
Normal file
195
node_modules/@actions/core/lib/core.js
generated
vendored
Normal file
@ -0,0 +1,195 @@
|
||||
"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());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const command_1 = require("./command");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
/**
|
||||
* The code to exit an action
|
||||
*/
|
||||
var ExitCode;
|
||||
(function (ExitCode) {
|
||||
/**
|
||||
* A code indicating that the action was successful
|
||||
*/
|
||||
ExitCode[ExitCode["Success"] = 0] = "Success";
|
||||
/**
|
||||
* A code indicating that the action was a failure
|
||||
*/
|
||||
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
||||
//-----------------------------------------------------------------------
|
||||
// Variables
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets env variable for this action and future actions in the job
|
||||
* @param name the name of the variable to set
|
||||
* @param val the value of the variable
|
||||
*/
|
||||
function exportVariable(name, val) {
|
||||
process.env[name] = val;
|
||||
command_1.issueCommand('set-env', { name }, val);
|
||||
}
|
||||
exports.exportVariable = exportVariable;
|
||||
/**
|
||||
* Registers a secret which will get masked from logs
|
||||
* @param secret value of the secret
|
||||
*/
|
||||
function setSecret(secret) {
|
||||
command_1.issueCommand('add-mask', {}, secret);
|
||||
}
|
||||
exports.setSecret = setSecret;
|
||||
/**
|
||||
* Prepends inputPath to the PATH (for this action and future actions)
|
||||
* @param inputPath
|
||||
*/
|
||||
function addPath(inputPath) {
|
||||
command_1.issueCommand('add-path', {}, inputPath);
|
||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||
}
|
||||
exports.addPath = addPath;
|
||||
/**
|
||||
* Gets the value of an input. The value is also trimmed.
|
||||
*
|
||||
* @param name name of the input to get
|
||||
* @param options optional. See InputOptions.
|
||||
* @returns string
|
||||
*/
|
||||
function getInput(name, options) {
|
||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
||||
if (options && options.required && !val) {
|
||||
throw new Error(`Input required and not supplied: ${name}`);
|
||||
}
|
||||
return val.trim();
|
||||
}
|
||||
exports.getInput = getInput;
|
||||
/**
|
||||
* Sets the value of an output.
|
||||
*
|
||||
* @param name name of the output to set
|
||||
* @param value value to store
|
||||
*/
|
||||
function setOutput(name, value) {
|
||||
command_1.issueCommand('set-output', { name }, value);
|
||||
}
|
||||
exports.setOutput = setOutput;
|
||||
//-----------------------------------------------------------------------
|
||||
// Results
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the action status to failed.
|
||||
* When the action exits it will be with an exit code of 1
|
||||
* @param message add error issue message
|
||||
*/
|
||||
function setFailed(message) {
|
||||
process.exitCode = ExitCode.Failure;
|
||||
error(message);
|
||||
}
|
||||
exports.setFailed = setFailed;
|
||||
//-----------------------------------------------------------------------
|
||||
// Logging Commands
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Writes debug message to user log
|
||||
* @param message debug message
|
||||
*/
|
||||
function debug(message) {
|
||||
command_1.issueCommand('debug', {}, message);
|
||||
}
|
||||
exports.debug = debug;
|
||||
/**
|
||||
* Adds an error issue
|
||||
* @param message error issue message
|
||||
*/
|
||||
function error(message) {
|
||||
command_1.issue('error', message);
|
||||
}
|
||||
exports.error = error;
|
||||
/**
|
||||
* Adds an warning issue
|
||||
* @param message warning issue message
|
||||
*/
|
||||
function warning(message) {
|
||||
command_1.issue('warning', message);
|
||||
}
|
||||
exports.warning = warning;
|
||||
/**
|
||||
* Writes info to log with console.log.
|
||||
* @param message info message
|
||||
*/
|
||||
function info(message) {
|
||||
process.stdout.write(message + os.EOL);
|
||||
}
|
||||
exports.info = info;
|
||||
/**
|
||||
* Begin an output group.
|
||||
*
|
||||
* Output until the next `groupEnd` will be foldable in this group
|
||||
*
|
||||
* @param name The name of the output group
|
||||
*/
|
||||
function startGroup(name) {
|
||||
command_1.issue('group', name);
|
||||
}
|
||||
exports.startGroup = startGroup;
|
||||
/**
|
||||
* End an output group.
|
||||
*/
|
||||
function endGroup() {
|
||||
command_1.issue('endgroup');
|
||||
}
|
||||
exports.endGroup = endGroup;
|
||||
/**
|
||||
* Wrap an asynchronous function call in a group.
|
||||
*
|
||||
* Returns the same type as the function itself.
|
||||
*
|
||||
* @param name The name of the group
|
||||
* @param fn The function to wrap in the group
|
||||
*/
|
||||
function group(name, fn) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
startGroup(name);
|
||||
let result;
|
||||
try {
|
||||
result = yield fn();
|
||||
}
|
||||
finally {
|
||||
endGroup();
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
exports.group = group;
|
||||
//-----------------------------------------------------------------------
|
||||
// Wrapper action state
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||
*
|
||||
* @param name name of the state to store
|
||||
* @param value value to store
|
||||
*/
|
||||
function saveState(name, value) {
|
||||
command_1.issueCommand('save-state', { name }, value);
|
||||
}
|
||||
exports.saveState = saveState;
|
||||
/**
|
||||
* Gets the value of an state set by this action's main execution.
|
||||
*
|
||||
* @param name name of the state to get
|
||||
* @returns string
|
||||
*/
|
||||
function getState(name) {
|
||||
return process.env[`STATE_${name}`] || '';
|
||||
}
|
||||
exports.getState = getState;
|
||||
//# sourceMappingURL=core.js.map
|
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA6C;AAE7C,yBAAwB;AACxB,6BAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
67
node_modules/@actions/core/package.json
generated
vendored
Normal file
67
node_modules/@actions/core/package.json
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@actions/core@1.2.0",
|
||||
"/Users/paul/src/gradle-related/gradle-wrapper-check"
|
||||
]
|
||||
],
|
||||
"_from": "@actions/core@1.2.0",
|
||||
"_id": "@actions/core@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==",
|
||||
"_location": "/@actions/core",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@actions/core@1.2.0",
|
||||
"name": "@actions/core",
|
||||
"escapedName": "@actions%2fcore",
|
||||
"scope": "@actions",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz",
|
||||
"_spec": "1.2.0",
|
||||
"_where": "/Users/paul/src/gradle-related/gradle-wrapper-check",
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"description": "Actions core lib",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
||||
"keywords": [
|
||||
"github",
|
||||
"actions",
|
||||
"core"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/core.js",
|
||||
"name": "@actions/core",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/actions/toolkit.git",
|
||||
"directory": "packages/core"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||
"tsc": "tsc"
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
2
node_modules/tunnel/.npmignore
generated
vendored
Normal file
2
node_modules/tunnel/.npmignore
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/.idea
|
||||
/node_modules
|
13
node_modules/tunnel/CHANGELOG.md
generated
vendored
Normal file
13
node_modules/tunnel/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
- 0.0.4 (2016/01/23)
|
||||
- supported Node v0.12 or later.
|
||||
|
||||
- 0.0.3 (2014/01/20)
|
||||
- fixed package.json
|
||||
|
||||
- 0.0.1 (2012/02/18)
|
||||
- supported Node v0.6.x (0.6.11 or later).
|
||||
|
||||
- 0.0.0 (2012/02/11)
|
||||
- first release.
|
21
node_modules/tunnel/LICENSE
generated
vendored
Normal file
21
node_modules/tunnel/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 Koichi Kobayashi
|
||||
|
||||
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.
|
179
node_modules/tunnel/README.md
generated
vendored
Normal file
179
node_modules/tunnel/README.md
generated
vendored
Normal file
@ -0,0 +1,179 @@
|
||||
# node-tunnel - HTTP/HTTPS Agents for tunneling proxies
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
var tunnel = require('tunnel');
|
||||
|
||||
var tunnelingAgent = tunnel.httpsOverHttp({
|
||||
proxy: {
|
||||
host: 'localhost',
|
||||
port: 3128
|
||||
}
|
||||
});
|
||||
|
||||
var req = https.request({
|
||||
host: 'example.com',
|
||||
port: 443,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install tunnel
|
||||
|
||||
## Usages
|
||||
|
||||
### HTTP over HTTP tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpOverHttp({
|
||||
maxSockets: poolSize, // Defaults to 5
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 80
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var req = http.request({
|
||||
host: 'example.com',
|
||||
port: 80,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
### HTTPS over HTTP tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpsOverHttp({
|
||||
maxSockets: poolSize, // Defaults to 5
|
||||
|
||||
// CA for origin server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Client certification for origin server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 80
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var req = https.request({
|
||||
host: 'example.com',
|
||||
port: 443,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
### HTTP over HTTPS tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpOverHttps({
|
||||
maxSockets: poolSize, // Defaults to 5
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 443
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
},
|
||||
|
||||
// CA for proxy server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Server name for verification if necessary
|
||||
servername: 'example.com',
|
||||
|
||||
// Client certification for proxy server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
}
|
||||
});
|
||||
|
||||
var req = http.request({
|
||||
host: 'example.com',
|
||||
port: 80,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
### HTTPS over HTTPS tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpsOverHttps({
|
||||
maxSockets: poolSize, // Defaults to 5
|
||||
|
||||
// CA for origin server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Client certification for origin server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 443
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
}
|
||||
|
||||
// CA for proxy server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Server name for verification if necessary
|
||||
servername: 'example.com',
|
||||
|
||||
// Client certification for proxy server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
}
|
||||
});
|
||||
|
||||
var req = https.request({
|
||||
host: 'example.com',
|
||||
port: 443,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
## CONTRIBUTORS
|
||||
* [Aleksis Brezas (abresas)](https://github.com/abresas)
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the [MIT](https://github.com/koichik/node-tunnel/blob/master/LICENSE) license.
|
1
node_modules/tunnel/index.js
generated
vendored
Normal file
1
node_modules/tunnel/index.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./lib/tunnel');
|
247
node_modules/tunnel/lib/tunnel.js
generated
vendored
Normal file
247
node_modules/tunnel/lib/tunnel.js
generated
vendored
Normal file
@ -0,0 +1,247 @@
|
||||
'use strict';
|
||||
|
||||
var net = require('net');
|
||||
var tls = require('tls');
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var events = require('events');
|
||||
var assert = require('assert');
|
||||
var util = require('util');
|
||||
|
||||
|
||||
exports.httpOverHttp = httpOverHttp;
|
||||
exports.httpsOverHttp = httpsOverHttp;
|
||||
exports.httpOverHttps = httpOverHttps;
|
||||
exports.httpsOverHttps = httpsOverHttps;
|
||||
|
||||
|
||||
function httpOverHttp(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = http.request;
|
||||
return agent;
|
||||
}
|
||||
|
||||
function httpsOverHttp(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = http.request;
|
||||
agent.createSocket = createSecureSocket;
|
||||
return agent;
|
||||
}
|
||||
|
||||
function httpOverHttps(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = https.request;
|
||||
return agent;
|
||||
}
|
||||
|
||||
function httpsOverHttps(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = https.request;
|
||||
agent.createSocket = createSecureSocket;
|
||||
return agent;
|
||||
}
|
||||
|
||||
|
||||
function TunnelingAgent(options) {
|
||||
var self = this;
|
||||
self.options = options || {};
|
||||
self.proxyOptions = self.options.proxy || {};
|
||||
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
||||
self.requests = [];
|
||||
self.sockets = [];
|
||||
|
||||
self.on('free', function onFree(socket, host, port, localAddress) {
|
||||
var options = toOptions(host, port, localAddress);
|
||||
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
||||
var pending = self.requests[i];
|
||||
if (pending.host === options.host && pending.port === options.port) {
|
||||
// Detect the request to connect same origin server,
|
||||
// reuse the connection.
|
||||
self.requests.splice(i, 1);
|
||||
pending.request.onSocket(socket);
|
||||
return;
|
||||
}
|
||||
}
|
||||
socket.destroy();
|
||||
self.removeSocket(socket);
|
||||
});
|
||||
}
|
||||
util.inherits(TunnelingAgent, events.EventEmitter);
|
||||
|
||||
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
||||
var self = this;
|
||||
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
|
||||
|
||||
if (self.sockets.length >= this.maxSockets) {
|
||||
// We are over limit so we'll add it to the queue.
|
||||
self.requests.push(options);
|
||||
return;
|
||||
}
|
||||
|
||||
// If we are under maxSockets create a new one.
|
||||
self.createSocket(options, function(socket) {
|
||||
socket.on('free', onFree);
|
||||
socket.on('close', onCloseOrRemove);
|
||||
socket.on('agentRemove', onCloseOrRemove);
|
||||
req.onSocket(socket);
|
||||
|
||||
function onFree() {
|
||||
self.emit('free', socket, options);
|
||||
}
|
||||
|
||||
function onCloseOrRemove(err) {
|
||||
self.removeSocket(socket);
|
||||
socket.removeListener('free', onFree);
|
||||
socket.removeListener('close', onCloseOrRemove);
|
||||
socket.removeListener('agentRemove', onCloseOrRemove);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
|
||||
var self = this;
|
||||
var placeholder = {};
|
||||
self.sockets.push(placeholder);
|
||||
|
||||
var connectOptions = mergeOptions({}, self.proxyOptions, {
|
||||
method: 'CONNECT',
|
||||
path: options.host + ':' + options.port,
|
||||
agent: false
|
||||
});
|
||||
if (connectOptions.proxyAuth) {
|
||||
connectOptions.headers = connectOptions.headers || {};
|
||||
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
|
||||
new Buffer(connectOptions.proxyAuth).toString('base64');
|
||||
}
|
||||
|
||||
debug('making CONNECT request');
|
||||
var connectReq = self.request(connectOptions);
|
||||
connectReq.useChunkedEncodingByDefault = false; // for v0.6
|
||||
connectReq.once('response', onResponse); // for v0.6
|
||||
connectReq.once('upgrade', onUpgrade); // for v0.6
|
||||
connectReq.once('connect', onConnect); // for v0.7 or later
|
||||
connectReq.once('error', onError);
|
||||
connectReq.end();
|
||||
|
||||
function onResponse(res) {
|
||||
// Very hacky. This is necessary to avoid http-parser leaks.
|
||||
res.upgrade = true;
|
||||
}
|
||||
|
||||
function onUpgrade(res, socket, head) {
|
||||
// Hacky.
|
||||
process.nextTick(function() {
|
||||
onConnect(res, socket, head);
|
||||
});
|
||||
}
|
||||
|
||||
function onConnect(res, socket, head) {
|
||||
connectReq.removeAllListeners();
|
||||
socket.removeAllListeners();
|
||||
|
||||
if (res.statusCode === 200) {
|
||||
assert.equal(head.length, 0);
|
||||
debug('tunneling connection has established');
|
||||
self.sockets[self.sockets.indexOf(placeholder)] = socket;
|
||||
cb(socket);
|
||||
} else {
|
||||
debug('tunneling socket could not be established, statusCode=%d',
|
||||
res.statusCode);
|
||||
var error = new Error('tunneling socket could not be established, ' +
|
||||
'statusCode=' + res.statusCode);
|
||||
error.code = 'ECONNRESET';
|
||||
options.request.emit('error', error);
|
||||
self.removeSocket(placeholder);
|
||||
}
|
||||
}
|
||||
|
||||
function onError(cause) {
|
||||
connectReq.removeAllListeners();
|
||||
|
||||
debug('tunneling socket could not be established, cause=%s\n',
|
||||
cause.message, cause.stack);
|
||||
var error = new Error('tunneling socket could not be established, ' +
|
||||
'cause=' + cause.message);
|
||||
error.code = 'ECONNRESET';
|
||||
options.request.emit('error', error);
|
||||
self.removeSocket(placeholder);
|
||||
}
|
||||
};
|
||||
|
||||
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
|
||||
var pos = this.sockets.indexOf(socket)
|
||||
if (pos === -1) {
|
||||
return;
|
||||
}
|
||||
this.sockets.splice(pos, 1);
|
||||
|
||||
var pending = this.requests.shift();
|
||||
if (pending) {
|
||||
// If we have pending requests and a socket gets closed a new one
|
||||
// needs to be created to take over in the pool for the one that closed.
|
||||
this.createSocket(pending, function(socket) {
|
||||
pending.request.onSocket(socket);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function createSecureSocket(options, cb) {
|
||||
var self = this;
|
||||
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
|
||||
var hostHeader = options.request.getHeader('host');
|
||||
var tlsOptions = mergeOptions({}, self.options, {
|
||||
socket: socket,
|
||||
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
|
||||
});
|
||||
|
||||
// 0 is dummy port for v0.6
|
||||
var secureSocket = tls.connect(0, tlsOptions);
|
||||
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
|
||||
cb(secureSocket);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function toOptions(host, port, localAddress) {
|
||||
if (typeof host === 'string') { // since v0.10
|
||||
return {
|
||||
host: host,
|
||||
port: port,
|
||||
localAddress: localAddress
|
||||
};
|
||||
}
|
||||
return host; // for v0.11 or later
|
||||
}
|
||||
|
||||
function mergeOptions(target) {
|
||||
for (var i = 1, len = arguments.length; i < len; ++i) {
|
||||
var overrides = arguments[i];
|
||||
if (typeof overrides === 'object') {
|
||||
var keys = Object.keys(overrides);
|
||||
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
||||
var k = keys[j];
|
||||
if (overrides[k] !== undefined) {
|
||||
target[k] = overrides[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
var debug;
|
||||
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
||||
debug = function() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
if (typeof args[0] === 'string') {
|
||||
args[0] = 'TUNNEL: ' + args[0];
|
||||
} else {
|
||||
args.unshift('TUNNEL:');
|
||||
}
|
||||
console.error.apply(console, args);
|
||||
}
|
||||
} else {
|
||||
debug = function() {};
|
||||
}
|
||||
exports.debug = debug; // for test
|
64
node_modules/tunnel/package.json
generated
vendored
Normal file
64
node_modules/tunnel/package.json
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"_from": "tunnel@0.0.4",
|
||||
"_id": "tunnel@0.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=",
|
||||
"_location": "/tunnel",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "tunnel@0.0.4",
|
||||
"name": "tunnel",
|
||||
"escapedName": "tunnel",
|
||||
"rawSpec": "0.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/typed-rest-client"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz",
|
||||
"_shasum": "2d3785a158c174c9a16dc2c046ec5fc5f1742213",
|
||||
"_spec": "tunnel@0.0.4",
|
||||
"_where": "/Users/paul/src/gradle-related/gradle-wrapper-check/node_modules/typed-rest-client",
|
||||
"author": {
|
||||
"name": "Koichi Kobayashi",
|
||||
"email": "koichik@improvement.jp"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/koichik/node-tunnel/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Node HTTP/HTTPS Agents for tunneling proxies",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "./lib"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
},
|
||||
"homepage": "https://github.com/koichik/node-tunnel/",
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"agent",
|
||||
"proxy",
|
||||
"tunnel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"name": "tunnel",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/koichik/node-tunnel.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./node_modules/mocha/bin/mocha"
|
||||
},
|
||||
"version": "0.0.4"
|
||||
}
|
108
node_modules/tunnel/test/http-over-http.js
generated
vendored
Normal file
108
node_modules/tunnel/test/http-over-http.js
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
var http = require('http');
|
||||
var net = require('net');
|
||||
var should = require('should');
|
||||
var tunnel = require('../index');
|
||||
|
||||
describe('HTTP over HTTP', function() {
|
||||
it('should finish without error', function(done) {
|
||||
var serverPort = 3000;
|
||||
var proxyPort = 3001;
|
||||
var poolSize = 3;
|
||||
var N = 10;
|
||||
var serverConnect = 0;
|
||||
var proxyConnect = 0;
|
||||
var clientConnect = 0;
|
||||
var server;
|
||||
var proxy;
|
||||
var agent;
|
||||
|
||||
server = http.createServer(function(req, res) {
|
||||
tunnel.debug('SERVER: got request');
|
||||
++serverConnect;
|
||||
res.writeHead(200);
|
||||
res.end('Hello' + req.url);
|
||||
tunnel.debug('SERVER: sending response');
|
||||
});
|
||||
server.listen(serverPort, setupProxy);
|
||||
|
||||
function setupProxy() {
|
||||
proxy = http.createServer(function(req, res) {
|
||||
should.fail();
|
||||
});
|
||||
proxy.on('upgrade', onConnect); // for v0.6
|
||||
proxy.on('connect', onConnect); // for v0.7 or later
|
||||
|
||||
function onConnect(req, clientSocket, head) {
|
||||
tunnel.debug('PROXY: got CONNECT request');
|
||||
|
||||
req.method.should.equal('CONNECT');
|
||||
req.url.should.equal('localhost:' + serverPort);
|
||||
req.headers.should.not.have.property('transfer-encoding');
|
||||
req.headers.should.have.property('proxy-authorization',
|
||||
'Basic ' + new Buffer('user:password').toString('base64'));
|
||||
++proxyConnect;
|
||||
|
||||
tunnel.debug('PROXY: creating a tunnel');
|
||||
var serverSocket = net.connect(serverPort, function() {
|
||||
tunnel.debug('PROXY: replying to client CONNECT request');
|
||||
clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||
clientSocket.pipe(serverSocket);
|
||||
serverSocket.write(head);
|
||||
serverSocket.pipe(clientSocket);
|
||||
// workaround, see joyent/node#2524
|
||||
serverSocket.on('end', function() {
|
||||
clientSocket.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
proxy.listen(proxyPort, setupClient);
|
||||
}
|
||||
|
||||
function setupClient() {
|
||||
agent = tunnel.httpOverHttp({
|
||||
maxSockets: poolSize,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
proxyAuth: 'user:password'
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < N; ++i) {
|
||||
doClientRequest(i);
|
||||
}
|
||||
|
||||
function doClientRequest(i) {
|
||||
tunnel.debug('CLIENT: Making HTTP request (%d)', i);
|
||||
var req = http.get({
|
||||
port: serverPort,
|
||||
path: '/' + i,
|
||||
agent: agent
|
||||
}, function(res) {
|
||||
tunnel.debug('CLIENT: got HTTP response (%d)', i);
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', function(data) {
|
||||
data.should.equal('Hello/' + i);
|
||||
});
|
||||
res.on('end', function() {
|
||||
++clientConnect;
|
||||
if (clientConnect === N) {
|
||||
proxy.close();
|
||||
server.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
server.on('close', function() {
|
||||
serverConnect.should.equal(N);
|
||||
proxyConnect.should.equal(poolSize);
|
||||
clientConnect.should.equal(N);
|
||||
|
||||
agent.sockets.should.be.empty;
|
||||
agent.requests.should.be.empty;
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
130
node_modules/tunnel/test/http-over-https.js
generated
vendored
Normal file
130
node_modules/tunnel/test/http-over-https.js
generated
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var net = require('net');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var should = require('should');
|
||||
var tunnel = require('../index');
|
||||
|
||||
function readPem(file) {
|
||||
return fs.readFileSync(path.join('test/keys', file + '.pem'));
|
||||
}
|
||||
|
||||
var proxyKey = readPem('proxy1-key');
|
||||
var proxyCert = readPem('proxy1-cert');
|
||||
var proxyCA = readPem('ca2-cert');
|
||||
var clientKey = readPem('client1-key');
|
||||
var clientCert = readPem('client1-cert');
|
||||
var clientCA = readPem('ca3-cert');
|
||||
|
||||
describe('HTTP over HTTPS', function() {
|
||||
it('should finish without error', function(done) {
|
||||
var serverPort = 3004;
|
||||
var proxyPort = 3005;
|
||||
var poolSize = 3;
|
||||
var N = 10;
|
||||
var serverConnect = 0;
|
||||
var proxyConnect = 0;
|
||||
var clientConnect = 0;
|
||||
var server;
|
||||
var proxy;
|
||||
var agent;
|
||||
|
||||
server = http.createServer(function(req, res) {
|
||||
tunnel.debug('SERVER: got request');
|
||||
++serverConnect;
|
||||
res.writeHead(200);
|
||||
res.end('Hello' + req.url);
|
||||
tunnel.debug('SERVER: sending response');
|
||||
});
|
||||
server.listen(serverPort, setupProxy);
|
||||
|
||||
function setupProxy() {
|
||||
proxy = https.createServer({
|
||||
key: proxyKey,
|
||||
cert: proxyCert,
|
||||
ca: [clientCA],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true
|
||||
}, function(req, res) {
|
||||
should.fail();
|
||||
});
|
||||
proxy.on('upgrade', onConnect); // for v0.6
|
||||
proxy.on('connect', onConnect); // for v0.7 or later
|
||||
|
||||
function onConnect(req, clientSocket, head) {
|
||||
tunnel.debug('PROXY: got CONNECT request');
|
||||
|
||||
req.method.should.equal('CONNECT');
|
||||
req.url.should.equal('localhost:' + serverPort);
|
||||
req.headers.should.not.have.property('transfer-encoding');
|
||||
++proxyConnect;
|
||||
|
||||
tunnel.debug('PROXY: creating a tunnel');
|
||||
var serverSocket = net.connect(serverPort, function() {
|
||||
tunnel.debug('PROXY: replying to client CONNECT request');
|
||||
clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||
clientSocket.pipe(serverSocket);
|
||||
serverSocket.write(head);
|
||||
serverSocket.pipe(clientSocket);
|
||||
// workaround, see joyent/node#2524
|
||||
serverSocket.on('end', function() {
|
||||
clientSocket.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
proxy.listen(proxyPort, setupClient);
|
||||
}
|
||||
|
||||
function setupClient() {
|
||||
agent = tunnel.httpOverHttps({
|
||||
maxSockets: poolSize,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
key: clientKey,
|
||||
cert: clientCert,
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < N; ++i) {
|
||||
doClientRequest(i);
|
||||
}
|
||||
|
||||
function doClientRequest(i) {
|
||||
tunnel.debug('CLIENT: Making HTTP request (%d)', i);
|
||||
var req = http.get({
|
||||
port: serverPort,
|
||||
path: '/' + i,
|
||||
agent: agent
|
||||
}, function(res) {
|
||||
tunnel.debug('CLIENT: got HTTP response (%d)', i);
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', function(data) {
|
||||
data.should.equal('Hello/' + i);
|
||||
});
|
||||
res.on('end', function() {
|
||||
++clientConnect;
|
||||
if (clientConnect === N) {
|
||||
proxy.close();
|
||||
server.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
server.on('close', function() {
|
||||
serverConnect.should.equal(N);
|
||||
proxyConnect.should.equal(poolSize);
|
||||
clientConnect.should.equal(N);
|
||||
|
||||
var name = 'localhost:' + serverPort;
|
||||
agent.sockets.should.be.empty;
|
||||
agent.requests.should.be.empty;
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
130
node_modules/tunnel/test/https-over-http.js
generated
vendored
Normal file
130
node_modules/tunnel/test/https-over-http.js
generated
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var net = require('net');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var should = require('should');
|
||||
var tunnel = require('../index');
|
||||
|
||||
function readPem(file) {
|
||||
return fs.readFileSync(path.join('test/keys', file + '.pem'));
|
||||
}
|
||||
|
||||
var serverKey = readPem('server1-key');
|
||||
var serverCert = readPem('server1-cert');
|
||||
var serverCA = readPem('ca1-cert');
|
||||
var clientKey = readPem('client1-key');
|
||||
var clientCert = readPem('client1-cert');
|
||||
var clientCA = readPem('ca3-cert');
|
||||
|
||||
|
||||
describe('HTTPS over HTTP', function() {
|
||||
it('should finish without error', function(done) {
|
||||
var serverPort = 3002;
|
||||
var proxyPort = 3003;
|
||||
var poolSize = 3;
|
||||
var N = 10;
|
||||
var serverConnect = 0;
|
||||
var proxyConnect = 0;
|
||||
var clientConnect = 0;
|
||||
var server;
|
||||
var proxy;
|
||||
var agent;
|
||||
|
||||
server = https.createServer({
|
||||
key: serverKey,
|
||||
cert: serverCert,
|
||||
ca: [clientCA],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true
|
||||
}, function(req, res) {
|
||||
tunnel.debug('SERVER: got request');
|
||||
++serverConnect;
|
||||
res.writeHead(200);
|
||||
res.end('Hello' + req.url);
|
||||
tunnel.debug('SERVER: sending response');
|
||||
});
|
||||
server.listen(serverPort, setupProxy);
|
||||
|
||||
function setupProxy() {
|
||||
proxy = http.createServer(function(req, res) {
|
||||
should.fail();
|
||||
});
|
||||
proxy.on('upgrade', onConnect); // for v0.6
|
||||
proxy.on('connect', onConnect); // for v0.7 or later
|
||||
|
||||
function onConnect(req, clientSocket, head) {
|
||||
tunnel.debug('PROXY: got CONNECT request');
|
||||
|
||||
req.method.should.equal('CONNECT');
|
||||
req.url.should.equal('localhost:' + serverPort);
|
||||
req.headers.should.not.have.property('transfer-encoding');
|
||||
++proxyConnect;
|
||||
|
||||
var serverSocket = net.connect(serverPort, function() {
|
||||
tunnel.debug('PROXY: replying to client CONNECT request');
|
||||
clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||
clientSocket.pipe(serverSocket);
|
||||
serverSocket.write(head);
|
||||
serverSocket.pipe(clientSocket);
|
||||
// workaround, see joyent/node#2524
|
||||
serverSocket.on('end', function() {
|
||||
clientSocket.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
proxy.listen(proxyPort, setupClient);
|
||||
}
|
||||
|
||||
function setupClient() {
|
||||
agent = tunnel.httpsOverHttp({
|
||||
maxSockets: poolSize,
|
||||
key: clientKey,
|
||||
cert: clientCert,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
proxy: {
|
||||
port: proxyPort
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < N; ++i) {
|
||||
doClientRequest(i);
|
||||
}
|
||||
|
||||
function doClientRequest(i) {
|
||||
tunnel.debug('CLIENT: Making HTTPS request (%d)', i);
|
||||
var req = https.get({
|
||||
port: serverPort,
|
||||
path: '/' + i,
|
||||
agent: agent
|
||||
}, function(res) {
|
||||
tunnel.debug('CLIENT: got HTTPS response (%d)', i);
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', function(data) {
|
||||
data.should.equal('Hello/' + i);
|
||||
});
|
||||
res.on('end', function() {
|
||||
++clientConnect;
|
||||
if (clientConnect === N) {
|
||||
proxy.close();
|
||||
server.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
server.on('close', function() {
|
||||
serverConnect.should.equal(N);
|
||||
proxyConnect.should.equal(poolSize);
|
||||
clientConnect.should.equal(N);
|
||||
|
||||
var name = 'localhost:' + serverPort;
|
||||
agent.sockets.should.be.empty;
|
||||
agent.requests.should.be.empty;
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
261
node_modules/tunnel/test/https-over-https-error.js
generated
vendored
Normal file
261
node_modules/tunnel/test/https-over-https-error.js
generated
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var net = require('net');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var should = require('should');
|
||||
var tunnel = require('../index');
|
||||
|
||||
function readPem(file) {
|
||||
return fs.readFileSync(path.join('test/keys', file + '.pem'));
|
||||
}
|
||||
|
||||
var serverKey = readPem('server2-key');
|
||||
var serverCert = readPem('server2-cert');
|
||||
var serverCA = readPem('ca1-cert');
|
||||
var proxyKey = readPem('proxy2-key');
|
||||
var proxyCert = readPem('proxy2-cert');
|
||||
var proxyCA = readPem('ca2-cert');
|
||||
var client1Key = readPem('client1-key');
|
||||
var client1Cert = readPem('client1-cert');
|
||||
var client1CA = readPem('ca3-cert');
|
||||
var client2Key = readPem('client2-key');
|
||||
var client2Cert = readPem('client2-cert');
|
||||
var client2CA = readPem('ca4-cert');
|
||||
|
||||
describe('HTTPS over HTTPS authentication failed', function() {
|
||||
it('should finish without error', function(done) {
|
||||
var serverPort = 3008;
|
||||
var proxyPort = 3009;
|
||||
var serverConnect = 0;
|
||||
var proxyConnect = 0;
|
||||
var clientRequest = 0;
|
||||
var clientConnect = 0;
|
||||
var clientError = 0;
|
||||
var server;
|
||||
var proxy;
|
||||
|
||||
server = https.createServer({
|
||||
key: serverKey,
|
||||
cert: serverCert,
|
||||
ca: [client1CA],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true
|
||||
}, function(req, res) {
|
||||
tunnel.debug('SERVER: got request', req.url);
|
||||
++serverConnect;
|
||||
req.on('data', function(data) {
|
||||
});
|
||||
req.on('end', function() {
|
||||
res.writeHead(200);
|
||||
res.end('Hello, ' + serverConnect);
|
||||
tunnel.debug('SERVER: sending response');
|
||||
});
|
||||
req.resume();
|
||||
});
|
||||
//server.addContext('server2', {
|
||||
// key: serverKey,
|
||||
// cert: serverCert,
|
||||
// ca: [client1CA],
|
||||
//});
|
||||
server.listen(serverPort, setupProxy);
|
||||
|
||||
function setupProxy() {
|
||||
proxy = https.createServer({
|
||||
key: proxyKey,
|
||||
cert: proxyCert,
|
||||
ca: [client2CA],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true
|
||||
}, function(req, res) {
|
||||
should.fail();
|
||||
});
|
||||
//proxy.addContext('proxy2', {
|
||||
// key: proxyKey,
|
||||
// cert: proxyCert,
|
||||
// ca: [client2CA],
|
||||
//});
|
||||
proxy.on('upgrade', onConnect); // for v0.6
|
||||
proxy.on('connect', onConnect); // for v0.7 or later
|
||||
|
||||
function onConnect(req, clientSocket, head) {
|
||||
req.method.should.equal('CONNECT');
|
||||
req.url.should.equal('localhost:' + serverPort);
|
||||
req.headers.should.not.have.property('transfer-encoding');
|
||||
++proxyConnect;
|
||||
|
||||
var serverSocket = net.connect(serverPort, function() {
|
||||
tunnel.debug('PROXY: replying to client CONNECT request');
|
||||
clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||
clientSocket.pipe(serverSocket);
|
||||
serverSocket.write(head);
|
||||
serverSocket.pipe(clientSocket);
|
||||
// workaround, see #2524
|
||||
serverSocket.on('end', function() {
|
||||
clientSocket.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
proxy.listen(proxyPort, setupClient);
|
||||
}
|
||||
|
||||
function setupClient() {
|
||||
function doRequest(name, options, host) {
|
||||
tunnel.debug('CLIENT: Making HTTPS request (%s)', name);
|
||||
++clientRequest;
|
||||
var agent = tunnel.httpsOverHttps(options);
|
||||
var req = https.get({
|
||||
host: 'localhost',
|
||||
port: serverPort,
|
||||
path: '/' + encodeURIComponent(name),
|
||||
headers: {
|
||||
host: host ? host : 'localhost',
|
||||
},
|
||||
rejectUnauthorized: true,
|
||||
agent: agent
|
||||
}, function(res) {
|
||||
tunnel.debug('CLIENT: got HTTPS response (%s)', name);
|
||||
++clientConnect;
|
||||
res.on('data', function(data) {
|
||||
});
|
||||
res.on('end', function() {
|
||||
req.emit('finish');
|
||||
});
|
||||
res.resume();
|
||||
});
|
||||
req.on('error', function(err) {
|
||||
tunnel.debug('CLIENT: failed HTTP response (%s)', name, err);
|
||||
++clientError;
|
||||
req.emit('finish');
|
||||
});
|
||||
req.on('finish', function() {
|
||||
if (clientConnect + clientError === clientRequest) {
|
||||
proxy.close();
|
||||
server.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
doRequest('no cert origin nor proxy', { // invalid
|
||||
maxSockets: 1,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
// no certificate for origin server
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true,
|
||||
headers: {
|
||||
host: 'proxy2'
|
||||
}
|
||||
// no certificate for proxy
|
||||
}
|
||||
}, 'server2');
|
||||
|
||||
doRequest('no cert proxy', { // invalid
|
||||
maxSockets: 1,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
// client certification for origin server
|
||||
key: client1Key,
|
||||
cert: client1Cert,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true,
|
||||
headers: {
|
||||
host: 'proxy2'
|
||||
}
|
||||
// no certificate for proxy
|
||||
}
|
||||
}, 'server2');
|
||||
|
||||
doRequest('no cert origin', { // invalid
|
||||
maxSockets: 1,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
// no certificate for origin server
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
servername: 'proxy2',
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true,
|
||||
headers: {
|
||||
host: 'proxy2'
|
||||
},
|
||||
// client certification for proxy
|
||||
key: client2Key,
|
||||
cert: client2Cert
|
||||
}
|
||||
}, 'server2');
|
||||
|
||||
doRequest('invalid proxy server name', { // invalid
|
||||
maxSockets: 1,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
// client certification for origin server
|
||||
key: client1Key,
|
||||
cert: client1Cert,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true,
|
||||
// client certification for proxy
|
||||
key: client2Key,
|
||||
cert: client2Cert,
|
||||
}
|
||||
}, 'server2');
|
||||
|
||||
doRequest('invalid origin server name', { // invalid
|
||||
maxSockets: 1,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
// client certification for origin server
|
||||
key: client1Key,
|
||||
cert: client1Cert,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
servername: 'proxy2',
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true,
|
||||
headers: {
|
||||
host: 'proxy2'
|
||||
},
|
||||
// client certification for proxy
|
||||
key: client2Key,
|
||||
cert: client2Cert
|
||||
}
|
||||
});
|
||||
|
||||
doRequest('valid', { // valid
|
||||
maxSockets: 1,
|
||||
ca: [serverCA],
|
||||
rejectUnauthorized: true,
|
||||
// client certification for origin server
|
||||
key: client1Key,
|
||||
cert: client1Cert,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
servername: 'proxy2',
|
||||
ca: [proxyCA],
|
||||
rejectUnauthorized: true,
|
||||
headers: {
|
||||
host: 'proxy2'
|
||||
},
|
||||
// client certification for proxy
|
||||
key: client2Key,
|
||||
cert: client2Cert
|
||||
}
|
||||
}, 'server2');
|
||||
}
|
||||
|
||||
server.on('close', function() {
|
||||
serverConnect.should.equal(1);
|
||||
proxyConnect.should.equal(3);
|
||||
clientConnect.should.equal(1);
|
||||
clientError.should.equal(5);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
146
node_modules/tunnel/test/https-over-https.js
generated
vendored
Normal file
146
node_modules/tunnel/test/https-over-https.js
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var net = require('net');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var should = require('should');
|
||||
var tunnel = require('../index.js');
|
||||
|
||||
function readPem(file) {
|
||||
return fs.readFileSync(path.join('test/keys', file + '.pem'));
|
||||
}
|
||||
|
||||
var serverKey = readPem('server1-key');
|
||||
var serverCert = readPem('server1-cert');
|
||||
var serverCA = readPem('ca1-cert');
|
||||
var proxyKey = readPem('proxy1-key');
|
||||
var proxyCert = readPem('proxy1-cert');
|
||||
var proxyCA = readPem('ca2-cert');
|
||||
var client1Key = readPem('client1-key');
|
||||
var client1Cert = readPem('client1-cert');
|
||||
var client1CA = readPem('ca3-cert');
|
||||
var client2Key = readPem('client2-key');
|
||||
var client2Cert = readPem('client2-cert');
|
||||
var client2CA = readPem('ca4-cert');
|
||||
|
||||
describe('HTTPS over HTTPS', function() {
|
||||
it('should finish without error', function(done) {
|
||||
var serverPort = 3006;
|
||||
var proxyPort = 3007;
|
||||
var poolSize = 3;
|
||||
var N = 5;
|
||||
var serverConnect = 0;
|
||||
var proxyConnect = 0;
|
||||
var clientConnect = 0;
|
||||
var server;
|
||||
var proxy;
|
||||
var agent;
|
||||
|
||||
server = https.createServer({
|
||||
key: serverKey,
|
||||
cert: serverCert,
|
||||
ca: [client1CA],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true
|
||||
}, function(req, res) {
|
||||
tunnel.debug('SERVER: got request');
|
||||
++serverConnect;
|
||||
res.writeHead(200);
|
||||
res.end('Hello' + req.url);
|
||||
tunnel.debug('SERVER: sending response');
|
||||
});
|
||||
server.listen(serverPort, setupProxy);
|
||||
|
||||
function setupProxy() {
|
||||
proxy = https.createServer({
|
||||
key: proxyKey,
|
||||
cert: proxyCert,
|
||||
ca: [client2CA],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true
|
||||
}, function(req, res) {
|
||||
should.fail();
|
||||
});
|
||||
proxy.on('upgrade', onConnect); // for v0.6
|
||||
proxy.on('connect', onConnect); // for v0.7 or later
|
||||
|
||||
function onConnect(req, clientSocket, head) {
|
||||
tunnel.debug('PROXY: got CONNECT request');
|
||||
req.method.should.equal('CONNECT');
|
||||
req.url.should.equal('localhost:' + serverPort);
|
||||
req.headers.should.not.have.property('transfer-encoding');
|
||||
++proxyConnect;
|
||||
|
||||
var serverSocket = net.connect(serverPort, function() {
|
||||
tunnel.debug('PROXY: replying to client CONNECT request');
|
||||
clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||
clientSocket.pipe(serverSocket);
|
||||
serverSocket.write(head);
|
||||
serverSocket.pipe(clientSocket);
|
||||
// workaround, see joyent/node#2524
|
||||
serverSocket.on('end', function() {
|
||||
clientSocket.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
proxy.listen(proxyPort, setupClient);
|
||||
}
|
||||
|
||||
function setupClient() {
|
||||
agent = tunnel.httpsOverHttps({
|
||||
maxSockets: poolSize,
|
||||
// client certification for origin server
|
||||
key: client1Key,
|
||||
cert: client1Cert,
|
||||
ca: [serverCA],
|
||||
rejectUnauthroized: true,
|
||||
proxy: {
|
||||
port: proxyPort,
|
||||
// client certification for proxy
|
||||
key: client2Key,
|
||||
cert: client2Cert,
|
||||
ca: [proxyCA],
|
||||
rejectUnauthroized: true
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < N; ++i) {
|
||||
doClientRequest(i);
|
||||
}
|
||||
|
||||
function doClientRequest(i) {
|
||||
tunnel.debug('CLIENT: Making HTTPS request (%d)', i);
|
||||
var req = https.get({
|
||||
port: serverPort,
|
||||
path: '/' + i,
|
||||
agent: agent
|
||||
}, function(res) {
|
||||
tunnel.debug('CLIENT: got HTTPS response (%d)', i);
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', function(data) {
|
||||
data.should.equal('Hello/' + i);
|
||||
});
|
||||
res.on('end', function() {
|
||||
++clientConnect;
|
||||
if (clientConnect === N) {
|
||||
proxy.close();
|
||||
server.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
server.on('close', function() {
|
||||
serverConnect.should.equal(N);
|
||||
proxyConnect.should.equal(poolSize);
|
||||
clientConnect.should.equal(N);
|
||||
|
||||
var name = 'localhost:' + serverPort;
|
||||
agent.sockets.should.be.empty;
|
||||
agent.requests.should.be.empty;
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
157
node_modules/tunnel/test/keys/Makefile
generated
vendored
Normal file
157
node_modules/tunnel/test/keys/Makefile
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
all: server1-cert.pem server2-cert.pem proxy1-cert.pem proxy2-cert.pem client1-cert.pem client2-cert.pem
|
||||
|
||||
|
||||
#
|
||||
# Create Certificate Authority: ca1
|
||||
# ('password' is used for the CA password.)
|
||||
#
|
||||
ca1-cert.pem: ca1.cnf
|
||||
openssl req -new -x509 -days 9999 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem
|
||||
|
||||
#
|
||||
# Create Certificate Authority: ca2
|
||||
# ('password' is used for the CA password.)
|
||||
#
|
||||
ca2-cert.pem: ca2.cnf
|
||||
openssl req -new -x509 -days 9999 -config ca2.cnf -keyout ca2-key.pem -out ca2-cert.pem
|
||||
|
||||
#
|
||||
# Create Certificate Authority: ca3
|
||||
# ('password' is used for the CA password.)
|
||||
#
|
||||
ca3-cert.pem: ca3.cnf
|
||||
openssl req -new -x509 -days 9999 -config ca3.cnf -keyout ca3-key.pem -out ca3-cert.pem
|
||||
|
||||
#
|
||||
# Create Certificate Authority: ca4
|
||||
# ('password' is used for the CA password.)
|
||||
#
|
||||
ca4-cert.pem: ca4.cnf
|
||||
openssl req -new -x509 -days 9999 -config ca4.cnf -keyout ca4-key.pem -out ca4-cert.pem
|
||||
|
||||
|
||||
#
|
||||
# server1 is signed by ca1.
|
||||
#
|
||||
server1-key.pem:
|
||||
openssl genrsa -out server1-key.pem 1024
|
||||
|
||||
server1-csr.pem: server1.cnf server1-key.pem
|
||||
openssl req -new -config server1.cnf -key server1-key.pem -out server1-csr.pem
|
||||
|
||||
server1-cert.pem: server1-csr.pem ca1-cert.pem ca1-key.pem
|
||||
openssl x509 -req \
|
||||
-days 9999 \
|
||||
-passin "pass:password" \
|
||||
-in server1-csr.pem \
|
||||
-CA ca1-cert.pem \
|
||||
-CAkey ca1-key.pem \
|
||||
-CAcreateserial \
|
||||
-out server1-cert.pem
|
||||
|
||||
#
|
||||
# server2 is signed by ca1.
|
||||
#
|
||||
server2-key.pem:
|
||||
openssl genrsa -out server2-key.pem 1024
|
||||
|
||||
server2-csr.pem: server2.cnf server2-key.pem
|
||||
openssl req -new -config server2.cnf -key server2-key.pem -out server2-csr.pem
|
||||
|
||||
server2-cert.pem: server2-csr.pem ca1-cert.pem ca1-key.pem
|
||||
openssl x509 -req \
|
||||
-days 9999 \
|
||||
-passin "pass:password" \
|
||||
-in server2-csr.pem \
|
||||
-CA ca1-cert.pem \
|
||||
-CAkey ca1-key.pem \
|
||||
-CAcreateserial \
|
||||
-out server2-cert.pem
|
||||
|
||||
server2-verify: server2-cert.pem ca1-cert.pem
|
||||
openssl verify -CAfile ca1-cert.pem server2-cert.pem
|
||||
|
||||
#
|
||||
# proxy1 is signed by ca2.
|
||||
#
|
||||
proxy1-key.pem:
|
||||
openssl genrsa -out proxy1-key.pem 1024
|
||||
|
||||
proxy1-csr.pem: proxy1.cnf proxy1-key.pem
|
||||
openssl req -new -config proxy1.cnf -key proxy1-key.pem -out proxy1-csr.pem
|
||||
|
||||
proxy1-cert.pem: proxy1-csr.pem ca2-cert.pem ca2-key.pem
|
||||
openssl x509 -req \
|
||||
-days 9999 \
|
||||
-passin "pass:password" \
|
||||
-in proxy1-csr.pem \
|
||||
-CA ca2-cert.pem \
|
||||
-CAkey ca2-key.pem \
|
||||
-CAcreateserial \
|
||||
-out proxy1-cert.pem
|
||||
|
||||
#
|
||||
# proxy2 is signed by ca2.
|
||||
#
|
||||
proxy2-key.pem:
|
||||
openssl genrsa -out proxy2-key.pem 1024
|
||||
|
||||
proxy2-csr.pem: proxy2.cnf proxy2-key.pem
|
||||
openssl req -new -config proxy2.cnf -key proxy2-key.pem -out proxy2-csr.pem
|
||||
|
||||
proxy2-cert.pem: proxy2-csr.pem ca2-cert.pem ca2-key.pem
|
||||
openssl x509 -req \
|
||||
-days 9999 \
|
||||
-passin "pass:password" \
|
||||
-in proxy2-csr.pem \
|
||||
-CA ca2-cert.pem \
|
||||
-CAkey ca2-key.pem \
|
||||
-CAcreateserial \
|
||||
-out proxy2-cert.pem
|
||||
|
||||
proxy2-verify: proxy2-cert.pem ca2-cert.pem
|
||||
openssl verify -CAfile ca2-cert.pem proxy2-cert.pem
|
||||
|
||||
#
|
||||
# client1 is signed by ca3.
|
||||
#
|
||||
client1-key.pem:
|
||||
openssl genrsa -out client1-key.pem 1024
|
||||
|
||||
client1-csr.pem: client1.cnf client1-key.pem
|
||||
openssl req -new -config client1.cnf -key client1-key.pem -out client1-csr.pem
|
||||
|
||||
client1-cert.pem: client1-csr.pem ca3-cert.pem ca3-key.pem
|
||||
openssl x509 -req \
|
||||
-days 9999 \
|
||||
-passin "pass:password" \
|
||||
-in client1-csr.pem \
|
||||
-CA ca3-cert.pem \
|
||||
-CAkey ca3-key.pem \
|
||||
-CAcreateserial \
|
||||
-out client1-cert.pem
|
||||
|
||||
#
|
||||
# client2 is signed by ca4.
|
||||
#
|
||||
client2-key.pem:
|
||||
openssl genrsa -out client2-key.pem 1024
|
||||
|
||||
client2-csr.pem: client2.cnf client2-key.pem
|
||||
openssl req -new -config client2.cnf -key client2-key.pem -out client2-csr.pem
|
||||
|
||||
client2-cert.pem: client2-csr.pem ca4-cert.pem ca4-key.pem
|
||||
openssl x509 -req \
|
||||
-days 9999 \
|
||||
-passin "pass:password" \
|
||||
-in client2-csr.pem \
|
||||
-CA ca4-cert.pem \
|
||||
-CAkey ca4-key.pem \
|
||||
-CAcreateserial \
|
||||
-out client2-cert.pem
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.pem *.srl
|
||||
|
||||
test: client-verify server2-verify proxy1-verify proxy2-verify client-verify
|
14
node_modules/tunnel/test/keys/agent1-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/agent1-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKjCCAZMCCQDQ8o4kHKdCPDANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV
|
||||
UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
|
||||
BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqGSIb3DQEJARYRcnlA
|
||||
dGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEyWjB9
|
||||
MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK
|
||||
EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MTEgMB4G
|
||||
CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEFAANL
|
||||
ADBIAkEAnzpAqcoXZxWJz/WFK7BXwD23jlREyG11x7gkydteHvn6PrVBbB5yfu6c
|
||||
bk8w3/Ar608AcyMQ9vHjkLQKH7cjEQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAKha
|
||||
HqjCfTIut+m/idKy3AoFh48tBHo3p9Nl5uBjQJmahKdZAaiksL24Pl+NzPQ8LIU+
|
||||
FyDHFp6OeJKN6HzZ72Bh9wpBVu6Uj1hwhZhincyTXT80wtSI/BoUAW8Ls2kwPdus
|
||||
64LsJhhxqj2m4vPKNRbHB2QxnNrGi30CUf3kt3Ia
|
||||
-----END CERTIFICATE-----
|
10
node_modules/tunnel/test/keys/agent1-csr.pem
generated
vendored
Normal file
10
node_modules/tunnel/test/keys/agent1-csr.pem
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
|
||||
EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
|
||||
EwZhZ2VudDExIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
|
||||
KoZIhvcNAQEBBQADSwAwSAJBAJ86QKnKF2cVic/1hSuwV8A9t45URMhtdce4JMnb
|
||||
Xh75+j61QWwecn7unG5PMN/wK+tPAHMjEPbx45C0Ch+3IxECAwEAAaAlMCMGCSqG
|
||||
SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
|
||||
AF+AfG64hNyYHum46m6i7RgnUBrJSOynGjs23TekV4he3QdMSAAPPqbll8W14+y3
|
||||
vOo7/yQ2v2uTqxCjakUNPPs=
|
||||
-----END CERTIFICATE REQUEST-----
|
9
node_modules/tunnel/test/keys/agent1-key.pem
generated
vendored
Normal file
9
node_modules/tunnel/test/keys/agent1-key.pem
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBOwIBAAJBAJ86QKnKF2cVic/1hSuwV8A9t45URMhtdce4JMnbXh75+j61QWwe
|
||||
cn7unG5PMN/wK+tPAHMjEPbx45C0Ch+3IxECAwEAAQJBAI2cU1IuR+4IO87WPyAB
|
||||
76kruoo87AeNQkjjvuQ/00+b/6IS45mcEP5Kw0NukbqBhIw2di9uQ9J51DJ/ZfQr
|
||||
+YECIQDUHaN3ZjIdJ7/w8Yq9Zzz+3kY2F/xEz6e4ftOFW8bY2QIhAMAref+WYckC
|
||||
oECgOLAvAxB1lI4j7oCbAaawfxKdnPj5AiEAi95rXx09aGpAsBGmSdScrPdG1v6j
|
||||
83/2ebrvoZ1uFqkCIB0AssnrRVjUB6GZTNTyU3ERfdkx/RX1zvr8WkFR/lXpAiB7
|
||||
cUZ1i8ZkZrPrdVgw2cb28UJM7qZHQnXcMHTXFFvxeQ==
|
||||
-----END RSA PRIVATE KEY-----
|
19
node_modules/tunnel/test/keys/agent1.cnf
generated
vendored
Normal file
19
node_modules/tunnel/test/keys/agent1.cnf
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = US
|
||||
ST = CA
|
||||
L = SF
|
||||
O = Joyent
|
||||
OU = Node.js
|
||||
CN = agent1
|
||||
emailAddress = ry@tinyclouds.org
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
13
node_modules/tunnel/test/keys/agent2-cert.pem
generated
vendored
Normal file
13
node_modules/tunnel/test/keys/agent2-cert.pem
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB7DCCAZYCCQC7gs0MDNn6MTANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV
|
||||
UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
|
||||
BgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR
|
||||
cnlAdGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEy
|
||||
WjB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYD
|
||||
VQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEg
|
||||
MB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEF
|
||||
AANLADBIAkEAyXb8FrRdKbhrKLgLSsn61i1C7w7fVVVd7OQsmV/7p9WB2lWFiDlC
|
||||
WKGU9SiIz/A6wNZDUAuc2E+VwtpCT561AQIDAQABMA0GCSqGSIb3DQEBBQUAA0EA
|
||||
C8HzpuNhFLCI3A5KkBS5zHAQax6TFUOhbpBCR0aTDbJ6F1liDTK1lmU/BjvPoj+9
|
||||
1LHwrmh29rK8kBPEjmymCQ==
|
||||
-----END CERTIFICATE-----
|
10
node_modules/tunnel/test/keys/agent2-csr.pem
generated
vendored
Normal file
10
node_modules/tunnel/test/keys/agent2-csr.pem
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
|
||||
EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
|
||||
EwZhZ2VudDIxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
|
||||
KoZIhvcNAQEBBQADSwAwSAJBAMl2/Ba0XSm4ayi4C0rJ+tYtQu8O31VVXezkLJlf
|
||||
+6fVgdpVhYg5QlihlPUoiM/wOsDWQ1ALnNhPlcLaQk+etQECAwEAAaAlMCMGCSqG
|
||||
SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
|
||||
AJnll2pt5l0pzskQSpjjLVTlFDFmJr/AZ3UK8v0WxBjYjCe5Jx4YehkChpxIyDUm
|
||||
U3J9q9MDUf0+Y2+EGkssFfk=
|
||||
-----END CERTIFICATE REQUEST-----
|
9
node_modules/tunnel/test/keys/agent2-key.pem
generated
vendored
Normal file
9
node_modules/tunnel/test/keys/agent2-key.pem
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBOgIBAAJBAMl2/Ba0XSm4ayi4C0rJ+tYtQu8O31VVXezkLJlf+6fVgdpVhYg5
|
||||
QlihlPUoiM/wOsDWQ1ALnNhPlcLaQk+etQECAwEAAQJBAMT6Bf34+UHKY1ObpsbH
|
||||
9u2jsVblFq1rWvs8GPMY6oertzvwm3DpuSUp7PTgOB1nLTLYtCERbQ4ovtN8tn3p
|
||||
OHUCIQDzIEGsoCr5vlxXvy2zJwu+fxYuhTZWMVuo1397L0VyhwIhANQh+yzqUgaf
|
||||
WRtSB4T2W7ADtJI35ET61jKBty3CqJY3AiAIwju7dVW3A5WeD6Qc1SZGKZvp9yCb
|
||||
AFI2BfVwwaY11wIgXF3PeGcvACMyMWsuSv7aPXHfliswAbkWuzcwA4TW01ECIGWa
|
||||
cgsDvVFxmfM5NPSuT/UDTa6R5BFISB5ea0N0AR3I
|
||||
-----END RSA PRIVATE KEY-----
|
19
node_modules/tunnel/test/keys/agent2.cnf
generated
vendored
Normal file
19
node_modules/tunnel/test/keys/agent2.cnf
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = US
|
||||
ST = CA
|
||||
L = SF
|
||||
O = Joyent
|
||||
OU = Node.js
|
||||
CN = agent2
|
||||
emailAddress = ry@tinyclouds.org
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/agent3-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/agent3-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKjCCAZMCCQCDBr594bsJmTANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV
|
||||
UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO
|
||||
BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA
|
||||
dGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEyWjB9
|
||||
MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK
|
||||
EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MzEgMB4G
|
||||
CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEFAANL
|
||||
ADBIAkEAtlNDZ+bHeBI0B2gD/IWqA7Aq1hwsnS4+XpnLesjTQcL2JwFFpkR0oWrw
|
||||
yjrYhCogi7c5gjKrLZF1d2JD5JgHgQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJoK
|
||||
bXwsImk7vJz9649yrmsXwnuGbEKVYMvqcGyjaZNP9lYEG41y5CeRzxhWy2rlYdhE
|
||||
f2nqE2lg75oJP7LQqfQY7aCqwahM3q/GQbsfKVCGjF7TVyq9TQzd8iW+FEJIQzSE
|
||||
3aN85hR67+3VAXeSzmkGSVBO2m1SJIug4qftIkc2
|
||||
-----END CERTIFICATE-----
|
10
node_modules/tunnel/test/keys/agent3-csr.pem
generated
vendored
Normal file
10
node_modules/tunnel/test/keys/agent3-csr.pem
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
|
||||
EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
|
||||
EwZhZ2VudDMxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
|
||||
KoZIhvcNAQEBBQADSwAwSAJBALZTQ2fmx3gSNAdoA/yFqgOwKtYcLJ0uPl6Zy3rI
|
||||
00HC9icBRaZEdKFq8Mo62IQqIIu3OYIyqy2RdXdiQ+SYB4ECAwEAAaAlMCMGCSqG
|
||||
SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
|
||||
AEGo76iH+a8pnE+RWQT+wg9/BL+iIuqrcFXLs0rbGonqderrwXAe15ODwql/Bfu3
|
||||
zgMt8ooTsgMPcMX9EgmubEM=
|
||||
-----END CERTIFICATE REQUEST-----
|
9
node_modules/tunnel/test/keys/agent3-key.pem
generated
vendored
Normal file
9
node_modules/tunnel/test/keys/agent3-key.pem
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBOwIBAAJBALZTQ2fmx3gSNAdoA/yFqgOwKtYcLJ0uPl6Zy3rI00HC9icBRaZE
|
||||
dKFq8Mo62IQqIIu3OYIyqy2RdXdiQ+SYB4ECAwEAAQJAIk+G9s2SKgFa8y3a2jGZ
|
||||
LfqABSzmJGooaIsOpLuYLd6eCC31XUDlT4rPVGRhysKQCQ4+NMjgdnj9ZqNnvXY/
|
||||
RQIhAOgbdltr3Ey2hy7RuDW5rmOeJTuVqCrZ7QI8ifyCEbYTAiEAyRfvWSvvASeP
|
||||
kZTMUhATRUpuyDQW+058NE0oJSinTpsCIQCR/FPhBGI3TcaQyA9Ym0T4GwvIAkUX
|
||||
TqInefRAAX8qSQIgZVJPAdIWGbHSL9sWW97HpukLCorcbYEtKbkamiZyrjMCIQCX
|
||||
lX76ttkeId5OsJGQcF67eFMMr2UGZ1WMf6M39lCYHQ==
|
||||
-----END RSA PRIVATE KEY-----
|
19
node_modules/tunnel/test/keys/agent3.cnf
generated
vendored
Normal file
19
node_modules/tunnel/test/keys/agent3.cnf
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = US
|
||||
ST = CA
|
||||
L = SF
|
||||
O = Joyent
|
||||
OU = Node.js
|
||||
CN = agent3
|
||||
emailAddress = ry@tinyclouds.org
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
15
node_modules/tunnel/test/keys/agent4-cert.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/agent4-cert.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICSDCCAbGgAwIBAgIJAIMGvn3huwmaMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV
|
||||
BAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzANBgNVBAoTBkpveWVu
|
||||
dDEQMA4GA1UECxMHTm9kZS5qczEMMAoGA1UEAxMDY2EyMSAwHgYJKoZIhvcNAQkB
|
||||
FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xMTAzMTQxODI5MTJaFw0zODA3MjkxODI5
|
||||
MTJaMH0xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzAN
|
||||
BgNVBAoTBkpveWVudDEQMA4GA1UECxMHTm9kZS5qczEPMA0GA1UEAxMGYWdlbnQ0
|
||||
MSAwHgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzBcMA0GCSqGSIb3DQEB
|
||||
AQUAA0sAMEgCQQDN/yMfmQ8zdvmjlGk7b3Mn6wY2FjaMb4c5ENJX15vyYhKS1zhx
|
||||
6n0kQIn2vf6yqG7tO5Okz2IJiD9Sa06mK6GrAgMBAAGjFzAVMBMGA1UdJQQMMAoG
|
||||
CCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4GBAA8FXpRmdrHBdlofNvxa14zLvv0N
|
||||
WnUGUmxVklFLKXvpVWTanOhVgI2TDCMrT5WvCRTD25iT1EUKWxjDhFJrklQJ+IfC
|
||||
KC6fsgO7AynuxWSfSkc8/acGiAH+20vW9QxR53HYiIDMXEV/wnE0KVcr3t/d70lr
|
||||
ImanTrunagV+3O4O
|
||||
-----END CERTIFICATE-----
|
10
node_modules/tunnel/test/keys/agent4-csr.pem
generated
vendored
Normal file
10
node_modules/tunnel/test/keys/agent4-csr.pem
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH
|
||||
EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD
|
||||
EwZhZ2VudDQxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ
|
||||
KoZIhvcNAQEBBQADSwAwSAJBAM3/Ix+ZDzN2+aOUaTtvcyfrBjYWNoxvhzkQ0lfX
|
||||
m/JiEpLXOHHqfSRAifa9/rKobu07k6TPYgmIP1JrTqYroasCAwEAAaAlMCMGCSqG
|
||||
SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB
|
||||
AMzo7GUOBtGm5MSck1rrEE2C1bU3qoVvXVuiN3A/57zXeNeq24FZMLnkDeL9U+/b
|
||||
Kj646XFou04gla982Xp74p0=
|
||||
-----END CERTIFICATE REQUEST-----
|
9
node_modules/tunnel/test/keys/agent4-key.pem
generated
vendored
Normal file
9
node_modules/tunnel/test/keys/agent4-key.pem
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBOQIBAAJBAM3/Ix+ZDzN2+aOUaTtvcyfrBjYWNoxvhzkQ0lfXm/JiEpLXOHHq
|
||||
fSRAifa9/rKobu07k6TPYgmIP1JrTqYroasCAwEAAQJAN8RQb+dx1A7rejtdWbfM
|
||||
Rww7PD07Oz2eL/a72wgFsdIabRuVypIoHunqV0sAegYtNJt9yu+VhREw0R5tx/qz
|
||||
EQIhAPY+nmzp0b4iFRk7mtGUmCTr9iwwzoqzITwphE7FpQnFAiEA1ihUHFT9YPHO
|
||||
f85skM6qZv77NEgXHO8NJmQZ5GX1ZK8CICzle+Mluo0tD6W7HV4q9pZ8wzSJbY8S
|
||||
W/PpKetm09F1AiAWTw8sAGKAtc/IGo3Oq+iuYAN1F8lolzJsfGMCGujsOwIgAJKP
|
||||
t3eXilwX3ZlsDWSklWNZ7iYcfYrvAc3JqU6gFCE=
|
||||
-----END RSA PRIVATE KEY-----
|
21
node_modules/tunnel/test/keys/agent4.cnf
generated
vendored
Normal file
21
node_modules/tunnel/test/keys/agent4.cnf
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = US
|
||||
ST = CA
|
||||
L = SF
|
||||
O = Joyent
|
||||
OU = Node.js
|
||||
CN = agent4
|
||||
emailAddress = ry@tinyclouds.org
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
||||
[ ext_key_usage ]
|
||||
extendedKeyUsage = clientAuth
|
14
node_modules/tunnel/test/keys/ca1-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/ca1-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICIzCCAYwCCQC4ONZJx5BOwjANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTExJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBWMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMQww
|
||||
CgYDVQQDEwNjYTExJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQu
|
||||
anAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOJMS1ug8jUu0wwEfD4h9/Mg
|
||||
w0fvs7JbpMxtwpdcFpg/6ECd8YzGUvljLzeHPe2AhF26MiWIUN3YTxZRiQQ2tv93
|
||||
afRVWchdPypytmuxv2aYGjhZ66Tv4vNRizM71OE+66+KS30gEQW2k4MTr0ZVlRPR
|
||||
OVey+zRSLdVaKciB/XaBAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEApfbly4b+Ry1q
|
||||
bGIgGrlTvNFvF+j2RuHqSpuTB4nKyw1tbNreKmEEb6SBEfkjcTONx5rKECZ5RRPX
|
||||
z4R/o1G6Dn21ouf1pWQO0BC/HnLN30KvvsoZRoxBn/fqBlJA+j/Kpj3RQgFj6l2I
|
||||
AKI5fD+ucPqRGhjmmTsNyc+Ln4UfAq8=
|
||||
-----END CERTIFICATE-----
|
1
node_modules/tunnel/test/keys/ca1-cert.srl
generated
vendored
Normal file
1
node_modules/tunnel/test/keys/ca1-cert.srl
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
B111C9CEF0257692
|
17
node_modules/tunnel/test/keys/ca1-key.pem
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca1-key.pem
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIbo5wvG42IY0CAggA
|
||||
MBQGCCqGSIb3DQMHBAgf8SPuz4biYASCAoAR4r8MVikusOAEt4Xp6nB7whrMX4iG
|
||||
G792Qpf21nHZPMV73w3cdkfimbAfUn8F50tSJwdrAa8U9BjjpL9Kt0loIyXt/r8c
|
||||
6PWAQ4WZuLPgTFUTJUNAXrunBHI0iFWYEN4YzJYmT1qN3J4u0diy0MkKz6eJPfZ3
|
||||
3v97+nF7dR2H86ZgLKsuE4pO5IRb60XW85d7CYaY6rU6l6mXMF0g9sIccHTlFoet
|
||||
Xm6cA7NAm1XSI1ciYcoc8oaVE9dXoOALaTnBEZ2MJGpsYQ0Hr7kB4VKAO9wsOta5
|
||||
L9nXPv79Nzo1MZMChkrORFnwOzH4ffsUwVQ70jUzkt5DEyzCM1oSxFNRQESxnFrr
|
||||
7c1jLg2gxAVwnqYo8njsKJ23BZqZUxHsBgB2Mg1L/iPT6zhclD0u3RZx9MR4ezB2
|
||||
IqoCF19Z5bblkReAeVRAE9Ol4hKVaCEIIPUspcw7eGVGONalHDCSXpIFnJoZLeXJ
|
||||
OZjLmYlA6KkJw52eNE5IwIb8l/tha2fwNpRvlMoXp65yH9wKyJk8zPSM6WAk4dKD
|
||||
nLrTCK4KtM6aIbG14Mff6WEf3uaLPM0cLwxmuypfieCZfkIzgytNdFZoBgaYUpon
|
||||
zazvUMoy3gqDBorcU08SaosdRoL+s+QVkRhA29shf42lqOM4zbh0dTul4QDlLG0U
|
||||
VBNeMJ3HnrqATfBU28j3bUqtuF2RffgcN/3ivlBjcyzF/iPt0TWmm6Zz5v4K8+b6
|
||||
lOm6gofIz+ffg2cXfPzrqZ2/xhFkcerRuN0Xp5eAhlI2vGJVGuEc4X+tT7VtQgLV
|
||||
iovqzlLhp+ph/gsfCcsYZ9iso3ozw+Cx1HfJ8XT7yWUgXxblkt4uszEo
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
17
node_modules/tunnel/test/keys/ca1.cnf
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca1.cnf
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
output_password = password
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = ca1
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/ca2-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/ca2-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICIzCCAYwCCQCxIhZSDET+8DANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTIxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBWMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMQww
|
||||
CgYDVQQDEwNjYTIxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQu
|
||||
anAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaaLMMe7K5eYABH3NnJoimG
|
||||
LvY4S5tdGF6YRwfkn1bgGa+kEw1zNqa/Y0jSzs4h7bApt3+bKTalR4+Zk+0UmWgZ
|
||||
Gvlq8+mdqDXtBKoWE3vYDPBmeNyKsgxf9UIhFOpsxVUeYP8t66qJyUk/FlFJcDqc
|
||||
WPawikl1bUFSZXBKu4PxAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAwh3sXPIkA5kn
|
||||
fpg7fV5haS4EpFr9ia61dzWbhXDZtasAx+nWdWqgG4T+HIYSLlMNZbGJ998uhFZf
|
||||
DEHlbY/WuSBukZ0w+xqKBtPyjLIQKVvNiaTx5YMzQes62R1iklOXzBzyHbYIxFOG
|
||||
dqLfIjEe/mVVoR23LN2tr8Wa6+rmd+w=
|
||||
-----END CERTIFICATE-----
|
1
node_modules/tunnel/test/keys/ca2-cert.srl
generated
vendored
Normal file
1
node_modules/tunnel/test/keys/ca2-cert.srl
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
9BF2D4B2E00EDF16
|
10
node_modules/tunnel/test/keys/ca2-crl.pem
generated
vendored
Normal file
10
node_modules/tunnel/test/keys/ca2-crl.pem
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
-----BEGIN X509 CRL-----
|
||||
MIIBXTCBxzANBgkqhkiG9w0BAQQFADB6MQswCQYDVQQGEwJVUzELMAkGA1UECBMC
|
||||
Q0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUu
|
||||
anMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5v
|
||||
cmcXDTExMDMxNDE4MjkxNloXDTEzMTIwNzE4MjkxNlowHDAaAgkAgwa+feG7CZoX
|
||||
DTExMDMxNDE4MjkxNFowDQYJKoZIhvcNAQEEBQADgYEArRKuEkOla61fm4zlZtHe
|
||||
LTXFV0Hgo21PScHAp6JqPol4rN5R9+EmUkv7gPCVVBJ9VjIgxSosHiLsDiz3zR+u
|
||||
txHemhzbdIVANAIiChnFct8sEqH2eL4N6XNUIlMIR06NjNl7NbN8w8haqiearnuT
|
||||
wmnaL4TThPmpbpKAF7N7JqQ=
|
||||
-----END X509 CRL-----
|
1
node_modules/tunnel/test/keys/ca2-database.txt
generated
vendored
Normal file
1
node_modules/tunnel/test/keys/ca2-database.txt
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
R 380729182912Z 110314182914Z 8306BE7DE1BB099A unknown /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent4/emailAddress=ry@tinyclouds.org
|
17
node_modules/tunnel/test/keys/ca2-key.pem
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca2-key.pem
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI3aq9fKZIOF0CAggA
|
||||
MBQGCCqGSIb3DQMHBAjyunMfVve0OwSCAoAdMsrRFlQUSILw+bq3cSVIIbFjwcs0
|
||||
B1Uz2rc9SB+1qjsazjv4zvPQSXTrsx2EOSJf9PSPz7r+c0NzO9vfWLorpXof/lwL
|
||||
C1tRN7/1OqEW/mTK+1wlv0M5C4cmf44BBXmI+y+RWrQ/qc+CWEMvfHwv9zWr2K+i
|
||||
cLlZv55727GvZYCMMVLiqYd/Ejj98loBsE5dhN4JJ5MPaN3UHhFTCpD453GIIzCi
|
||||
FRuYhOOtX4qYoEuP2db4S2qu26723ZJnYBEHkK2YZiRrgvoZHugyGIr4f/RRoSUI
|
||||
fPgycgQfL3Ow+Y1G533PiZ+CYgh9cViUzhZImEPiZpSuUntAD1loOYkJuV9Ai9XZ
|
||||
+t6+7tfkM3aAo1bkaU8KcfINxxNWfAhCbUQw+tGJl2A+73OM5AGjGSfzjQQL/FOa
|
||||
5omfEvdfEX2XyRRlqnQ2VucvSTL9ZdzbIJGg/euJTpM44Fwc7yAZv2aprbPoPixu
|
||||
yyf0LoTjlGGSBZvHkunpWx82lYEXvHhcnCxV5MDFw8wehvDrvcSuzb8//HzLOiOB
|
||||
gzUr3DOQk4U1UD6xixZjAKC+NUwTVZoHg68KtmQfkq+eGUWf5oJP4xUigi3ui/Wy
|
||||
OCBDdlRBkFtgLGL51KJqtq1ixx3Q9HMl0y6edr5Ls0unDIo0LtUWUUcAtr6wl+kK
|
||||
zSztxFMi2zTtbhbkwoVpucNstFQNfV1k22vtnlcux2FV2DdZiJQwYpIbr8Gj6gpK
|
||||
gtV5l9RFe21oZBcKPt/chrF8ayiClfGMpF3D2p2GqGCe0HuH5uM/JAFf60rbnriA
|
||||
Nu1bWiXsXLRUXcLIQ/uEPR3Mvvo9k1h4Q6it1Rp67eQiXCX6h2uFq+sB
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
1
node_modules/tunnel/test/keys/ca2-serial
generated
vendored
Normal file
1
node_modules/tunnel/test/keys/ca2-serial
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
01
|
17
node_modules/tunnel/test/keys/ca2.cnf
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca2.cnf
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
output_password = password
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = ca2
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/ca3-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/ca3-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICIzCCAYwCCQCudHFhEWiUHDANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTMxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBWMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMQww
|
||||
CgYDVQQDEwNjYTMxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQu
|
||||
anAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJPRJMhCNtxX6dQ3rLdrzVCl
|
||||
XJMSRIICpbsc7arOzSJcrsIYeYC4d29dGwxYNLnAkKSmHujFT9SmFgh88CoYETLp
|
||||
gE9zCk9hVCwUlWelM/UaIrzeLT4SC3VBptnLmMtk2mqFniLcaFdMycAcX8OIhAgG
|
||||
fbqyT5Wxwz7UMegip2ZjAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEADpu8a/W+NPnS
|
||||
mhyIOxXn8O//2oH9ELlBYFLIgTid0xmS05x/MgkXtWqiBEEZFoOfoJBJxM3vTFs0
|
||||
PiZvcVjv0IIjDF4s54yRVH+4WI2p7cil1fgzAVRTuOIuR+VyN7ct8s26a/7GFDq6
|
||||
NJMByyjsJHyxwwri5hVv+jbLCxmnDjI=
|
||||
-----END CERTIFICATE-----
|
1
node_modules/tunnel/test/keys/ca3-cert.srl
generated
vendored
Normal file
1
node_modules/tunnel/test/keys/ca3-cert.srl
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
EF7B2CF0FA61DF41
|
17
node_modules/tunnel/test/keys/ca3-key.pem
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca3-key.pem
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIwAta+L4c9soCAggA
|
||||
MBQGCCqGSIb3DQMHBAgqRud2p3SvogSCAoDXoDJOJDkvgFpQ6rxeV5r0fLX4SrGJ
|
||||
quv4yt02QxSDUPN2ZLtBt6bLzg4Zv2pIggufYJcZ2IOUnX82T7FlvBP8hbW1q3Bs
|
||||
jAso7z8kJlFrZjNudjuP2l/X8tjrVyr3I0PoRoomtcHnCcSDdyne8Dqqj1enuikF
|
||||
8b7FZUqocNLfu8LmNGxMmMwjw3UqhtpP5DjqV60B8ytQFPoz/gFh6aNGvsrD/avU
|
||||
Dj8EJkQZP6Q32vmCzAvSiLjk7FA7RFmBtaurE9hJYNlc5v1eo69EUwPkeVlTpglJ
|
||||
5sZAHxlhQCgc72ST6uFQKiMO3ng/JJA5N9EvacYSHQvI1TQIo43V2A//zUh/5hGL
|
||||
sDv4pRuFq9miX8iiQpwo1LDfRzdwg7+tiLm8/mDyeLUSzDNc6GIX/tC9R4Ukq4ge
|
||||
1Cfq0gtKSRxZhM8HqpGBC9rDs5mpdUqTRsoHLFn5T6/gMiAtrLCJxgD8JsZBa8rM
|
||||
KZ09QEdZXTvpyvZ8bSakP5PF6Yz3QYO32CakL7LDPpCng0QDNHG10YaZbTOgJIzQ
|
||||
NJ5o87DkgDx0Bb3L8FoREIBkjpYFbQi2fvPthoepZ3D5VamVsOwOiZ2sR1WF2J8l
|
||||
X9c8GdG38byO+SQIPNZ8eT5JvUcNeSlIZiVSwvaEk496d2KzhmMMfoBLFVeHXG90
|
||||
CIZPleVfkTmgNQgXPWcFngqTZdDEGsHjEDDhbEAijB3EeOxyiiEDJPMy5zqkdy5D
|
||||
cZ/Y77EDbln7omcyL+cGvCgBhhYpTbtbuBtzW4CiCvcfEB5N4EtJKOTRJXIpL/d3
|
||||
oVnZruqRRKidKwFMEZU2NZJX5FneAWFSeCv0IrY2vAUIc3El+n84CFFK
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
17
node_modules/tunnel/test/keys/ca3.cnf
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca3.cnf
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
output_password = password
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = ca3
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/ca4-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/ca4-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICIzCCAYwCCQDUGh2r7lOpITANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTQxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBWMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMQww
|
||||
CgYDVQQDEwNjYTQxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQu
|
||||
anAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOOC+SPC8XzkjIHfKPMzzNV6
|
||||
O/LpqQWdzJtEvFNW0oQ9g8gSV4iKqwUFrLNnSlwSGigvqKqGmYtG8S17ANWInoxI
|
||||
c3sQlrS2cGbgLUBNKu4hZ7s+11EPOjbnn0QUE5w9GN8fy8CDx7ID/8URYKoxcoRv
|
||||
0w7EJ2agfd68KS1ayxUXAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAumPFeR63Dyki
|
||||
SWQtRAe2QWkIFlSRAR2PvSDdsDMLwMeXF5wD3Hv51yfTu9Gkg0QJB86deYfQ5vfV
|
||||
4QsOQ35icesa12boyYpTE0/OoEX1f/s1sLlszpRvtAki3J4bkcGWAzM5yO1fKqpQ
|
||||
MbtPzLn+DA7ymxuJa6EQAEb+kaJEBuU=
|
||||
-----END CERTIFICATE-----
|
1
node_modules/tunnel/test/keys/ca4-cert.srl
generated
vendored
Normal file
1
node_modules/tunnel/test/keys/ca4-cert.srl
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
B01FE0416A2EDCF5
|
17
node_modules/tunnel/test/keys/ca4-key.pem
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca4-key.pem
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIWE/ri/feeikCAggA
|
||||
MBQGCCqGSIb3DQMHBAiu6hUzoFnsVASCAoC53ZQ4gxLcFnb5yAcdCl4DdKOJ5m4G
|
||||
CHosR87pJpZlO68DsCKwORUp9tTmb1/Q4Wm9n2kRf6VQNyVVm6REwzEPAgIJEgy2
|
||||
FqLmfqpTElbRsQako8UDXjDjaMO30e+Qhy8HOTrHMJZ6LgrU90xnOCPPeN9fYmIu
|
||||
YBkX4qewUfu+wFzk/unUbFLChvJsEN4fdrlDwTJMHRzKwbdvg3mHlCnspWwjA2Mc
|
||||
q27QPeb3mwRUajmqL0dT9y7wVYeAN2zV59VoWm6zV+dWFgyMlVrVCRYkqQC3xOsy
|
||||
ZlKrGldrY8nNdv5s6+Sc7YavTJiJxHgIB7sm6QFIsdqjxTBEGD4/YhEI52SUw/xO
|
||||
VJmOTWdWUz4FdWNi7286nfhZ0+mdv6fUoG54Qv6ahnUMJvEsp60LkR1gHXLzQu/m
|
||||
+yDZFqY/IIg2QA7M3gL0Md5GrWydDlD2uBPoXcC4A5gfOHswzHWDKurDCpoMqdpn
|
||||
CUQ/ZVl2rwF8Pnty61MjY1xCN1r8xQjFBCgcfBWw5v6sNRbr/vef3TfQIBzVm+hx
|
||||
akDb1nckBsIjMT9EfeT6hXub2n0oehEHewF1COifbcOjnxToLSswPLrtb0behB+o
|
||||
zTgftn+4XrkY0sFY69TzYtQVMLAsiWTpZFvAi+D++2pXlQ/bnxKJiBBc6kZuAGpN
|
||||
z+cJ4kUuFE4S9v5C5vK89nIgcuJT06u8wYTy0N0j/DnIjSaVgGr0Y0841mXtU1VV
|
||||
wUZjuyYrVwVT/g5r6uzEFldTcjmYkbMaxo+MYnEZZgqYJvu2QlK87YxJOwo+D1NX
|
||||
4gl1s/bmlPlGw/t9TxutI3S9PEr3JM3013e9UPE+evlTG9IIrZaUPzyj
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
17
node_modules/tunnel/test/keys/ca4.cnf
generated
vendored
Normal file
17
node_modules/tunnel/test/keys/ca4.cnf
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
output_password = password
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = ca4
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
16
node_modules/tunnel/test/keys/client.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/client.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = localhost
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/client1-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/client1-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKTCCAZICCQDveyzw+mHfQTANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTMxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBcMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMRIw
|
||||
EAYDVQQDEwlsb2NhbGhvc3QxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92
|
||||
ZW1lbnQuanAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMYUuKyuxT93zvrS
|
||||
mL8IMI8xu8dP3iRZDUYu6dmq6Dntgb7intfzxtEFVmfNCDGwJwg7UKx/FzftGxFb
|
||||
9LksuvAQuW2FLhCrOmXUVU938OZkQRSflISD80kd4i9JEoKKYPX1imjaMugIQ0ta
|
||||
Bq2orY6sna8JAUVDW6WO3wVEJ4mBAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAAbaH
|
||||
bc/6dIFC9TPIDrgsLtsOtycdBJqKbFT1wThhyKncXF/iyaI+8N4UA+hXMjk8ODUl
|
||||
BVmmgaN6ufMLwnx/Gdl9FLmmDq4FQ4zspClTJo42QPzg5zKoPSw5liy73LM7z+nG
|
||||
g6IeM8RFlEbs109YxqvQnbHfTgeLdIsdvtNXU80=
|
||||
-----END CERTIFICATE-----
|
12
node_modules/tunnel/test/keys/client1-csr.pem
generated
vendored
Normal file
12
node_modules/tunnel/test/keys/client1-csr.pem
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBwTCCASoCAQAwXDELMAkGA1UEBhMCSlAxEjAQBgNVBAsUCW5vZGVqc19qcDES
|
||||
MBAGA1UEAxMJbG9jYWxob3N0MSUwIwYJKoZIhvcNAQkBFhZrb2ljaGlrQGltcHJv
|
||||
dmVtZW50LmpwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGFLisrsU/d876
|
||||
0pi/CDCPMbvHT94kWQ1GLunZqug57YG+4p7X88bRBVZnzQgxsCcIO1Csfxc37RsR
|
||||
W/S5LLrwELlthS4Qqzpl1FVPd/DmZEEUn5SEg/NJHeIvSRKCimD19Ypo2jLoCENL
|
||||
WgatqK2OrJ2vCQFFQ1uljt8FRCeJgQIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEg
|
||||
Y2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqGSIb3DQEBBQUAA4GBAB5NvNSHX+WDlF5R
|
||||
LNr7SI2NzIy5OWEAgTxLkvS0NS75zlDLScaqwgs1uNfB2AnH0Fpw9+pePEijlb+L
|
||||
3VRLNpV8hRn5TKztlS3O0Z4PPb7hlDHitXukTOQYrq0juQacodVSgWqNbac+O2yK
|
||||
qf4Y3A7kQO1qmDOfN6QJFYVIpPiP
|
||||
-----END CERTIFICATE REQUEST-----
|
15
node_modules/tunnel/test/keys/client1-key.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/client1-key.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQDGFLisrsU/d8760pi/CDCPMbvHT94kWQ1GLunZqug57YG+4p7X
|
||||
88bRBVZnzQgxsCcIO1Csfxc37RsRW/S5LLrwELlthS4Qqzpl1FVPd/DmZEEUn5SE
|
||||
g/NJHeIvSRKCimD19Ypo2jLoCENLWgatqK2OrJ2vCQFFQ1uljt8FRCeJgQIDAQAB
|
||||
AoGAbfcM+xjfejeqGYcWs175jlVe2OyW93jUrLTYsDV4TMh08iLfaiX0pw+eg2vI
|
||||
88TGNoSvacP4gNzJ3R4+wxp5AFlRKZ876yL7D0VKavMFwbyRk21+D/tLGvW6gqOC
|
||||
4qi4IWSkfgBh5RK+o4jZcl5tzRPQyuxR3pJGBS33q5K2dEECQQDhV4NuKZcGDnKt
|
||||
1AhmtzqsJ4wrp2a3ysZYDTWyA692NGXi2Vnpnc6Aw9JchJhT3cueFLcOTFrb/ttu
|
||||
ZC/iA67pAkEA4Qe7LvcPvHlwNAmzqzOg2lYAqq+aJY2ghfJMqr3dPCJqbHJnLN6p
|
||||
GXsqGngwVlnvso0O/n5g30UmzvkRMFZW2QJAbOMQy0alh3OrzntKo/eeDln9zYpS
|
||||
hDUjqqCXdbF6M7AWG4vTeqOaiXYWTEZ2JPBj17tCyVH0BaIc/jbDPH9zIQJBALei
|
||||
YH0l/oB2tTqyBB2cpxIlhqvDW05z8d/859WZ1PVivGg9P7cdCO+TU7uAAyokgHe7
|
||||
ptXFefYZb18NX5qLipkCQHjIo4BknrO1oisfsusWcCC700aRIYIDk0QyEEIAY3+9
|
||||
7ar/Oo1EbqWA/qN7zByPuTKrjrb91/D+IMFUFgb4RWc=
|
||||
-----END RSA PRIVATE KEY-----
|
16
node_modules/tunnel/test/keys/client1.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/client1.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = localhost
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/client2-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/client2-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKTCCAZICCQCwH+BBai7c9TANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTQxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBcMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMRIw
|
||||
EAYDVQQDEwlsb2NhbGhvc3QxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92
|
||||
ZW1lbnQuanAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMJQGt34PZX5pQmi
|
||||
3bNp3dryr7qPO3oGhTeShLCeZ6PPCdnmVl0PnT0n8/DFBlaijbvXGU9AjcFZ7gg7
|
||||
hcSAFLGmPEb2pug021yzl7u0qUD2fnVaEzfJ04ZU4lUCFqGKsfFVQuIkDHFwadbE
|
||||
AO+8EqOmDynUMkKfHPWQK6O9jt5ZAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEA143M
|
||||
QIygJGDv2GFKlVgV05/CYZo6ouX9I6vPRekJnGeL98lmVH83Ogb7Xmc2SbJ18qFq
|
||||
naBYnUEmHPUAZ2Ms2KuV3OOvscUSCsEJ4utJYznOT8PsemxVWrgG1Ba+zpnPkdII
|
||||
p+PanKCsclNUKwBlSkJ8XfGi9CAZJBykwws3O1c=
|
||||
-----END CERTIFICATE-----
|
12
node_modules/tunnel/test/keys/client2-csr.pem
generated
vendored
Normal file
12
node_modules/tunnel/test/keys/client2-csr.pem
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBwTCCASoCAQAwXDELMAkGA1UEBhMCSlAxEjAQBgNVBAsUCW5vZGVqc19qcDES
|
||||
MBAGA1UEAxMJbG9jYWxob3N0MSUwIwYJKoZIhvcNAQkBFhZrb2ljaGlrQGltcHJv
|
||||
dmVtZW50LmpwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCUBrd+D2V+aUJ
|
||||
ot2zad3a8q+6jzt6BoU3koSwnmejzwnZ5lZdD509J/PwxQZWoo271xlPQI3BWe4I
|
||||
O4XEgBSxpjxG9qboNNtcs5e7tKlA9n51WhM3ydOGVOJVAhahirHxVULiJAxxcGnW
|
||||
xADvvBKjpg8p1DJCnxz1kCujvY7eWQIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEg
|
||||
Y2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqGSIb3DQEBBQUAA4GBAA//UPKPpVEpflDj
|
||||
DBboWewa6yw8FEOnMvh6eeg/a8KbXfIYnkZRtxbmH06ygywBy/RUBCbM5EzyElkJ
|
||||
bTVKorzCHnxuTfSnKQ68ZD+vI2SNjiWqQFXW6oOCPzLbtaTJVKw5D6ylBp8Zsu6n
|
||||
BzQ/4Y42aX/HW4nfJeDydxNFYVJJ
|
||||
-----END CERTIFICATE REQUEST-----
|
15
node_modules/tunnel/test/keys/client2-key.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/client2-key.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICWwIBAAKBgQDCUBrd+D2V+aUJot2zad3a8q+6jzt6BoU3koSwnmejzwnZ5lZd
|
||||
D509J/PwxQZWoo271xlPQI3BWe4IO4XEgBSxpjxG9qboNNtcs5e7tKlA9n51WhM3
|
||||
ydOGVOJVAhahirHxVULiJAxxcGnWxADvvBKjpg8p1DJCnxz1kCujvY7eWQIDAQAB
|
||||
AoGAbiT0JdCaMFIzb/PnEdU30e1xGSIpx7C8gNTH7EnOW7d3URHU8KlyKwFjsJ4u
|
||||
SpuYFdsG2Lqx3+D3IamD2O/1SgODmtdFas1C/hQ2zx42SgyBQolVJU1MHJxHqmCb
|
||||
nm2Wo8aHmvFXpQ8OF4YJLPxLOSdvmq0PC17evDyjz5PciWUCQQD5yzaBpJ7yzGwd
|
||||
b6nreWj6pt+jfi11YsA3gAdvTJcFzMGyNNC+U9OExjQqHsyaHyxGhHKQ6y+ybZkR
|
||||
BggkudPfAkEAxyQC/hmcvWegdGI4xOJNbm0kv8UyxyeqhtgzEW2hWgEQs4k3fflZ
|
||||
iNpvxyIBIp/7zZo02YqeQfZlDYuxKypUxwJAa6jQBzRCZXcBqfY0kA611kIR5U8+
|
||||
nHdBTSpbCfdCp/dGDF6DEWTjpzgdx4GawVpqJMJ09kzHM+nUrOeinuGQlQJAMAsV
|
||||
Gb6OHPfaMxnbPkymh6SXQBjQNlHwhxWzxFmhmrg1EkthcufsXOLuIqmmgnb8Zc71
|
||||
PyJ9KcbK/GieNp7A0wJAIz3Mm3Up9Rlk25TH9k5e3ELjC6fkd93u94Uo145oTgDm
|
||||
HSbCbjifP5eVl66PztxZppG2GBXiXT0hA/RMruTQMg==
|
||||
-----END RSA PRIVATE KEY-----
|
16
node_modules/tunnel/test/keys/client2.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/client2.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = localhost
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/proxy1-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/proxy1-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKTCCAZICCQCb8tSy4A7fFTANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTIxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBcMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMRIw
|
||||
EAYDVQQDEwlsb2NhbGhvc3QxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92
|
||||
ZW1lbnQuanAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALiUyeosVxtJK8G4
|
||||
sAqU2DBLx5sMuZpV/YcW/YxUuJv3t/9TpVxcWAs6VRPzi5fqKe8TER8qxi1/I8zV
|
||||
Qks1gWyZ01reU6Wpdt1MZguF036W2qKOxlJXvnqnRDWu9IFf6KMjSJjFZb6nqhQv
|
||||
aiL/80hqc2qXVfuJbSYlGrKWFFINAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABPIn
|
||||
+vQoDpJx7lVNJNOe7DE+ShCXCK6jkQY8+GQXB1sz5K0OWdZxUWOOp/fcjNJua0NM
|
||||
hgnylWu/pmjPh7c9xHdZhuh6LPD3F0k4QqK+I2rg45gdBPZT2IxEvxNYpGIfayvY
|
||||
ofOgbienn69tMzGCMF/lUmEJu7Bn08EbL+OyNBg=
|
||||
-----END CERTIFICATE-----
|
12
node_modules/tunnel/test/keys/proxy1-csr.pem
generated
vendored
Normal file
12
node_modules/tunnel/test/keys/proxy1-csr.pem
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBwTCCASoCAQAwXDELMAkGA1UEBhMCSlAxEjAQBgNVBAsUCW5vZGVqc19qcDES
|
||||
MBAGA1UEAxMJbG9jYWxob3N0MSUwIwYJKoZIhvcNAQkBFhZrb2ljaGlrQGltcHJv
|
||||
dmVtZW50LmpwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4lMnqLFcbSSvB
|
||||
uLAKlNgwS8ebDLmaVf2HFv2MVLib97f/U6VcXFgLOlUT84uX6invExEfKsYtfyPM
|
||||
1UJLNYFsmdNa3lOlqXbdTGYLhdN+ltqijsZSV756p0Q1rvSBX+ijI0iYxWW+p6oU
|
||||
L2oi//NIanNql1X7iW0mJRqylhRSDQIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEg
|
||||
Y2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqGSIb3DQEBBQUAA4GBAFhZc2cvYGf8mCg/
|
||||
5nPWmnjNIqgy7uJnOGfE3AP4rW48yiVHCJK9ZmPogbH7gBMOBrrX8fLX3ThK9Sbj
|
||||
uJlBlZD/19zjM+kvJ14DcievJ15S3KehVQ6Ipmgbz/vnAaL1D+ZiOnjQad2/Fzg4
|
||||
0MFXQaZFEUcI8fKnv/zmYi1aivej
|
||||
-----END CERTIFICATE REQUEST-----
|
15
node_modules/tunnel/test/keys/proxy1-key.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/proxy1-key.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQC4lMnqLFcbSSvBuLAKlNgwS8ebDLmaVf2HFv2MVLib97f/U6Vc
|
||||
XFgLOlUT84uX6invExEfKsYtfyPM1UJLNYFsmdNa3lOlqXbdTGYLhdN+ltqijsZS
|
||||
V756p0Q1rvSBX+ijI0iYxWW+p6oUL2oi//NIanNql1X7iW0mJRqylhRSDQIDAQAB
|
||||
AoGADPSkl4M1Of0QzTAhaxy3b+xhvkhOXr7aZLkAYvEvZAMnLwy39puksmUNw7C8
|
||||
g5U0DEvST9W4w0jBQodVd+Hxi4dUS4BLDVVStaLMa1Fjai/4uBPxbsrvdHzDu7if
|
||||
BI6t12vWNNRtTxbfCJ1Fs3nHvDG0ueBZX3fYWBIPPM4bRQECQQDjmCrxbkfFrN5z
|
||||
JXHfmzoNovV7KzgwRLKOLF17dYnhaG3G77JYjhEjIg5VXmQ8XJrwS45C/io5feFA
|
||||
qrsy/0v1AkEAz55QK8CLue+sn0J8Yw//yLjJT6BK4pCFFKDxyAvP/3r4t7+1TgDj
|
||||
KAfUMWb5Hcn9iT3sEykUeOe0ghU0h5X2uQJBAKES2qGPuP/vvmejwpnMVCO+hxmq
|
||||
ltOiavQv9eEgaHq826SFk6UUtpA01AwbB7momIckEgTbuKqDql2H94C6KdkCQQC7
|
||||
PfrtyoP5V8dmBk8qBEbZ3pVn45dFx7LNzOzhTo3yyhO/m/zGcZRsCMt9FnI7RG0M
|
||||
tjTPfvAArm8kFj2+vie5AkASvVx478N8so+02QWKme4T3ZDX+HDBXgFH1+SMD91m
|
||||
9tS6x2dtTNvvwBA2KFI1fUg3B/wDoKJQRrqwdl8jpoGP
|
||||
-----END RSA PRIVATE KEY-----
|
16
node_modules/tunnel/test/keys/proxy1.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/proxy1.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = localhost
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/proxy2-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/proxy2-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJjCCAY8CCQCb8tSy4A7fFjANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTIxJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBZMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMQ8w
|
||||
DQYDVQQDEwZwcm94eTIxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92ZW1l
|
||||
bnQuanAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALZ3oNCmB2P4Q9DoUVFq
|
||||
Z1ByASLm63jTPEumv2kX81GF5QMLRl59HBM6Te1rRR7wFHL0iBQUYuEzNPmedXpU
|
||||
cds0uWl5teoO63ZSKFL1QLU3PMFo56AeWeznxOhy6vwWv3M8C391X6lYsiBow3K9
|
||||
d37p//GLIR+jl6Q4xYD41zaxAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEADUQgtmot
|
||||
8zqsRQInjWAypcntkxX8hdUOEudN2/zjX/YtMZbr8rRvsZzBsUDdgK+E2EmEb/N3
|
||||
9ARZ0T2zWFFphJapkZOM1o1+LawN5ON5HfTPqr6d9qlHuRdGCBpXMUERO2V43Z+S
|
||||
Zwm+iw1yZEs4buTmiw6zu6Nq0fhBlTiAweE=
|
||||
-----END CERTIFICATE-----
|
12
node_modules/tunnel/test/keys/proxy2-csr.pem
generated
vendored
Normal file
12
node_modules/tunnel/test/keys/proxy2-csr.pem
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBvjCCAScCAQAwWTELMAkGA1UEBhMCSlAxEjAQBgNVBAsUCW5vZGVqc19qcDEP
|
||||
MA0GA1UEAxMGcHJveHkyMSUwIwYJKoZIhvcNAQkBFhZrb2ljaGlrQGltcHJvdmVt
|
||||
ZW50LmpwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2d6DQpgdj+EPQ6FFR
|
||||
amdQcgEi5ut40zxLpr9pF/NRheUDC0ZefRwTOk3ta0Ue8BRy9IgUFGLhMzT5nnV6
|
||||
VHHbNLlpebXqDut2UihS9UC1NzzBaOegHlns58Tocur8Fr9zPAt/dV+pWLIgaMNy
|
||||
vXd+6f/xiyEfo5ekOMWA+Nc2sQIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEgY2hh
|
||||
bGxlbmdlIHBhc3N3b3JkMA0GCSqGSIb3DQEBBQUAA4GBADC4dh/+gQnJcPMQ0riJ
|
||||
CBVLygcCWxkNvwM3ARboyihuNbzFX1f2g23Zr5iLphiuEFCPDOyd26hHieQ8Xo1y
|
||||
FPuDXpWMx9X9MLjCWg8kdtada7HsYffbUvpjjL9TxFh+rX0cmr6Ixc5kV7AV4I6V
|
||||
3h8BYJebX+XfuYrI1UwEqjqI
|
||||
-----END CERTIFICATE REQUEST-----
|
15
node_modules/tunnel/test/keys/proxy2-key.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/proxy2-key.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQC2d6DQpgdj+EPQ6FFRamdQcgEi5ut40zxLpr9pF/NRheUDC0Ze
|
||||
fRwTOk3ta0Ue8BRy9IgUFGLhMzT5nnV6VHHbNLlpebXqDut2UihS9UC1NzzBaOeg
|
||||
Hlns58Tocur8Fr9zPAt/dV+pWLIgaMNyvXd+6f/xiyEfo5ekOMWA+Nc2sQIDAQAB
|
||||
AoGBALPH0o9Bxu5c4pSnEdgh+oFskmoNE90MY9A2D0pA6uBcCHSjW0YmBs97FuTi
|
||||
WExPSBarkJgYLgStK3j3A9Dv+uzRRT0gSr34vKFh5ozI+nJZOMNJyHDOCFiT9sm7
|
||||
urDW0gSq9OW/H8NbAkxkBZw0PaB9oW5nljuieVIFDYXNAeMBAkEA6NfBHjzp3GS0
|
||||
RbtaBkxn3CRlEoUUPVd3sJ6lW2XBu5AWrgNHRSlh0oBupXgd3cxWIB69xPOg6QjU
|
||||
XmvcLjBlCQJBAMidTIw4s89m4+14eY/KuXaEgxW/awLEbQP2JDCjY1wT3Ya3Ggac
|
||||
HIFuGdTbd2faJPxNJjoljZnatSdwY5aXFmkCQBQZM5FBnsooYys1vdKXW8uz1Imh
|
||||
tRqKZ0l2mD1obi2bhWml3MwKg2ghL+vWj3VqwvBo1uaeRQB4g6RW2R2fjckCQQCf
|
||||
FnZ0oCafa2WGlMo5qDbI8K6PGXv/9srIoHH0jC0oAKzkvuEJqtTEIw6jCOM43PoF
|
||||
hhyxccRH5PNRckPXULs5AkACxKEL1dN+Bx72zE8jSU4DB5arpQdGOvuVsqXgVM/5
|
||||
QLneJEHGPCqNFS1OkWUYLtX0S28X5GmHMEpLRLpgE9JY
|
||||
-----END RSA PRIVATE KEY-----
|
16
node_modules/tunnel/test/keys/proxy2.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/proxy2.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = proxy2
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/server1-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/server1-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKTCCAZICCQCxEcnO8CV2kTANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTExJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBcMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMRIw
|
||||
EAYDVQQDEwlsb2NhbGhvc3QxJTAjBgkqhkiG9w0BCQEWFmtvaWNoaWtAaW1wcm92
|
||||
ZW1lbnQuanAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALYb3z6TVgD8VmV2
|
||||
i0IHoes/HNVz+/UgXxRoA7gTUXp4Q69HBymWwm4fG61YMn7XAjy0gyC2CX/C0S74
|
||||
ZzHkhq1DCXCtlXCDx5oZhSRPpa902MVdDSRR+naLA4PPFkV2pI53hsFW37M5Dhge
|
||||
+taFbih/dbjpOnhLD+SbkSKNTw/dAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAjDNi
|
||||
mdmMM8Of/8iCYISqkqCG+7fz747Ntkg5fVMPufkwrBfkD9UjYVbfIpEOkZ3L0If9
|
||||
0/wNi0uZobIJnd/9B/e0cHKYnx0gkhUpMylaRvIV4odKe2vq3+mjwMb9syYXYDx3
|
||||
hw2qDMIIPr0S5ICeoIKXhbsYtODVxKSdJq+FjAI=
|
||||
-----END CERTIFICATE-----
|
12
node_modules/tunnel/test/keys/server1-csr.pem
generated
vendored
Normal file
12
node_modules/tunnel/test/keys/server1-csr.pem
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBwTCCASoCAQAwXDELMAkGA1UEBhMCSlAxEjAQBgNVBAsUCW5vZGVqc19qcDES
|
||||
MBAGA1UEAxMJbG9jYWxob3N0MSUwIwYJKoZIhvcNAQkBFhZrb2ljaGlrQGltcHJv
|
||||
dmVtZW50LmpwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2G98+k1YA/FZl
|
||||
dotCB6HrPxzVc/v1IF8UaAO4E1F6eEOvRwcplsJuHxutWDJ+1wI8tIMgtgl/wtEu
|
||||
+Gcx5IatQwlwrZVwg8eaGYUkT6WvdNjFXQ0kUfp2iwODzxZFdqSOd4bBVt+zOQ4Y
|
||||
HvrWhW4of3W46Tp4Sw/km5EijU8P3QIDAQABoCUwIwYJKoZIhvcNAQkHMRYTFEEg
|
||||
Y2hhbGxlbmdlIHBhc3N3b3JkMA0GCSqGSIb3DQEBBQUAA4GBAJLLYClTc1BZbQi4
|
||||
2GrGEimzJoheXXD1vepECS6TaeYJFSQldMGdkn5D8TMXWW115V4hw7a1pCwvRBPH
|
||||
dVEeh3u3ktI1e4pS5ozvpbpYanILrHCNOQ4PvKi9rzG9Km8CprPcrJCZlWf2QUBK
|
||||
gVNgqZJeqyEcBu80/ajjc6xrZsSP
|
||||
-----END CERTIFICATE REQUEST-----
|
15
node_modules/tunnel/test/keys/server1-key.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/server1-key.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQC2G98+k1YA/FZldotCB6HrPxzVc/v1IF8UaAO4E1F6eEOvRwcp
|
||||
lsJuHxutWDJ+1wI8tIMgtgl/wtEu+Gcx5IatQwlwrZVwg8eaGYUkT6WvdNjFXQ0k
|
||||
Ufp2iwODzxZFdqSOd4bBVt+zOQ4YHvrWhW4of3W46Tp4Sw/km5EijU8P3QIDAQAB
|
||||
AoGAcDioz+T3gM//ZbMxidUuQMu5twgsYhg6v1aBxDOTaEcoXqEElupikn31DlNl
|
||||
eqiApmwOyl+jZunlAm7tGN/c5WjmZtW6watv1D7HjDIFJQBdiOv2jLeV5gsoArMP
|
||||
f8Y13MS68nJ7/ZkqisovjBlD7ZInbyUiJj0FH/cazauflIECQQDwHgQ0J46eL5EG
|
||||
3smQQG9/8b/Wsnf8s9Vz6X/KptsbL3c7mCBY9/+cGw0xVxoUOyO7KGPzpRhtz4Y0
|
||||
oP+JwISxAkEAwieUtl+SuUAn6er1tZzPPiAM2w6XGOAod+HuPjTAKVhLKHYIEJbU
|
||||
jhPdjOGtZr10ED9g0m7M4n3JKMMM00W47QJBAOVkp7tztwpkgva/TG0lQeBHgnCI
|
||||
G50t6NRN1Koz8crs88nZMb4NXwMxzM7AWcfOH/qjQan4pXfy9FG/JaHibGECQH8i
|
||||
L+zj1E3dxsUTh+VuUv5ZOlHO0f4F+jnWBY1SOWpZWI2cDFfgjDqko3R26nbWI8Pn
|
||||
3FyvFRZSS4CXiDRn+VkCQQCKPBl60QAifkZITqL0dCs+wB2hhmlWwqlpq1ZgeCby
|
||||
zwmZY1auUK1BYBX1aPB85+Bm2Zhp5jnkwRcO7iSYy8+C
|
||||
-----END RSA PRIVATE KEY-----
|
16
node_modules/tunnel/test/keys/server1.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/server1.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = localhost
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
14
node_modules/tunnel/test/keys/server2-cert.pem
generated
vendored
Normal file
14
node_modules/tunnel/test/keys/server2-cert.pem
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJzCCAZACCQCxEcnO8CV2kjANBgkqhkiG9w0BAQUFADBWMQswCQYDVQQGEwJK
|
||||
UDESMBAGA1UECxQJbm9kZWpzX2pwMQwwCgYDVQQDEwNjYTExJTAjBgkqhkiG9w0B
|
||||
CQEWFmtvaWNoaWtAaW1wcm92ZW1lbnQuanAwHhcNMTMxMjI0MTEyMzIxWhcNNDEw
|
||||
NTEwMTEyMzIxWjBaMQswCQYDVQQGEwJKUDESMBAGA1UECxQJbm9kZWpzX2pwMRAw
|
||||
DgYDVQQDEwdzZXJ2ZXIyMSUwIwYJKoZIhvcNAQkBFhZrb2ljaGlrQGltcHJvdmVt
|
||||
ZW50LmpwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEkKr9SHG6jtf5UNfL
|
||||
u66wNi8jrbAW5keYy7ECWRGRFDE7ay4N8LDMmOO3/1eH2WpY0QM5JFxq78hoVQED
|
||||
ogvoeVTw+Ni33yqY6VL2WRv84FN2BmCrDGJQ83EYdsJqPUnxuXvbmq7Viw3l/BEu
|
||||
hvsp722KcToIrqt8mHKMc/nPRwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALbdQz32
|
||||
CN0hJfJ6BtGyqee3zRSpufPY1KFV8OHSDG4qL55OfpjB5e5wsldp3VChTWzm2KM+
|
||||
xg9WSWurMINM5KLgUqCZ69ttg1gJ/SnZNolXhH0I3SG/DY4DGTHo9oJPoSrgrWbX
|
||||
3ZmCoO6rrDoSuVRJ8dKMWJmt8O1pZ6ZRW2iM
|
||||
-----END CERTIFICATE-----
|
12
node_modules/tunnel/test/keys/server2-csr.pem
generated
vendored
Normal file
12
node_modules/tunnel/test/keys/server2-csr.pem
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBvzCCASgCAQAwWjELMAkGA1UEBhMCSlAxEjAQBgNVBAsUCW5vZGVqc19qcDEQ
|
||||
MA4GA1UEAxMHc2VydmVyMjElMCMGCSqGSIb3DQEJARYWa29pY2hpa0BpbXByb3Zl
|
||||
bWVudC5qcDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxJCq/Uhxuo7X+VDX
|
||||
y7uusDYvI62wFuZHmMuxAlkRkRQxO2suDfCwzJjjt/9Xh9lqWNEDOSRcau/IaFUB
|
||||
A6IL6HlU8PjYt98qmOlS9lkb/OBTdgZgqwxiUPNxGHbCaj1J8bl725qu1YsN5fwR
|
||||
Lob7Ke9tinE6CK6rfJhyjHP5z0cCAwEAAaAlMCMGCSqGSIb3DQEJBzEWExRBIGNo
|
||||
YWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAAOBgQB3rCGCErgshGKEI5j9
|
||||
togUBwD3ul91yRFSBoV2hVGXsTOalWa0XCI+9+5QQEOBlj1pUT8eDU8ve55mX1UX
|
||||
AZEx+cbUQa9DNeiDAMX83GqHMD8fF2zqsY1mkg5zFKG3nhoIYSG15qXcpqAhxRpX
|
||||
NUQnZ4yzt2pE0aiFfkXa3PM42Q==
|
||||
-----END CERTIFICATE REQUEST-----
|
15
node_modules/tunnel/test/keys/server2-key.pem
generated
vendored
Normal file
15
node_modules/tunnel/test/keys/server2-key.pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQDEkKr9SHG6jtf5UNfLu66wNi8jrbAW5keYy7ECWRGRFDE7ay4N
|
||||
8LDMmOO3/1eH2WpY0QM5JFxq78hoVQEDogvoeVTw+Ni33yqY6VL2WRv84FN2BmCr
|
||||
DGJQ83EYdsJqPUnxuXvbmq7Viw3l/BEuhvsp722KcToIrqt8mHKMc/nPRwIDAQAB
|
||||
AoGAQ/bRaGoYCK1DN80gEC2ApSTW/7saW5CbyNUFCw7I6CTXMPhKID/MobFraz86
|
||||
gJpIDxWVy7gqzD7ESG67vwnUm52ITojQiY3JH7NCNhq/39/aYZOz2d7rBv2mvhk3
|
||||
w7gxUsmtPVUz3s2/h1KYaGpM3b68TwMS9nIiwwHDJS1aR8ECQQDu/kOy+Z/0EVKC
|
||||
APgiEzbxewAiy7BVzNppd8CR/5m1KxlsIoMr8OdLqVwiJ/13m3eZGkPNx5pLJ9Xv
|
||||
sXER0ZcPAkEA0o19xA1AJ/v5qsRaWJaA+ftgQ8ZanqsWXhM9abAvkPdFLPKYWTfO
|
||||
r9f8eUDH0+O9mA2eZ2mlsEcsmIHDTY6ESQJAO2lyIvfzT5VO0Yq0JKRqMDXHnt7M
|
||||
A0hds4JVmPXVnDgOpdcejLniheigQs12MVmwrZrd6DYKoUxR3rhZx3g2+QJBAK/2
|
||||
5fuaI1sHP+HSlbrhlUrWJd6egA+I5nma1MFmKGqb7Kki2eX+OPNGq87eL+LKuyG/
|
||||
h/nfFkTbRs7x67n+eFkCQQCPgy381Vpa7lmoNUfEVeMSNe74FNL05IlPDs/BHcci
|
||||
1GX9XzsFEqHLtJ5t1aWbGv39gb2WmPP3LJBsRPzLa2iQ
|
||||
-----END RSA PRIVATE KEY-----
|
16
node_modules/tunnel/test/keys/server2.cnf
generated
vendored
Normal file
16
node_modules/tunnel/test/keys/server2.cnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
days = 9999
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = JP
|
||||
OU = nodejs_jp
|
||||
CN = server2
|
||||
emailAddress = koichik@improvement.jp
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
|
43
node_modules/tunnel/test/keys/test.js
generated
vendored
Normal file
43
node_modules/tunnel/test/keys/test.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
var fs = require('fs');
|
||||
var tls = require('tls');
|
||||
|
||||
var server1Key = fs.readFileSync(__dirname + '/server1-key.pem');
|
||||
var server1Cert = fs.readFileSync(__dirname + '/server1-cert.pem');
|
||||
var clientKey = fs.readFileSync(__dirname + '/client-key.pem');
|
||||
var clientCert = fs.readFileSync(__dirname + '/client-cert.pem');
|
||||
var ca1Cert = fs.readFileSync(__dirname + '/ca1-cert.pem');
|
||||
var ca3Cert = fs.readFileSync(__dirname + '/ca3-cert.pem');
|
||||
|
||||
var server = tls.createServer({
|
||||
key: server1Key,
|
||||
cert: server1Cert,
|
||||
ca: [ca3Cert],
|
||||
requestCert: true,
|
||||
rejectUnauthorized: true,
|
||||
}, function(s) {
|
||||
console.log('connected on server');
|
||||
s.on('data', function(chunk) {
|
||||
console.log('S:' + chunk);
|
||||
s.write(chunk);
|
||||
});
|
||||
s.setEncoding('utf8');
|
||||
}).listen(3000, function() {
|
||||
var c = tls.connect({
|
||||
host: 'localhost',
|
||||
port: 3000,
|
||||
key: clientKey,
|
||||
cert: clientCert,
|
||||
ca: [ca1Cert],
|
||||
rejectUnauthorized: true
|
||||
}, function() {
|
||||
console.log('connected on client');
|
||||
c.on('data', function(chunk) {
|
||||
console.log('C:' + chunk);
|
||||
});
|
||||
c.setEncoding('utf8');
|
||||
c.write('Hello');
|
||||
});
|
||||
c.on('error', function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
4
node_modules/typed-rest-client/Handlers.d.ts
generated
vendored
Normal file
4
node_modules/typed-rest-client/Handlers.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export { BasicCredentialHandler } from "./handlers/basiccreds";
|
||||
export { BearerCredentialHandler } from "./handlers/bearertoken";
|
||||
export { NtlmCredentialHandler } from "./handlers/ntlm";
|
||||
export { PersonalAccessTokenCredentialHandler } from "./handlers/personalaccesstoken";
|
10
node_modules/typed-rest-client/Handlers.js
generated
vendored
Normal file
10
node_modules/typed-rest-client/Handlers.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var basiccreds_1 = require("./handlers/basiccreds");
|
||||
exports.BasicCredentialHandler = basiccreds_1.BasicCredentialHandler;
|
||||
var bearertoken_1 = require("./handlers/bearertoken");
|
||||
exports.BearerCredentialHandler = bearertoken_1.BearerCredentialHandler;
|
||||
var ntlm_1 = require("./handlers/ntlm");
|
||||
exports.NtlmCredentialHandler = ntlm_1.NtlmCredentialHandler;
|
||||
var personalaccesstoken_1 = require("./handlers/personalaccesstoken");
|
||||
exports.PersonalAccessTokenCredentialHandler = personalaccesstoken_1.PersonalAccessTokenCredentialHandler;
|
105
node_modules/typed-rest-client/HttpClient.d.ts
generated
vendored
Normal file
105
node_modules/typed-rest-client/HttpClient.d.ts
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
/// <reference types="node" />
|
||||
import url = require("url");
|
||||
import http = require("http");
|
||||
import ifm = require('./Interfaces');
|
||||
export declare enum HttpCodes {
|
||||
OK = 200,
|
||||
MultipleChoices = 300,
|
||||
MovedPermanently = 301,
|
||||
ResourceMoved = 302,
|
||||
SeeOther = 303,
|
||||
NotModified = 304,
|
||||
UseProxy = 305,
|
||||
SwitchProxy = 306,
|
||||
TemporaryRedirect = 307,
|
||||
PermanentRedirect = 308,
|
||||
BadRequest = 400,
|
||||
Unauthorized = 401,
|
||||
PaymentRequired = 402,
|
||||
Forbidden = 403,
|
||||
NotFound = 404,
|
||||
MethodNotAllowed = 405,
|
||||
NotAcceptable = 406,
|
||||
ProxyAuthenticationRequired = 407,
|
||||
RequestTimeout = 408,
|
||||
Conflict = 409,
|
||||
Gone = 410,
|
||||
TooManyRequests = 429,
|
||||
InternalServerError = 500,
|
||||
NotImplemented = 501,
|
||||
BadGateway = 502,
|
||||
ServiceUnavailable = 503,
|
||||
GatewayTimeout = 504
|
||||
}
|
||||
export declare class HttpClientResponse implements ifm.IHttpClientResponse {
|
||||
constructor(message: http.IncomingMessage);
|
||||
message: http.IncomingMessage;
|
||||
readBody(): Promise<string>;
|
||||
}
|
||||
export interface RequestInfo {
|
||||
options: http.RequestOptions;
|
||||
parsedUrl: url.Url;
|
||||
httpModule: any;
|
||||
}
|
||||
export declare function isHttps(requestUrl: string): boolean;
|
||||
export declare class HttpClient implements ifm.IHttpClient {
|
||||
userAgent: string | null | undefined;
|
||||
handlers: ifm.IRequestHandler[];
|
||||
requestOptions: ifm.IRequestOptions;
|
||||
private _ignoreSslError;
|
||||
private _socketTimeout;
|
||||
private _httpProxy;
|
||||
private _httpProxyBypassHosts;
|
||||
private _allowRedirects;
|
||||
private _allowRedirectDowngrade;
|
||||
private _maxRedirects;
|
||||
private _allowRetries;
|
||||
private _maxRetries;
|
||||
private _agent;
|
||||
private _proxyAgent;
|
||||
private _keepAlive;
|
||||
private _disposed;
|
||||
private _certConfig;
|
||||
private _ca;
|
||||
private _cert;
|
||||
private _key;
|
||||
constructor(userAgent: string | null | undefined, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
|
||||
options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
post(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
patch(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
/**
|
||||
* Makes a raw http request.
|
||||
* All other methods such as get, post, patch, and request ultimately call this.
|
||||
* Prefer get, del, post and patch
|
||||
*/
|
||||
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
/**
|
||||
* Needs to be called if keepAlive is set to true in request options.
|
||||
*/
|
||||
dispose(): void;
|
||||
/**
|
||||
* Raw request.
|
||||
* @param info
|
||||
* @param data
|
||||
*/
|
||||
requestRaw(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream): Promise<ifm.IHttpClientResponse>;
|
||||
/**
|
||||
* Raw request with callback.
|
||||
* @param info
|
||||
* @param data
|
||||
* @param onResult
|
||||
*/
|
||||
requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void;
|
||||
private _prepareRequest;
|
||||
private _isPresigned;
|
||||
private _mergeHeaders;
|
||||
private _getAgent;
|
||||
private _getProxy;
|
||||
private _isMatchInBypassProxyList;
|
||||
private _performExponentialBackoff;
|
||||
}
|
487
node_modules/typed-rest-client/HttpClient.js
generated
vendored
Normal file
487
node_modules/typed-rest-client/HttpClient.js
generated
vendored
Normal file
@ -0,0 +1,487 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const url = require("url");
|
||||
const http = require("http");
|
||||
const https = require("https");
|
||||
const util = require("./Util");
|
||||
let fs;
|
||||
let tunnel;
|
||||
var HttpCodes;
|
||||
(function (HttpCodes) {
|
||||
HttpCodes[HttpCodes["OK"] = 200] = "OK";
|
||||
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
|
||||
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
|
||||
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
|
||||
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
|
||||
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
|
||||
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
|
||||
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
|
||||
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
||||
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
|
||||
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
|
||||
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
|
||||
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
|
||||
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
|
||||
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
|
||||
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
||||
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
|
||||
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
||||
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
||||
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
||||
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
||||
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
|
||||
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
||||
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
||||
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
||||
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
||||
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
||||
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
||||
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
|
||||
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
|
||||
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
||||
const ExponentialBackoffCeiling = 10;
|
||||
const ExponentialBackoffTimeSlice = 5;
|
||||
class HttpClientResponse {
|
||||
constructor(message) {
|
||||
this.message = message;
|
||||
}
|
||||
readBody() {
|
||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
||||
let buffer = Buffer.alloc(0);
|
||||
const encodingCharset = util.obtainContentCharset(this);
|
||||
// Extract Encoding from header: 'content-encoding'
|
||||
// Match `gzip`, `gzip, deflate` variations of GZIP encoding
|
||||
const contentEncoding = this.message.headers['content-encoding'] || '';
|
||||
const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding);
|
||||
this.message.on('data', function (data) {
|
||||
const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data;
|
||||
buffer = Buffer.concat([buffer, chunk]);
|
||||
}).on('end', function () {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (isGzippedEncoded) { // Process GZipped Response Body HERE
|
||||
const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset);
|
||||
resolve(gunzippedBody);
|
||||
}
|
||||
resolve(buffer.toString(encodingCharset));
|
||||
});
|
||||
}).on('error', function (err) {
|
||||
reject(err);
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
exports.HttpClientResponse = HttpClientResponse;
|
||||
function isHttps(requestUrl) {
|
||||
let parsedUrl = url.parse(requestUrl);
|
||||
return parsedUrl.protocol === 'https:';
|
||||
}
|
||||
exports.isHttps = isHttps;
|
||||
var EnvironmentVariables;
|
||||
(function (EnvironmentVariables) {
|
||||
EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
|
||||
EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
|
||||
EnvironmentVariables["NO_PROXY"] = "NO_PROXY";
|
||||
})(EnvironmentVariables || (EnvironmentVariables = {}));
|
||||
class HttpClient {
|
||||
constructor(userAgent, handlers, requestOptions) {
|
||||
this._ignoreSslError = false;
|
||||
this._allowRedirects = true;
|
||||
this._allowRedirectDowngrade = false;
|
||||
this._maxRedirects = 50;
|
||||
this._allowRetries = false;
|
||||
this._maxRetries = 1;
|
||||
this._keepAlive = false;
|
||||
this._disposed = false;
|
||||
this.userAgent = userAgent;
|
||||
this.handlers = handlers || [];
|
||||
let no_proxy = process.env[EnvironmentVariables.NO_PROXY];
|
||||
if (no_proxy) {
|
||||
this._httpProxyBypassHosts = [];
|
||||
no_proxy.split(',').forEach(bypass => {
|
||||
this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
|
||||
});
|
||||
}
|
||||
this.requestOptions = requestOptions;
|
||||
if (requestOptions) {
|
||||
if (requestOptions.ignoreSslError != null) {
|
||||
this._ignoreSslError = requestOptions.ignoreSslError;
|
||||
}
|
||||
this._socketTimeout = requestOptions.socketTimeout;
|
||||
this._httpProxy = requestOptions.proxy;
|
||||
if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
|
||||
this._httpProxyBypassHosts = [];
|
||||
requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
|
||||
this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
|
||||
});
|
||||
}
|
||||
this._certConfig = requestOptions.cert;
|
||||
if (this._certConfig) {
|
||||
// If using cert, need fs
|
||||
fs = require('fs');
|
||||
// cache the cert content into memory, so we don't have to read it from disk every time
|
||||
if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
|
||||
this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
|
||||
}
|
||||
if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
|
||||
this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
|
||||
}
|
||||
if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
|
||||
this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
|
||||
}
|
||||
}
|
||||
if (requestOptions.allowRedirects != null) {
|
||||
this._allowRedirects = requestOptions.allowRedirects;
|
||||
}
|
||||
if (requestOptions.allowRedirectDowngrade != null) {
|
||||
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
||||
}
|
||||
if (requestOptions.maxRedirects != null) {
|
||||
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
||||
}
|
||||
if (requestOptions.keepAlive != null) {
|
||||
this._keepAlive = requestOptions.keepAlive;
|
||||
}
|
||||
if (requestOptions.allowRetries != null) {
|
||||
this._allowRetries = requestOptions.allowRetries;
|
||||
}
|
||||
if (requestOptions.maxRetries != null) {
|
||||
this._maxRetries = requestOptions.maxRetries;
|
||||
}
|
||||
}
|
||||
}
|
||||
options(requestUrl, additionalHeaders) {
|
||||
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
get(requestUrl, additionalHeaders) {
|
||||
return this.request('GET', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
del(requestUrl, additionalHeaders) {
|
||||
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
post(requestUrl, data, additionalHeaders) {
|
||||
return this.request('POST', requestUrl, data, additionalHeaders || {});
|
||||
}
|
||||
patch(requestUrl, data, additionalHeaders) {
|
||||
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
|
||||
}
|
||||
put(requestUrl, data, additionalHeaders) {
|
||||
return this.request('PUT', requestUrl, data, additionalHeaders || {});
|
||||
}
|
||||
head(requestUrl, additionalHeaders) {
|
||||
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
||||
return this.request(verb, requestUrl, stream, additionalHeaders);
|
||||
}
|
||||
/**
|
||||
* Makes a raw http request.
|
||||
* All other methods such as get, post, patch, and request ultimately call this.
|
||||
* Prefer get, del, post and patch
|
||||
*/
|
||||
request(verb, requestUrl, data, headers) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (this._disposed) {
|
||||
throw new Error("Client has already been disposed.");
|
||||
}
|
||||
let parsedUrl = url.parse(requestUrl);
|
||||
let info = this._prepareRequest(verb, parsedUrl, headers);
|
||||
// Only perform retries on reads since writes may not be idempotent.
|
||||
let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
|
||||
let numTries = 0;
|
||||
let response;
|
||||
while (numTries < maxTries) {
|
||||
response = yield this.requestRaw(info, data);
|
||||
// Check if it's an authentication challenge
|
||||
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
||||
let authenticationHandler;
|
||||
for (let i = 0; i < this.handlers.length; i++) {
|
||||
if (this.handlers[i].canHandleAuthentication(response)) {
|
||||
authenticationHandler = this.handlers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (authenticationHandler) {
|
||||
return authenticationHandler.handleAuthentication(this, info, data);
|
||||
}
|
||||
else {
|
||||
// We have received an unauthorized response but have no handlers to handle it.
|
||||
// Let the response return to the caller.
|
||||
return response;
|
||||
}
|
||||
}
|
||||
let redirectsRemaining = this._maxRedirects;
|
||||
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
|
||||
&& this._allowRedirects
|
||||
&& redirectsRemaining > 0) {
|
||||
const redirectUrl = response.message.headers["location"];
|
||||
if (!redirectUrl) {
|
||||
// if there's no location to redirect to, we won't
|
||||
break;
|
||||
}
|
||||
let parsedRedirectUrl = url.parse(redirectUrl);
|
||||
if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
|
||||
throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
|
||||
}
|
||||
// we need to finish reading the response before reassigning response
|
||||
// which will leak the open socket.
|
||||
yield response.readBody();
|
||||
// let's make the request with the new redirectUrl
|
||||
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||
response = yield this.requestRaw(info, data);
|
||||
redirectsRemaining--;
|
||||
}
|
||||
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
|
||||
// If not a retry code, return immediately instead of retrying
|
||||
return response;
|
||||
}
|
||||
numTries += 1;
|
||||
if (numTries < maxTries) {
|
||||
yield response.readBody();
|
||||
yield this._performExponentialBackoff(numTries);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Needs to be called if keepAlive is set to true in request options.
|
||||
*/
|
||||
dispose() {
|
||||
if (this._agent) {
|
||||
this._agent.destroy();
|
||||
}
|
||||
this._disposed = true;
|
||||
}
|
||||
/**
|
||||
* Raw request.
|
||||
* @param info
|
||||
* @param data
|
||||
*/
|
||||
requestRaw(info, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let callbackForResult = function (err, res) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve(res);
|
||||
};
|
||||
this.requestRawWithCallback(info, data, callbackForResult);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Raw request with callback.
|
||||
* @param info
|
||||
* @param data
|
||||
* @param onResult
|
||||
*/
|
||||
requestRawWithCallback(info, data, onResult) {
|
||||
let socket;
|
||||
let isDataString = typeof (data) === 'string';
|
||||
if (typeof (data) === 'string') {
|
||||
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
|
||||
}
|
||||
let callbackCalled = false;
|
||||
let handleResult = (err, res) => {
|
||||
if (!callbackCalled) {
|
||||
callbackCalled = true;
|
||||
onResult(err, res);
|
||||
}
|
||||
};
|
||||
let req = info.httpModule.request(info.options, (msg) => {
|
||||
let res = new HttpClientResponse(msg);
|
||||
handleResult(null, res);
|
||||
});
|
||||
req.on('socket', (sock) => {
|
||||
socket = sock;
|
||||
});
|
||||
// If we ever get disconnected, we want the socket to timeout eventually
|
||||
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
|
||||
if (socket) {
|
||||
socket.end();
|
||||
}
|
||||
handleResult(new Error('Request timeout: ' + info.options.path), null);
|
||||
});
|
||||
req.on('error', function (err) {
|
||||
// err has statusCode property
|
||||
// res should have headers
|
||||
handleResult(err, null);
|
||||
});
|
||||
if (data && typeof (data) === 'string') {
|
||||
req.write(data, 'utf8');
|
||||
}
|
||||
if (data && typeof (data) !== 'string') {
|
||||
data.on('close', function () {
|
||||
req.end();
|
||||
});
|
||||
data.pipe(req);
|
||||
}
|
||||
else {
|
||||
req.end();
|
||||
}
|
||||
}
|
||||
_prepareRequest(method, requestUrl, headers) {
|
||||
const info = {};
|
||||
info.parsedUrl = requestUrl;
|
||||
const usingSsl = info.parsedUrl.protocol === 'https:';
|
||||
info.httpModule = usingSsl ? https : http;
|
||||
const defaultPort = usingSsl ? 443 : 80;
|
||||
info.options = {};
|
||||
info.options.host = info.parsedUrl.hostname;
|
||||
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
|
||||
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||
info.options.method = method;
|
||||
info.options.headers = this._mergeHeaders(headers);
|
||||
if (this.userAgent != null) {
|
||||
info.options.headers["user-agent"] = this.userAgent;
|
||||
}
|
||||
info.options.agent = this._getAgent(info.parsedUrl);
|
||||
// gives handlers an opportunity to participate
|
||||
if (this.handlers && !this._isPresigned(url.format(requestUrl))) {
|
||||
this.handlers.forEach((handler) => {
|
||||
handler.prepareRequest(info.options);
|
||||
});
|
||||
}
|
||||
return info;
|
||||
}
|
||||
_isPresigned(requestUrl) {
|
||||
if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
|
||||
const patterns = this.requestOptions.presignedUrlPatterns;
|
||||
for (let i = 0; i < patterns.length; i++) {
|
||||
if (requestUrl.match(patterns[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
_mergeHeaders(headers) {
|
||||
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
||||
if (this.requestOptions && this.requestOptions.headers) {
|
||||
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
|
||||
}
|
||||
return lowercaseKeys(headers || {});
|
||||
}
|
||||
_getAgent(parsedUrl) {
|
||||
let agent;
|
||||
let proxy = this._getProxy(parsedUrl);
|
||||
let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isMatchInBypassProxyList(parsedUrl);
|
||||
if (this._keepAlive && useProxy) {
|
||||
agent = this._proxyAgent;
|
||||
}
|
||||
if (this._keepAlive && !useProxy) {
|
||||
agent = this._agent;
|
||||
}
|
||||
// if agent is already assigned use that agent.
|
||||
if (!!agent) {
|
||||
return agent;
|
||||
}
|
||||
const usingSsl = parsedUrl.protocol === 'https:';
|
||||
let maxSockets = 100;
|
||||
if (!!this.requestOptions) {
|
||||
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
||||
}
|
||||
if (useProxy) {
|
||||
// If using proxy, need tunnel
|
||||
if (!tunnel) {
|
||||
tunnel = require('tunnel');
|
||||
}
|
||||
const agentOptions = {
|
||||
maxSockets: maxSockets,
|
||||
keepAlive: this._keepAlive,
|
||||
proxy: {
|
||||
proxyAuth: proxy.proxyAuth,
|
||||
host: proxy.proxyUrl.hostname,
|
||||
port: proxy.proxyUrl.port
|
||||
},
|
||||
};
|
||||
let tunnelAgent;
|
||||
const overHttps = proxy.proxyUrl.protocol === 'https:';
|
||||
if (usingSsl) {
|
||||
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
||||
}
|
||||
else {
|
||||
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
||||
}
|
||||
agent = tunnelAgent(agentOptions);
|
||||
this._proxyAgent = agent;
|
||||
}
|
||||
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
||||
if (this._keepAlive && !agent) {
|
||||
const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
|
||||
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
||||
this._agent = agent;
|
||||
}
|
||||
// if not using private agent and tunnel agent isn't setup then use global agent
|
||||
if (!agent) {
|
||||
agent = usingSsl ? https.globalAgent : http.globalAgent;
|
||||
}
|
||||
if (usingSsl && this._ignoreSslError) {
|
||||
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
||||
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
||||
// we have to cast it to any and change it directly
|
||||
agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
|
||||
}
|
||||
if (usingSsl && this._certConfig) {
|
||||
agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
|
||||
}
|
||||
return agent;
|
||||
}
|
||||
_getProxy(parsedUrl) {
|
||||
let usingSsl = parsedUrl.protocol === 'https:';
|
||||
let proxyConfig = this._httpProxy;
|
||||
// fallback to http_proxy and https_proxy env
|
||||
let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
|
||||
let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
|
||||
if (!proxyConfig) {
|
||||
if (https_proxy && usingSsl) {
|
||||
proxyConfig = {
|
||||
proxyUrl: https_proxy
|
||||
};
|
||||
}
|
||||
else if (http_proxy) {
|
||||
proxyConfig = {
|
||||
proxyUrl: http_proxy
|
||||
};
|
||||
}
|
||||
}
|
||||
let proxyUrl;
|
||||
let proxyAuth;
|
||||
if (proxyConfig) {
|
||||
if (proxyConfig.proxyUrl.length > 0) {
|
||||
proxyUrl = url.parse(proxyConfig.proxyUrl);
|
||||
}
|
||||
if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
|
||||
proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
|
||||
}
|
||||
}
|
||||
return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
|
||||
}
|
||||
_isMatchInBypassProxyList(parsedUrl) {
|
||||
if (!this._httpProxyBypassHosts) {
|
||||
return false;
|
||||
}
|
||||
let bypass = false;
|
||||
this._httpProxyBypassHosts.forEach(bypassHost => {
|
||||
if (bypassHost.test(parsedUrl.href)) {
|
||||
bypass = true;
|
||||
}
|
||||
});
|
||||
return bypass;
|
||||
}
|
||||
_performExponentialBackoff(retryNumber) {
|
||||
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
||||
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
||||
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
||||
}
|
||||
}
|
||||
exports.HttpClient = HttpClient;
|
1
node_modules/typed-rest-client/Index.d.ts
generated
vendored
Normal file
1
node_modules/typed-rest-client/Index.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
2
node_modules/typed-rest-client/Index.js
generated
vendored
Normal file
2
node_modules/typed-rest-client/Index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
74
node_modules/typed-rest-client/Interfaces.d.ts
generated
vendored
Normal file
74
node_modules/typed-rest-client/Interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
/// <reference types="node" />
|
||||
import http = require("http");
|
||||
import url = require("url");
|
||||
export interface IHeaders {
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface IBasicCredentials {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
export interface IHttpClient {
|
||||
options(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
get(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
del(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
post(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
patch(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
put(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: IHeaders): Promise<IHttpClientResponse>;
|
||||
requestRaw(info: IRequestInfo, data: string | NodeJS.ReadableStream): Promise<IHttpClientResponse>;
|
||||
requestRawWithCallback(info: IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: IHttpClientResponse) => void): void;
|
||||
}
|
||||
export interface IRequestHandler {
|
||||
prepareRequest(options: http.RequestOptions): void;
|
||||
canHandleAuthentication(response: IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: IHttpClient, requestInfo: IRequestInfo, objs: any): Promise<IHttpClientResponse>;
|
||||
}
|
||||
export interface IHttpClientResponse {
|
||||
message: http.IncomingMessage;
|
||||
readBody(): Promise<string>;
|
||||
}
|
||||
export interface IRequestInfo {
|
||||
options: http.RequestOptions;
|
||||
parsedUrl: url.Url;
|
||||
httpModule: any;
|
||||
}
|
||||
export interface IRequestOptions {
|
||||
headers?: IHeaders;
|
||||
socketTimeout?: number;
|
||||
ignoreSslError?: boolean;
|
||||
proxy?: IProxyConfiguration;
|
||||
cert?: ICertConfiguration;
|
||||
allowRedirects?: boolean;
|
||||
allowRedirectDowngrade?: boolean;
|
||||
maxRedirects?: number;
|
||||
maxSockets?: number;
|
||||
keepAlive?: boolean;
|
||||
presignedUrlPatterns?: RegExp[];
|
||||
allowRetries?: boolean;
|
||||
maxRetries?: number;
|
||||
}
|
||||
export interface IProxyConfiguration {
|
||||
proxyUrl: string;
|
||||
proxyUsername?: string;
|
||||
proxyPassword?: string;
|
||||
proxyBypassHosts?: string[];
|
||||
}
|
||||
export interface ICertConfiguration {
|
||||
caFile?: string;
|
||||
certFile?: string;
|
||||
keyFile?: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
export interface IRequestQueryParams {
|
||||
options?: {
|
||||
separator?: string;
|
||||
arrayFormat?: string;
|
||||
shouldAllowDots?: boolean;
|
||||
shouldOnlyEncodeValues?: boolean;
|
||||
};
|
||||
params: {
|
||||
[name: string]: string | number | (string | number)[];
|
||||
};
|
||||
}
|
5
node_modules/typed-rest-client/Interfaces.js
generated
vendored
Normal file
5
node_modules/typed-rest-client/Interfaces.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
;
|
21
node_modules/typed-rest-client/LICENSE
generated
vendored
Normal file
21
node_modules/typed-rest-client/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Typed Rest Client for Node.js
|
||||
|
||||
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.
|
110
node_modules/typed-rest-client/README.md
generated
vendored
Normal file
110
node_modules/typed-rest-client/README.md
generated
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
|
||||
<a href="https://github.com/microsoft/typed-rest-client"><img alt="GitHub Actions status" src="https://github.com/microsoft/typed-rest-client/workflows/all-tests/badge.svg"></a>
|
||||
|
||||
[](https://dev.azure.com/ms/typed-rest-client/_build/latest?definitionId=42&branchName=master)
|
||||
|
||||
|
||||
# Typed REST and HTTP Client with TypeScript Typings
|
||||
|
||||
A lightweight REST and HTTP client optimized for use with TypeScript with generics and async await.
|
||||
|
||||
## Features
|
||||
|
||||
- REST and HTTP client with TypeScript generics and async/await/Promises
|
||||
- Typings included so no need to acquire separately (great for intellisense and no versioning drift)
|
||||
- Basic, Bearer and NTLM Support out of the box. Extensible handlers for others.
|
||||
- Proxy support
|
||||
- Certificate support (Self-signed server and client cert)
|
||||
- Redirects supported
|
||||
|
||||
Intellisense and compile support:
|
||||
|
||||

|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install typed-rest-client --save
|
||||
```
|
||||
|
||||
Or to install the latest preview:
|
||||
```
|
||||
npm install typed-rest-client@preview --save
|
||||
```
|
||||
|
||||
## Samples
|
||||
|
||||
See the [samples](./samples) for complete coding examples. Also see the [REST](./test/tests/resttests.ts) and [HTTP](./test/tests/httptests.ts) tests for detailed examples.
|
||||
|
||||
## Errors
|
||||
|
||||
### HTTP
|
||||
|
||||
The HTTP client does not throw unless truly exceptional.
|
||||
|
||||
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
||||
* Redirects (3xx) will be followed by default.
|
||||
|
||||
|
||||
See [HTTP tests](./test/tests/httptests.ts) for detailed examples.
|
||||
|
||||
### REST
|
||||
|
||||
The REST client is a high-level client which uses the HTTP client. Its responsibility is to turn a body into a typed resource object.
|
||||
|
||||
* A 200 will be success.
|
||||
* Redirects (3xx) will be followed.
|
||||
* A 404 will not throw but the result object will be null and the result statusCode will be set.
|
||||
* Other 4xx and 5xx errors will throw. The status code will be attached to the error object. If a RESTful error object is returned (`{ message: xxx}`), then the error message will be that. Otherwise, it will be a generic, `Failed Request: (xxx)`.
|
||||
|
||||
See [REST tests](./test/tests/resttests.ts) for detailed examples.
|
||||
|
||||
## Debugging
|
||||
|
||||
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||
|
||||
```
|
||||
export NODE_DEBUG=http
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
set NODE_DEBUG=http
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Node support
|
||||
|
||||
The typed-rest-client is built using the latest LTS version of Node 8. We also support the latest LTS for Node 4 and Node 6.
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute to this repository, see the [contribution guide](./CONTRIBUTING.md)
|
||||
|
||||
To build:
|
||||
|
||||
```bash
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
To run all tests:
|
||||
```bash
|
||||
$ npm test
|
||||
```
|
||||
|
||||
To just run unit tests:
|
||||
```bash
|
||||
$ npm run units
|
||||
```
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Security Issues
|
||||
|
||||
Do you think there might be a security issue?
|
||||
Have you been phished or identified a security vulnerability?
|
||||
Please don't report it here - let us know by sending an email to secure@microsoft.com.
|
78
node_modules/typed-rest-client/RestClient.d.ts
generated
vendored
Normal file
78
node_modules/typed-rest-client/RestClient.d.ts
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
/// <reference types="node" />
|
||||
import httpm = require('./HttpClient');
|
||||
import ifm = require("./Interfaces");
|
||||
export interface IRestResponse<T> {
|
||||
statusCode: number;
|
||||
result: T | null;
|
||||
headers: Object;
|
||||
}
|
||||
export interface IRequestOptions {
|
||||
acceptHeader?: string;
|
||||
additionalHeaders?: ifm.IHeaders;
|
||||
responseProcessor?: Function;
|
||||
deserializeDates?: boolean;
|
||||
queryParameters?: ifm.IRequestQueryParams;
|
||||
}
|
||||
export declare class RestClient {
|
||||
client: httpm.HttpClient;
|
||||
versionParam: string;
|
||||
/**
|
||||
* Creates an instance of the RestClient
|
||||
* @constructor
|
||||
* @param {string} userAgent - userAgent for requests
|
||||
* @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this
|
||||
* @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied)
|
||||
* @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout)
|
||||
*/
|
||||
constructor(userAgent: string, baseUrl?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
|
||||
private _baseUrl;
|
||||
/**
|
||||
* Gets a resource from an endpoint
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} requestUrl - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
options<T>(requestUrl: string, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
/**
|
||||
* Gets a resource from an endpoint
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified url or relative path
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
get<T>(resource: string, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
/**
|
||||
* Deletes a resource from an endpoint
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
del<T>(resource: string, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
/**
|
||||
* Creates resource(s) from an endpoint
|
||||
* T type of object returned.
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
create<T>(resource: string, resources: any, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
/**
|
||||
* Updates resource(s) from an endpoint
|
||||
* T type of object returned.
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
update<T>(resource: string, resources: any, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
/**
|
||||
* Replaces resource(s) from an endpoint
|
||||
* T type of object returned.
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
replace<T>(resource: string, resources: any, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
uploadStream<T>(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, options?: IRequestOptions): Promise<IRestResponse<T>>;
|
||||
private _headersFromOptions;
|
||||
private static dateTimeDeserializer;
|
||||
private _processResponse;
|
||||
}
|
217
node_modules/typed-rest-client/RestClient.js
generated
vendored
Normal file
217
node_modules/typed-rest-client/RestClient.js
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const httpm = require("./HttpClient");
|
||||
const util = require("./Util");
|
||||
class RestClient {
|
||||
/**
|
||||
* Creates an instance of the RestClient
|
||||
* @constructor
|
||||
* @param {string} userAgent - userAgent for requests
|
||||
* @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this
|
||||
* @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied)
|
||||
* @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout)
|
||||
*/
|
||||
constructor(userAgent, baseUrl, handlers, requestOptions) {
|
||||
this.client = new httpm.HttpClient(userAgent, handlers, requestOptions);
|
||||
if (baseUrl) {
|
||||
this._baseUrl = baseUrl;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Gets a resource from an endpoint
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} requestUrl - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
options(requestUrl, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(requestUrl, this._baseUrl);
|
||||
let res = yield this.client.options(url, this._headersFromOptions(options));
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Gets a resource from an endpoint
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified url or relative path
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
get(resource, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters);
|
||||
let res = yield this.client.get(url, this._headersFromOptions(options));
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Deletes a resource from an endpoint
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
del(resource, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(resource, this._baseUrl);
|
||||
let res = yield this.client.del(url, this._headersFromOptions(options));
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Creates resource(s) from an endpoint
|
||||
* T type of object returned.
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
create(resource, resources, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(resource, this._baseUrl);
|
||||
let headers = this._headersFromOptions(options, true);
|
||||
let data = JSON.stringify(resources, null, 2);
|
||||
let res = yield this.client.post(url, data, headers);
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Updates resource(s) from an endpoint
|
||||
* T type of object returned.
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
update(resource, resources, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(resource, this._baseUrl);
|
||||
let headers = this._headersFromOptions(options, true);
|
||||
let data = JSON.stringify(resources, null, 2);
|
||||
let res = yield this.client.patch(url, data, headers);
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Replaces resource(s) from an endpoint
|
||||
* T type of object returned.
|
||||
* Be aware that not found returns a null. Other error conditions reject the promise
|
||||
* @param {string} resource - fully qualified or relative url
|
||||
* @param {IRequestOptions} requestOptions - (optional) requestOptions object
|
||||
*/
|
||||
replace(resource, resources, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(resource, this._baseUrl);
|
||||
let headers = this._headersFromOptions(options, true);
|
||||
let data = JSON.stringify(resources, null, 2);
|
||||
let res = yield this.client.put(url, data, headers);
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
uploadStream(verb, requestUrl, stream, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let url = util.getUrl(requestUrl, this._baseUrl);
|
||||
let headers = this._headersFromOptions(options, true);
|
||||
let res = yield this.client.sendStream(verb, url, stream, headers);
|
||||
return this._processResponse(res, options);
|
||||
});
|
||||
}
|
||||
_headersFromOptions(options, contentType) {
|
||||
options = options || {};
|
||||
let headers = options.additionalHeaders || {};
|
||||
headers["Accept"] = options.acceptHeader || "application/json";
|
||||
if (contentType) {
|
||||
let found = false;
|
||||
for (let header in headers) {
|
||||
if (header.toLowerCase() == "content-type") {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
headers["Content-Type"] = 'application/json; charset=utf-8';
|
||||
}
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
static dateTimeDeserializer(key, value) {
|
||||
if (typeof value === 'string') {
|
||||
let a = new Date(value);
|
||||
if (!isNaN(a.valueOf())) {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
_processResponse(res, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
||||
const statusCode = res.message.statusCode;
|
||||
const response = {
|
||||
statusCode: statusCode,
|
||||
result: null,
|
||||
headers: {}
|
||||
};
|
||||
// not found leads to null obj returned
|
||||
if (statusCode == httpm.HttpCodes.NotFound) {
|
||||
resolve(response);
|
||||
}
|
||||
let obj;
|
||||
let contents;
|
||||
// get the result from the body
|
||||
try {
|
||||
contents = yield res.readBody();
|
||||
if (contents && contents.length > 0) {
|
||||
if (options && options.deserializeDates) {
|
||||
obj = JSON.parse(contents, RestClient.dateTimeDeserializer);
|
||||
}
|
||||
else {
|
||||
obj = JSON.parse(contents);
|
||||
}
|
||||
if (options && options.responseProcessor) {
|
||||
response.result = options.responseProcessor(obj);
|
||||
}
|
||||
else {
|
||||
response.result = obj;
|
||||
}
|
||||
}
|
||||
response.headers = res.message.headers;
|
||||
}
|
||||
catch (err) {
|
||||
// Invalid resource (contents not json); leaving result obj null
|
||||
}
|
||||
// note that 3xx redirects are handled by the http layer.
|
||||
if (statusCode > 299) {
|
||||
let msg;
|
||||
// if exception/error in body, attempt to get better error
|
||||
if (obj && obj.message) {
|
||||
msg = obj.message;
|
||||
}
|
||||
else if (contents && contents.length > 0) {
|
||||
// it may be the case that the exception is in the body message as string
|
||||
msg = contents;
|
||||
}
|
||||
else {
|
||||
msg = "Failed request: (" + statusCode + ")";
|
||||
}
|
||||
let err = new Error(msg);
|
||||
// attach statusCode and body obj (if available) to the error object
|
||||
err['statusCode'] = statusCode;
|
||||
if (response.result) {
|
||||
err['result'] = response.result;
|
||||
}
|
||||
reject(err);
|
||||
}
|
||||
else {
|
||||
resolve(response);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.RestClient = RestClient;
|
1318
node_modules/typed-rest-client/ThirdPartyNotice.txt
generated
vendored
Normal file
1318
node_modules/typed-rest-client/ThirdPartyNotice.txt
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
28
node_modules/typed-rest-client/Util.d.ts
generated
vendored
Normal file
28
node_modules/typed-rest-client/Util.d.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/// <reference types="node" />
|
||||
import { IRequestQueryParams, IHttpClientResponse } from './Interfaces';
|
||||
/**
|
||||
* creates an url from a request url and optional base url (http://server:8080)
|
||||
* @param {string} resource - a fully qualified url or relative path
|
||||
* @param {string} baseUrl - an optional baseUrl (http://server:8080)
|
||||
* @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g.
|
||||
* @return {string} - resultant url
|
||||
*/
|
||||
export declare function getUrl(resource: string, baseUrl?: string, queryParams?: IRequestQueryParams): string;
|
||||
/**
|
||||
* Decompress/Decode gzip encoded JSON
|
||||
* Using Node.js built-in zlib module
|
||||
*
|
||||
* @param {Buffer} buffer
|
||||
* @param {string} charset? - optional; defaults to 'utf-8'
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
export declare function decompressGzippedContent(buffer: Buffer, charset?: string): Promise<string>;
|
||||
/**
|
||||
* Obtain Response's Content Charset.
|
||||
* Through inspecting `content-type` response header.
|
||||
* It Returns 'utf-8' if NO charset specified/matched.
|
||||
*
|
||||
* @param {IHttpClientResponse} response
|
||||
* @return {string} - Content Encoding Charset; Default=utf-8
|
||||
*/
|
||||
export declare function obtainContentCharset(response: IHttpClientResponse): string;
|
118
node_modules/typed-rest-client/Util.js
generated
vendored
Normal file
118
node_modules/typed-rest-client/Util.js
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const qs = require("qs");
|
||||
const url = require("url");
|
||||
const path = require("path");
|
||||
const zlib = require("zlib");
|
||||
/**
|
||||
* creates an url from a request url and optional base url (http://server:8080)
|
||||
* @param {string} resource - a fully qualified url or relative path
|
||||
* @param {string} baseUrl - an optional baseUrl (http://server:8080)
|
||||
* @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g.
|
||||
* @return {string} - resultant url
|
||||
*/
|
||||
function getUrl(resource, baseUrl, queryParams) {
|
||||
const pathApi = path.posix || path;
|
||||
let requestUrl = '';
|
||||
if (!baseUrl) {
|
||||
requestUrl = resource;
|
||||
}
|
||||
else if (!resource) {
|
||||
requestUrl = baseUrl;
|
||||
}
|
||||
else {
|
||||
const base = url.parse(baseUrl);
|
||||
const resultantUrl = url.parse(resource);
|
||||
// resource (specific per request) elements take priority
|
||||
resultantUrl.protocol = resultantUrl.protocol || base.protocol;
|
||||
resultantUrl.auth = resultantUrl.auth || base.auth;
|
||||
resultantUrl.host = resultantUrl.host || base.host;
|
||||
resultantUrl.pathname = pathApi.resolve(base.pathname, resultantUrl.pathname);
|
||||
if (!resultantUrl.pathname.endsWith('/') && resource.endsWith('/')) {
|
||||
resultantUrl.pathname += '/';
|
||||
}
|
||||
requestUrl = url.format(resultantUrl);
|
||||
}
|
||||
return queryParams ?
|
||||
getUrlWithParsedQueryParams(requestUrl, queryParams) :
|
||||
requestUrl;
|
||||
}
|
||||
exports.getUrl = getUrl;
|
||||
/**
|
||||
*
|
||||
* @param {string} requestUrl
|
||||
* @param {IRequestQueryParams} queryParams
|
||||
* @return {string} - Request's URL with Query Parameters appended/parsed.
|
||||
*/
|
||||
function getUrlWithParsedQueryParams(requestUrl, queryParams) {
|
||||
const url = requestUrl.replace(/\?$/g, ''); // Clean any extra end-of-string "?" character
|
||||
const parsedQueryParams = qs.stringify(queryParams.params, buildParamsStringifyOptions(queryParams));
|
||||
return `${url}${parsedQueryParams}`;
|
||||
}
|
||||
/**
|
||||
* Build options for QueryParams Stringifying.
|
||||
*
|
||||
* @param {IRequestQueryParams} queryParams
|
||||
* @return {object}
|
||||
*/
|
||||
function buildParamsStringifyOptions(queryParams) {
|
||||
let options = {
|
||||
addQueryPrefix: true,
|
||||
delimiter: (queryParams.options || {}).separator || '&',
|
||||
allowDots: (queryParams.options || {}).shouldAllowDots || false,
|
||||
arrayFormat: (queryParams.options || {}).arrayFormat || 'repeat',
|
||||
encodeValuesOnly: (queryParams.options || {}).shouldOnlyEncodeValues || true
|
||||
};
|
||||
return options;
|
||||
}
|
||||
/**
|
||||
* Decompress/Decode gzip encoded JSON
|
||||
* Using Node.js built-in zlib module
|
||||
*
|
||||
* @param {Buffer} buffer
|
||||
* @param {string} charset? - optional; defaults to 'utf-8'
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
function decompressGzippedContent(buffer, charset) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
||||
zlib.gunzip(buffer, function (error, buffer) {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
resolve(buffer.toString(charset || 'utf-8'));
|
||||
});
|
||||
}));
|
||||
});
|
||||
}
|
||||
exports.decompressGzippedContent = decompressGzippedContent;
|
||||
/**
|
||||
* Obtain Response's Content Charset.
|
||||
* Through inspecting `content-type` response header.
|
||||
* It Returns 'utf-8' if NO charset specified/matched.
|
||||
*
|
||||
* @param {IHttpClientResponse} response
|
||||
* @return {string} - Content Encoding Charset; Default=utf-8
|
||||
*/
|
||||
function obtainContentCharset(response) {
|
||||
// Find the charset, if specified.
|
||||
// Search for the `charset=CHARSET` string, not including `;,\r\n`
|
||||
// Example: content-type: 'application/json;charset=utf-8'
|
||||
// |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8']
|
||||
// |_____ matches[1] would have the charset :tada: , in our example it's utf-8
|
||||
// However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default.
|
||||
const contentType = response.message.headers['content-type'] || '';
|
||||
const matches = contentType.match(/charset=([^;,\r\n]+)/i);
|
||||
return (matches && matches[1]) ? matches[1] : 'utf-8';
|
||||
}
|
||||
exports.obtainContentCharset = obtainContentCharset;
|
9
node_modules/typed-rest-client/handlers/basiccreds.d.ts
generated
vendored
Normal file
9
node_modules/typed-rest-client/handlers/basiccreds.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import ifm = require('../Interfaces');
|
||||
export declare class BasicCredentialHandler implements ifm.IRequestHandler {
|
||||
username: string;
|
||||
password: string;
|
||||
constructor(username: string, password: string);
|
||||
prepareRequest(options: any): void;
|
||||
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||
}
|
24
node_modules/typed-rest-client/handlers/basiccreds.js
generated
vendored
Normal file
24
node_modules/typed-rest-client/handlers/basiccreds.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class BasicCredentialHandler {
|
||||
constructor(username, password) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
// currently implements pre-authorization
|
||||
// TODO: support preAuth = false where it hooks on 401
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] = 'Basic ' + new Buffer(this.username + ':' + this.password).toString('base64');
|
||||
options.headers['X-TFS-FedAuthRedirect'] = 'Suppress';
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.BasicCredentialHandler = BasicCredentialHandler;
|
8
node_modules/typed-rest-client/handlers/bearertoken.d.ts
generated
vendored
Normal file
8
node_modules/typed-rest-client/handlers/bearertoken.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import ifm = require('../Interfaces');
|
||||
export declare class BearerCredentialHandler implements ifm.IRequestHandler {
|
||||
token: string;
|
||||
constructor(token: string);
|
||||
prepareRequest(options: any): void;
|
||||
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user