From eeff424bd1bbe2faa242177d08e37d63dc191120 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Wed, 2 Jun 2021 02:27:44 +0300 Subject: [PATCH] fix: rename strictSSL to strictSsl in all places (#3494) close #3493 --- .changeset/early-boxes-applaud.md | 7 +++++++ packages/fetch/src/fetchFromRegistry.ts | 2 +- packages/npm-registry-agent/src/index.ts | 10 +++++----- packages/npm-registry-agent/test/index.ts | 2 +- .../src/createNewStoreController.ts | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .changeset/early-boxes-applaud.md diff --git a/.changeset/early-boxes-applaud.md b/.changeset/early-boxes-applaud.md new file mode 100644 index 0000000000..6d38302cb8 --- /dev/null +++ b/.changeset/early-boxes-applaud.md @@ -0,0 +1,7 @@ +--- +"@pnpm/fetch": major +"@pnpm/npm-registry-agent": major +"@pnpm/client": major +--- + +strictSSL option renamed to strictSsl. diff --git a/packages/fetch/src/fetchFromRegistry.ts b/packages/fetch/src/fetchFromRegistry.ts index 262dc3e42a..66614cba82 100644 --- a/packages/fetch/src/fetchFromRegistry.ts +++ b/packages/fetch/src/fetchFromRegistry.ts @@ -34,7 +34,7 @@ export default function ( const agent = npmRegistryAgent(urlObject.href, { ...defaultOpts, ...opts, - strictSSL: defaultOpts.strictSSL ?? true, + strictSsl: defaultOpts.strictSsl ?? true, } as any) // eslint-disable-line headers['connection'] = agent ? 'keep-alive' : 'close' diff --git a/packages/npm-registry-agent/src/index.ts b/packages/npm-registry-agent/src/index.ts index 9ac59d583b..6457f8050e 100644 --- a/packages/npm-registry-agent/src/index.ts +++ b/packages/npm-registry-agent/src/index.ts @@ -20,7 +20,7 @@ export interface AgentOptions { localAddress?: string maxSockets?: number noProxy?: boolean | string - strictSSL?: boolean + strictSsl?: boolean timeout?: number } @@ -36,7 +36,7 @@ export default function getAgent (uri: string, opts: AgentOptions) { ? `proxy:${pxuri.protocol}//${pxuri.host}:${pxuri.port}` : '>no-proxy<', `local-address:${opts.localAddress ?? '>no-local-address<'}`, - `strict-ssl:${isHttps ? Boolean(opts.strictSSL).toString() : '>no-strict-ssl<'}`, + `strict-ssl:${isHttps ? Boolean(opts.strictSsl).toString() : '>no-strict-ssl<'}`, `ca:${(isHttps && opts.ca) || '>no-ca<'}`, `cert:${(isHttps && opts.cert) || '>no-cert<'}`, `key:${(isHttps && opts.key) || '>no-key<'}`, @@ -67,7 +67,7 @@ export default function getAgent (uri: string, opts: AgentOptions) { key: opts.key, localAddress: opts.localAddress, maxSockets: opts.maxSockets ?? DEFAULT_MAX_SOCKETS, - rejectUnauthorized: opts.strictSSL, + rejectUnauthorized: opts.strictSsl, timeout: agentTimeout, } as any) // eslint-disable-line @typescript-eslint/no-explicit-any : new HttpAgent({ @@ -143,7 +143,7 @@ function getProxy ( timeout?: number localAddress?: string maxSockets?: number - strictSSL?: boolean + strictSsl?: boolean }, isHttps: boolean ) { @@ -158,7 +158,7 @@ function getProxy ( path: proxyUrl.pathname, port: proxyUrl.port, protocol: proxyUrl.protocol, - rejectUnauthorized: opts.strictSSL, + rejectUnauthorized: opts.strictSsl, timeout: typeof opts.timeout !== 'number' || opts.timeout === 0 ? 0 : opts.timeout + 1, } diff --git a/packages/npm-registry-agent/test/index.ts b/packages/npm-registry-agent/test/index.ts index a9b3935960..44d367e87c 100644 --- a/packages/npm-registry-agent/test/index.ts +++ b/packages/npm-registry-agent/test/index.ts @@ -25,7 +25,7 @@ const OPTS = { key: 'key', localAddress: 'localAddress', maxSockets: 5, - strictSSL: true, + strictSsl: true, timeout: 5, } diff --git a/packages/store-connection-manager/src/createNewStoreController.ts b/packages/store-connection-manager/src/createNewStoreController.ts index bb32155b61..ae04f1c99c 100644 --- a/packages/store-connection-manager/src/createNewStoreController.ts +++ b/packages/store-connection-manager/src/createNewStoreController.ts @@ -57,7 +57,7 @@ export default async ( retries: opts.fetchRetries, }, storeDir: opts.storeDir, - strictSSL: opts.strictSsl ?? true, + strictSsl: opts.strictSsl ?? true, timeout: opts.fetchTimeout, userAgent: opts.userAgent, maxSockets: opts.networkConcurrency != null