Bump tough-cookie and @azure/ms-rest-js (#1763)

* Bump tough-cookie and @azure/ms-rest-js

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) and [@azure/ms-rest-js](https://github.com/Azure/ms-rest-js). These dependencies needed to be updated together.

Updates `tough-cookie` from 4.0.0 to 4.1.3
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3)

Updates `@azure/ms-rest-js` from 2.6.2 to 2.7.0
- [Changelog](https://github.com/Azure/ms-rest-js/blob/master/Changelog.md)
- [Commits](https://github.com/Azure/ms-rest-js/commits)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
- dependency-name: "@azure/ms-rest-js"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-07-10 01:41:51 -07:00 committed by GitHub
parent 85c77f1dfc
commit 8f80d7761c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 4194 additions and 4573 deletions

View file

@ -262,7 +262,7 @@
* @const
* @type {string}
*/
msRestVersion: "2.6.2",
msRestVersion: "2.7.0",
/**
* Specifies HTTP.
*
@ -1906,10 +1906,15 @@
// according to the spec. There are no HTML/XSS security concerns on the usage of
// parseFromString() here.
var ttPolicy;
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: function (s) { return s; },
});
try {
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: function (s) { return s; },
});
}
}
catch (e) {
console.warn('Could not create trusted types policy "@azure/ms-rest-js#xml.browser"');
}
function parseXML(str) {
var _a;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -10,7 +10,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
var uuid = require('uuid');
var tslib = require('tslib');
var tough = require('tough-cookie');
var http = require('http');
var https = require('https');
var node_fetch = _interopDefault(require('node-fetch'));
@ -194,7 +193,7 @@ var Constants = {
* @const
* @type {string}
*/
msRestVersion: "2.6.2",
msRestVersion: "2.7.0",
/**
* Specifies HTTP.
*
@ -3331,9 +3330,7 @@ function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) {
var NodeFetchHttpClient = /** @class */ (function (_super) {
tslib.__extends(NodeFetchHttpClient, _super);
function NodeFetchHttpClient() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.cookieJar = new tough.CookieJar(undefined, { looseMode: true });
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}
NodeFetchHttpClient.prototype.fetch = function (input, init) {
return tslib.__awaiter(this, void 0, void 0, function () {
@ -3344,83 +3341,43 @@ var NodeFetchHttpClient = /** @class */ (function (_super) {
};
NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) {
return tslib.__awaiter(this, void 0, void 0, function () {
var requestInit, cookieString, _a, httpAgent, httpsAgent, tunnel, options, agent;
var _this = this;
var requestInit, _a, httpAgent, httpsAgent, tunnel, options, agent;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
requestInit = {};
if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) {
if (err) {
reject(err);
}
else {
resolve(cookie);
}
});
})];
case 1:
cookieString = _b.sent();
httpRequest.headers.set("Cookie", cookieString);
_b.label = 2;
case 2:
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
requestInit = {};
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
});
});
};
NodeFetchHttpClient.prototype.processRequest = function (operationResponse) {
NodeFetchHttpClient.prototype.processRequest = function (_operationResponse) {
return tslib.__awaiter(this, void 0, void 0, function () {
var setCookieHeader_1;
var _this = this;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.cookieJar) return [3 /*break*/, 2];
setCookieHeader_1 = operationResponse.headers.get("Set-Cookie");
if (!(setCookieHeader_1 != undefined)) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) {
if (err) {
reject(err);
}
else {
resolve();
}
});
})];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/];
}
/* no_op */
return [2 /*return*/];
});
});
};

File diff suppressed because one or more lines are too long

View file

@ -2,9 +2,8 @@ import { CommonRequestInfo, CommonRequestInit, CommonResponse, FetchHttpClient }
import { HttpOperationResponse } from "./httpOperationResponse";
import { WebResourceLike } from "./webResource";
export declare class NodeFetchHttpClient extends FetchHttpClient {
private readonly cookieJar;
fetch(input: CommonRequestInfo, init?: CommonRequestInit): Promise<CommonResponse>;
prepareRequest(httpRequest: WebResourceLike): Promise<Partial<RequestInit>>;
processRequest(operationResponse: HttpOperationResponse): Promise<void>;
processRequest(_operationResponse: HttpOperationResponse): Promise<void>;
}
//# sourceMappingURL=nodeFetchHttpClient.d.ts.map

View file

