Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarcy Clarke <darcy@darcyclarke.me>2020-03-03 19:51:05 +0300
committerDarcy Clarke <darcy@darcyclarke.me>2020-03-03 19:51:06 +0300
commit9204ffa584c140c5e22b1ee37f6df2c98f5dc70b (patch)
tree5a3513a3af90b4c20ebe98f302bd621e968563bf
parent0365d39bdc74960a18caac674f51d0e2a98b31e6 (diff)
npm-profile@4.0.4
-rw-r--r--node_modules/npm-profile/index.js27
-rw-r--r--node_modules/npm-profile/package.json28
-rw-r--r--package-lock.json6
-rw-r--r--package.json2
4 files changed, 36 insertions, 27 deletions
diff --git a/node_modules/npm-profile/index.js b/node_modules/npm-profile/index.js
index b7f753fb4..d9c48c131 100644
--- a/node_modules/npm-profile/index.js
+++ b/node_modules/npm-profile/index.js
@@ -1,7 +1,7 @@
'use strict'
const fetch = require('npm-registry-fetch')
-const {HttpErrorBase} = require('npm-registry-fetch/errors.js')
+const { HttpErrorBase } = require('npm-registry-fetch/errors.js')
const os = require('os')
const pudding = require('figgy-pudding')
const validate = require('aproba')
@@ -18,6 +18,16 @@ exports.listTokens = listTokens
exports.removeToken = removeToken
exports.createToken = createToken
+const url = require('url')
+
+const isValidUrl = u => {
+ if (u && typeof u === 'string') {
+ const p = url.parse(u)
+ return p.slashes && p.host && p.path && /^https?:$/.test(p.protocol)
+ }
+ return false
+}
+
const ProfileConfig = pudding({
creds: {},
hostname: {},
@@ -76,21 +86,16 @@ function webAuth (opener, opts, body) {
})).then(res => {
return Promise.all([res, res.json()])
}).then(([res, content]) => {
- const {doneUrl, loginUrl} = content
+ const { doneUrl, loginUrl } = content
process.emit('log', 'verbose', 'web auth', 'got response', content)
- if (
- typeof doneUrl !== 'string' ||
- typeof loginUrl !== 'string' ||
- !doneUrl ||
- !loginUrl
- ) {
+ if (!isValidUrl(doneUrl) || !isValidUrl(loginUrl)) {
throw new WebLoginInvalidResponse('POST', res, content)
}
return content
- }).then(({doneUrl, loginUrl}) => {
+ }).then(({ doneUrl, loginUrl }) => {
process.emit('log', 'verbose', 'web auth', 'opening url pair')
return opener(loginUrl).then(
- () => webAuthCheckLogin(doneUrl, opts.concat({cache: false}))
+ () => webAuthCheckLogin(doneUrl, opts.concat({ cache: false }))
)
}).catch(er => {
if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) {
@@ -183,7 +188,7 @@ function loginCouch (username, password, opts) {
}
if (err.code !== 'E409') throw err
return fetch.json(target, opts.concat({
- query: {write: true}
+ query: { write: true }
})).then(result => {
Object.keys(result).forEach(function (k) {
if (!body[k] || k === 'roles') {
diff --git a/node_modules/npm-profile/package.json b/node_modules/npm-profile/package.json
index 2f252aac8..e90e16ddf 100644
--- a/node_modules/npm-profile/package.json
+++ b/node_modules/npm-profile/package.json
@@ -1,28 +1,29 @@
{
- "_from": "npm-profile@4.0.2",
- "_id": "npm-profile@4.0.2",
+ "_from": "npm-profile@4.0.4",
+ "_id": "npm-profile@4.0.4",
"_inBundle": false,
- "_integrity": "sha512-VRsC04pvRH+9cF+PoVh2nTmJjiG21yu59IHpsBpkxk+jaGAV8lxx96G4SDc0jOHAkfWLXbc6kIph3dGAuRnotQ==",
+ "_integrity": "sha512-Ta8xq8TLMpqssF0H60BXS1A90iMoM6GeKwsmravJ6wYjWwSzcYBTdyWa3DZCYqPutacBMEm7cxiOkiIeCUAHDQ==",
"_location": "/npm-profile",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "npm-profile@4.0.2",
+ "raw": "npm-profile@4.0.4",
"name": "npm-profile",
"escapedName": "npm-profile",
- "rawSpec": "4.0.2",
+ "rawSpec": "4.0.4",
"saveSpec": null,
- "fetchSpec": "4.0.2"
+ "fetchSpec": "4.0.4"
},
"_requiredBy": [
"#USER",
- "/"
+ "/",
+ "/libnpm"
],
- "_resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-4.0.2.tgz",
- "_shasum": "8272a71c19634d0dce9c35a5daf8ee589cbb0f52",
- "_spec": "npm-profile@4.0.2",
- "_where": "/Users/isaacs/dev/npm/cli",
+ "_resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-4.0.4.tgz",
+ "_shasum": "28ee94390e936df6d084263ee2061336a6a1581b",
+ "_spec": "npm-profile@4.0.4",
+ "_where": "/Users/darcyclarke/Documents/Repos/npm/cli",
"author": {
"name": "Rebecca Turner",
"email": "me@re-becca.org",
@@ -48,9 +49,12 @@
"license": "ISC",
"main": "index.js",
"name": "npm-profile",
+ "publishConfig": {
+ "tag": "legacy-v4"
+ },
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npm-profile.git"
},
- "version": "4.0.2"
+ "version": "4.0.4"
}
diff --git a/package-lock.json b/package-lock.json
index f9e6e77f7..7cc82d4bb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3855,9 +3855,9 @@
}
},
"npm-profile": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-4.0.2.tgz",
- "integrity": "sha512-VRsC04pvRH+9cF+PoVh2nTmJjiG21yu59IHpsBpkxk+jaGAV8lxx96G4SDc0jOHAkfWLXbc6kIph3dGAuRnotQ==",
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-4.0.4.tgz",
+ "integrity": "sha512-Ta8xq8TLMpqssF0H60BXS1A90iMoM6GeKwsmravJ6wYjWwSzcYBTdyWa3DZCYqPutacBMEm7cxiOkiIeCUAHDQ==",
"requires": {
"aproba": "^1.1.2 || 2",
"figgy-pudding": "^3.4.1",
diff --git a/package.json b/package.json
index 20c5ecb4c..89f0f1830 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,7 @@
"npm-package-arg": "^6.1.1",
"npm-packlist": "^1.4.8",
"npm-pick-manifest": "^3.0.2",
- "npm-profile": "^4.0.2",
+ "npm-profile": "^4.0.4",
"npm-registry-fetch": "^4.0.3",
"npm-user-validate": "~1.0.0",
"npmlog": "~4.1.2",