asset-resolver
Advanced tools
Comparing version 1.0.1 to 1.0.2
1.0.1 / 2018-03-14 | ||
v1.0.2 / 2018-05-17 | ||
================== | ||
* updated yarn.lock | ||
* Chore: update fs-extra to 6.0.1 (#213) | ||
* Add basic auth option | ||
v1.0.1 / 2018-03-14 | ||
================== | ||
* Don't break on file permission error | ||
1.0.0 / 2017-12-17 | ||
v1.0.0 / 2017-12-17 | ||
================== | ||
@@ -9,0 +16,0 @@ |
@@ -36,2 +36,10 @@ 'use strict'; | ||
/** | ||
* Token generated by concatenating username and password with `:` character within a base64 encoded string. | ||
* @param {String} user User identifier. | ||
* @param {String} pass Password. | ||
* @returns {String} Base64 encoded authentication token. | ||
*/ | ||
const token = (user, pass) => Buffer.from([user, pass].join(':')).toString('base64'); | ||
/** | ||
* Get external resource | ||
@@ -41,7 +49,13 @@ * @param {string} resource | ||
*/ | ||
function requestAsync(resource) { | ||
function requestAsync(resource, opts = {}) { | ||
const settings = { | ||
followRedirect: true, | ||
encoding: null | ||
encoding: null, | ||
rejectUnauthorized: false | ||
}; | ||
if (opts.user && opts.pass) { | ||
settings.headers = {Authorization: 'Basic ' + token(opts.user, opts.pass)}; | ||
} | ||
return new Bluebird((resolve, reject) => { | ||
@@ -48,0 +62,0 @@ // Handle protocol-relative urls |
{ | ||
"name": "asset-resolver", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Find an asset in a set of locations", | ||
@@ -33,4 +33,5 @@ "license": "MIT", | ||
"filesize": "^3.5.11", | ||
"fs-extra": "^5.0.0", | ||
"fs-extra": "^6.0.1", | ||
"globby": "^7.1.1", | ||
"got": "^8.3.1", | ||
"hash": "0.2.0", | ||
@@ -37,0 +38,0 @@ "lodash": "4.17.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11279
183
12
+ Addedgot@^8.3.1
+ Added@sindresorhus/is@0.7.0(transitive)
+ Addedcacheable-request@2.1.4(transitive)
+ Addedclone-response@1.0.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddecompress-response@3.3.0(transitive)
+ Addedduplexer3@0.1.5(transitive)
+ Addedfrom2@2.3.0(transitive)
+ Addedfs-extra@6.0.1(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedgot@8.3.2(transitive)
+ Addedhas-symbol-support-x@1.4.2(transitive)
+ Addedhas-to-string-tag-x@1.4.1(transitive)
+ Addedhttp-cache-semantics@3.8.1(transitive)
+ Addedinto-stream@3.1.0(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedis-retry-allowed@1.2.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisurl@1.0.0(transitive)
+ Addedjson-buffer@3.0.0(transitive)
+ Addedkeyv@3.0.0(transitive)
+ Addedlowercase-keys@1.0.01.0.1(transitive)
+ Addedmimic-response@1.0.1(transitive)
+ Addednormalize-url@2.0.1(transitive)
+ Addedp-cancelable@0.4.1(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-is-promise@1.1.0(transitive)
+ Addedp-timeout@2.0.1(transitive)
+ Addedprepend-http@2.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedquery-string@5.1.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedresponselike@1.0.2(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsort-keys@2.0.0(transitive)
+ Addedstrict-uri-encode@1.1.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtimed-out@4.0.1(transitive)
+ Addedurl-parse-lax@3.0.0(transitive)
+ Addedurl-to-options@1.0.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedfs-extra@5.0.0(transitive)
Updatedfs-extra@^6.0.1