@ -1 +1 @@
{"version":3,"file":"nodeFetchHttpClient.d.ts","sourceRoot":"","sources":["../../lib/nodeFetchHttpClient.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuD;IAE3E,KAAK,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlF,cAAc,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAgD3E,cAAc,CAAC,iBAAiB,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB9E"}
{"version":3,"file":"nodeFetchHttpClient.d.ts","sourceRoot":"","sources":["../../lib/nodeFetchHttpClient.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,qBAAa,mBAAoB,SAAQ,eAAe;IAChD,KAAK,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlF,cAAc,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAkC3E,cAAc,CAAC,kBAAkB,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/E"}

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __awaiter, __extends, __generator } from "tslib";
import * as tough from "tough-cookie";
import * as http from "http";
import * as https from "https";
import node_fetch from "node-fetch";
@ -10,9 +9,7 @@ import { createProxyAgent } from "./proxyAgent";
var NodeFetchHttpClient = /** @class */ (function (_super) {
__extends(NodeFetchHttpClient, _super);
function NodeFetchHttpClient() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.cookieJar = new tough.CookieJar(undefined, { looseMode: true });
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}
NodeFetchHttpClient.prototype.fetch = function (input, init) {
return __awaiter(this, void 0, void 0, function () {
@ -23,83 +20,43 @@ var NodeFetchHttpClient = /** @class */ (function (_super) {
};
NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) {
return __awaiter(this, void 0, void 0, function () {
var requestInit, cookieString, _a, httpAgent, httpsAgent, tunnel, options, agent;
var _this = this;
var requestInit, _a, httpAgent, httpsAgent, tunnel, options, agent;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
requestInit = {};
if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) {
if (err) {
reject(err);
}
else {
resolve(cookie);
}
});
})];
case 1:
cookieString = _b.sent();
httpRequest.headers.set("Cookie", cookieString);
_b.label = 2;
case 2:
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
requestInit = {};
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
});
});
};
NodeFetchHttpClient.prototype.processRequest = function (operationResponse) {
NodeFetchHttpClient.prototype.processRequest = function (_operationResponse) {
return __awaiter(this, void 0, void 0, function () {
var setCookieHeader_1;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.cookieJar) return [3 /*break*/, 2];
setCookieHeader_1 = operationResponse.headers.get("Set-Cookie");
if (!(setCookieHeader_1 != undefined)) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) {
if (err) {
reject(err);
}
else {
resolve();
}
});
})];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/];
}
/* no_op */
return [2 /*return*/];
});
});
};

View file

@ -1 +1 @@
{"version":3,"file":"nodeFetchHttpClient.js","sourceRoot":"","sources":["../../lib/nodeFetchHttpClient.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAIL,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAE5D;IAAyC,uCAAe;IAAxD;QAAA,qEA4EC;QA3EkB,eAAS,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;;IA2EnF,CAAC;IAzEO,mCAAK,GAAX,UAAY,KAAwB,EAAE,IAAwB;;;gBAC5D,sBAAQ,UAAU,CAAC,KAAK,EAAE,IAAI,CAAwC,EAAC;;;KACxE;IAEK,4CAAc,GAApB,UAAqB,WAA4B;;;;;;;wBACzC,WAAW,GAA2C,EAAE,CAAC;6BAE3D,CAAA,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA,EAApD,wBAAoD;wBACjC,qBAAM,IAAI,OAAO,CAAS,UAAC,OAAO,EAAE,MAAM;gCAC7D,KAAI,CAAC,SAAU,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,EAAE,UAAC,GAAG,E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Ae,GA2CvD"}

View file

@ -6,7 +6,7 @@ export var Constants = {
* @const
* @type {string}
*/
msRestVersion: "2.6.2",
msRestVersion: "2.7.0",
/**
* Specifies HTTP.
*

View file

@ -1 +1 @@
{"version":3,"file":"xml.browser.d.ts","sourceRoot":"","sources":["../../../lib/util/xml.browser.ts"],"names":[],"mappings":"AAkBA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAUlD;AAwFD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,UAMlE"}
{"version":3,"file":"xml.browser.d.ts","sourceRoot":"","sources":["../../../lib/util/xml.browser.ts"],"names":[],"mappings":"AAsBA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAUlD;AAwFD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,UAMlE"}

View file

@ -9,10 +9,15 @@ var parser = new DOMParser();
// according to the spec. There are no HTML/XSS security concerns on the usage of
// parseFromString() here.
var ttPolicy;
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: function (s) { return s; },
});
try {
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: function (s) { return s; },
});
}
}
catch (e) {
console.warn('Could not create trusted types policy "@azure/ms-rest-js#xml.browser"');
}
export function parseXML(str) {
var _a;

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import * as tough from "tough-cookie";
import * as http from "http";
import * as https from "https";
import node_fetch from "node-fetch";
@ -17,8 +16,6 @@ import { WebResourceLike } from "./webResource";
import { createProxyAgent, ProxyAgent } from "./proxyAgent";
export class NodeFetchHttpClient extends FetchHttpClient {
private readonly cookieJar = new tough.CookieJar(undefined, { looseMode: true });
async fetch(input: CommonRequestInfo, init?: CommonRequestInit): Promise<CommonResponse> {
return (node_fetch(input, init) as unknown) as Promise<CommonResponse>;
}
@ -26,20 +23,6 @@ export class NodeFetchHttpClient extends FetchHttpClient {
async prepareRequest(httpRequest: WebResourceLike): Promise<Partial<RequestInit>> {
const requestInit: Partial<RequestInit & { agent?: any }> = {};
if (this.cookieJar && !httpRequest.headers.get("Cookie")) {
const cookieString = await new Promise<string>((resolve, reject) => {
this.cookieJar!.getCookieString(httpRequest.url, (err, cookie) => {
if (err) {
reject(err);
} else {
resolve(cookie);
}
});
});
httpRequest.headers.set("Cookie", cookieString);
}
if (httpRequest.agentSettings) {
const { http: httpAgent, https: httpsAgent } = httpRequest.agentSettings;
if (httpsAgent && httpRequest.url.startsWith("https")) {
@ -71,25 +54,8 @@ export class NodeFetchHttpClient extends FetchHttpClient {
return requestInit;
}
async processRequest(operationResponse: HttpOperationResponse): Promise<void> {
if (this.cookieJar) {
const setCookieHeader = operationResponse.headers.get("Set-Cookie");
if (setCookieHeader != undefined) {
await new Promise((resolve, reject) => {
this.cookieJar!.setCookie(
setCookieHeader,
operationResponse.request.url,
{ ignoreError: true },
(err) => {
if (err) {
reject(err);
} else {
resolve();
}
}
);
});
}
}
async processRequest(_operationResponse: HttpOperationResponse): Promise<void> {
/* no_op */
return;
}
}

View file

@ -7,7 +7,7 @@ export const Constants = {
* @const
* @type {string}
*/
msRestVersion: "2.6.2",
msRestVersion: "2.7.0",
/**
* Specifies HTTP.

View file

@ -10,10 +10,14 @@ const parser = new DOMParser();
// according to the spec. There are no HTML/XSS security concerns on the usage of
// parseFromString() here.
let ttPolicy: Pick<TrustedTypePolicy, "createHTML"> | undefined;
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: (s) => s,
});
try {
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: (s: any) => s,
});
}
} catch (e) {
console.warn('Could not create trusted types policy "@azure/ms-rest-js#xml.browser"');
}
export function parseXML(str: string): Promise<any> {

View file

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-js"
},
"version": "2.6.2",
"version": "2.7.0",
"description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest",
"tags": [
"isomorphic",
@ -55,18 +55,19 @@
"abort-controller": "^3.0.0",
"form-data": "^2.5.0",
"node-fetch": "^2.6.7",
"tough-cookie": "^3.0.1",
"tslib": "^1.10.0",
"tunnel": "0.0.6",
"uuid": "^8.3.2",
"xml2js": "^0.4.19"
"xml2js": "^0.5.0"
},
"devDependencies": {
"@azure/logger-js": "^1.1.0",
"@microsoft/api-extractor": "^7.18.11",
"@ts-common/azure-js-dev-tools": "^19.4.0",
"@types/bluebird": "3.5.36",
"@types/chai": "^4.1.7",
"@types/express": "^4.17.0",
"@types/express": "4.17.0",
"@types/express-serve-static-core": "4.17.0",
"@types/fetch-mock": "^7.3.1",
"@types/form-data": "^2.2.1",
"@types/glob": "^7.1.1",
@ -76,7 +77,6 @@
"@types/node-fetch": "^2.3.7",
"@types/semver": "^6.0.1",
"@types/sinon": "^7.0.13",
"@types/tough-cookie": "^2.3.5",
"@types/trusted-types": "^2.0.0",
"@types/tunnel": "0.0.1",
"@types/uuid": "^8.3.2",