Comparing version 6.3.1 to 6.4.0
@@ -5,2 +5,15 @@ # Change Log | ||
<a name="6.4.0"></a> | ||
# [6.4.0](https://github.com/aliyun/oss-nodejs-sdk/compare/v6.3.1...v6.4.0) (2019-12-19) | ||
### Features | ||
* **browser:** warnning when browser is not support ([#703](https://github.com/aliyun/oss-nodejs-sdk/issues/703)) ([bd99280](https://github.com/aliyun/oss-nodejs-sdk/commit/bd99280)) | ||
* checkBucketName in setBucket/initOption/useBucket ([#709](https://github.com/aliyun/oss-nodejs-sdk/issues/709)) ([162dfb5](https://github.com/aliyun/oss-nodejs-sdk/commit/162dfb5)) | ||
* multipartupload support 'x-oss-server-side-encryption' | ||
* add bucket severside encryption | ||
<a name="6.3.1"></a> | ||
@@ -7,0 +20,0 @@ ## [6.3.1](https://github.com/aliyun/oss-nodejs-sdk/compare/v6.3.0...v6.3.1) (2019-12-03) |
@@ -65,2 +65,3 @@ | ||
proto.useBucket = function useBucket(name) { | ||
this._checkBucketName(name); | ||
this.options.bucket = name; | ||
@@ -71,2 +72,3 @@ return this; | ||
proto.setBucket = function useBucket(name) { | ||
this._checkBucketName(name); | ||
this.options.bucket = name; | ||
@@ -73,0 +75,0 @@ return this; |
@@ -28,2 +28,9 @@ const debug = require('debug')('ali-oss'); | ||
function _unSupportBrowserTip() { | ||
const { name, version } = platform; | ||
if (name.toLowerCase() === 'ie' && version.split('.')[0] < 10) { | ||
// eslint-disable-next-line no-console | ||
console.warn('ali-oss does not support the current browser'); | ||
} | ||
} | ||
// check local web protocol,if https secure default set true , if http secure default set false | ||
@@ -37,2 +44,3 @@ function isHttpsWebProtocol() { | ||
function Client(options, ctx) { | ||
_unSupportBrowserTip(); | ||
if (!(this instanceof Client)) { | ||
@@ -201,3 +209,3 @@ return new Client(options, ctx); | ||
.createHash('md5') | ||
.update(new Buffer(params.content, 'utf8')) | ||
.update(Buffer.from(params.content, 'utf8')) | ||
.digest('base64'); | ||
@@ -204,0 +212,0 @@ if (!headers['Content-Length']) { |
@@ -280,3 +280,3 @@ | ||
this.reader.onload = function onload(e) { | ||
that.fileBuffer = new Buffer(new Uint8Array(e.target.result)); | ||
that.fileBuffer = Buffer.from(new Uint8Array(e.target.result)); | ||
that.file = null; | ||
@@ -283,0 +283,0 @@ that.readFileAndPush(size); |
@@ -1,1 +0,1 @@ | ||
exports.version="6.3.1" | ||
exports.version="6.4.0" |
@@ -76,2 +76,3 @@ | ||
proto.useBucket = function useBucket(name) { | ||
this._checkBucketName(name); | ||
return this.setBucket(name); | ||
@@ -78,0 +79,0 @@ }; |
@@ -193,3 +193,3 @@ | ||
.createHash('md5') | ||
.update(new Buffer(params.content, 'utf8')) | ||
.update(Buffer.from(params.content, 'utf8')) | ||
.digest('base64'); | ||
@@ -196,0 +196,0 @@ if (!headers['Content-Length']) { |
@@ -135,3 +135,3 @@ | ||
// only start will try to write the file | ||
await this.put(name, new Buffer(`check available started at ${Date()}`)); | ||
await this.put(name, Buffer.from(`check available started at ${Date()}`)); | ||
} | ||
@@ -138,0 +138,0 @@ |
@@ -7,2 +7,4 @@ const merge = require('merge-descriptors'); | ||
merge(proto, require('./putBucketRequestPayment.js')); | ||
merge(proto, require('./putBucketEncryption.js')); | ||
merge(proto, require('./getBucketEncryption.js')); | ||
merge(proto, require('./deleteBucketEncryption.js')); |
@@ -17,3 +17,3 @@ | ||
} | ||
const callback = new Buffer(JSON.stringify(json)).toString('base64'); | ||
const callback = Buffer.from(JSON.stringify(json)).toString('base64'); | ||
reqParams.headers['x-oss-callback'] = callback; | ||
@@ -26,3 +26,3 @@ | ||
}); | ||
reqParams.headers['x-oss-callback-var'] = new Buffer(JSON.stringify(callbackVar)).toString('base64'); | ||
reqParams.headers['x-oss-callback-var'] = Buffer.from(JSON.stringify(callbackVar)).toString('base64'); | ||
} | ||
@@ -29,0 +29,0 @@ } |
const ms = require('humanize-ms'); | ||
const urlutil = require('url'); | ||
const _checkBucketName = require('../utils/checkBucketName'); | ||
@@ -37,2 +38,5 @@ function setEndpoint(endpoint, secure) { | ||
} | ||
if (options.bucket && !_checkBucketName(options.bucket)) { | ||
throw new Error('The bucket must be conform to the specifications'); | ||
} | ||
const opts = Object.assign({ | ||
@@ -39,0 +43,0 @@ region: 'oss-cn-hangzhou', |
const copy = require('copy-to'); | ||
const callback = require('./callback'); | ||
const deepCopy = require('./utils/deepCopy'); | ||
@@ -184,4 +185,5 @@ const proto = exports; | ||
options = options || {}; | ||
const opt = {}; | ||
copy(options).to(opt); | ||
let opt = {}; | ||
opt = deepCopy(options); | ||
if (opt.headers) delete opt.headers['x-oss-server-side-encryption']; | ||
opt.subres = { uploadId }; | ||
@@ -188,0 +190,0 @@ |
@@ -87,3 +87,3 @@ | ||
const signature = crypto.createHmac('sha1', accessKeySecret); | ||
return signature.update(new Buffer(canonicalString, 'utf8')).digest('base64'); | ||
return signature.update(Buffer.from(canonicalString, 'utf8')).digest('base64'); | ||
}; | ||
@@ -152,3 +152,3 @@ | ||
} | ||
subResource.callback = new Buffer(JSON.stringify(json)).toString('base64'); | ||
subResource.callback = Buffer.from(JSON.stringify(json)).toString('base64'); | ||
@@ -160,3 +160,3 @@ if (options.callback.customValue) { | ||
}); | ||
subResource['callback-var'] = new Buffer(JSON.stringify(callbackVar)).toString('base64'); | ||
subResource['callback-var'] = Buffer.from(JSON.stringify(callbackVar)).toString('base64'); | ||
} | ||
@@ -163,0 +163,0 @@ } |
@@ -247,3 +247,3 @@ | ||
this.reader.onload = function (e) { | ||
that.fileBuffer = new Buffer(new Uint8Array(e.target.result)); | ||
that.fileBuffer = Buffer.from(new Uint8Array(e.target.result)); | ||
that.file = null; | ||
@@ -250,0 +250,0 @@ that.readFileAndPush(size); |
{ | ||
"name": "ali-oss", | ||
"version": "6.3.1", | ||
"version": "6.4.0", | ||
"description": "aliyun oss(object storage service) node client", | ||
@@ -32,3 +32,5 @@ "main": "lib/client.js", | ||
"snyk-protect": "snyk protect", | ||
"prepublish": "npm run snyk-protect" | ||
"prepublish": "npm run snyk-protect", | ||
"lint-staged": "lint-staged", | ||
"detect-secrets": "node task/detect-secrets" | ||
}, | ||
@@ -40,3 +42,4 @@ "git-pre-hooks": { | ||
"npm run publish-to-cdn" | ||
] | ||
], | ||
"pre-commit": "npm run lint-staged" | ||
}, | ||
@@ -78,3 +81,3 @@ "repository": { | ||
"crypto-js": "^3.1.9-1", | ||
"eslint": "^4.18.1", | ||
"eslint": "^6.7.2", | ||
"eslint-config-airbnb": "^16.1.0", | ||
@@ -93,2 +96,3 @@ "eslint-plugin-import": "^2.9.0", | ||
"karma-safari-launcher": "^1.0.0", | ||
"lint-staged": "^9.5.0", | ||
"mm": "^2.0.0", | ||
@@ -101,2 +105,3 @@ "mocha": "^3.5.3", | ||
"sinon": "^1.17.7", | ||
"snyk": "^1.231.0", | ||
"standard-version": "^4.4.0", | ||
@@ -133,6 +138,10 @@ "stream-equal": "^1.1.0", | ||
"utility": "^1.8.0", | ||
"xml2js": "^0.4.16", | ||
"snyk": "^1.231.0" | ||
"xml2js": "^0.4.16" | ||
}, | ||
"snyk": true | ||
"snyk": true, | ||
"lint-staged": { | ||
"*": [ | ||
"npm run detect-secrets --" | ||
] | ||
} | ||
} |
@@ -14,8 +14,8 @@ | ||
var blocksize = 64; | ||
var zeroBuffer = new Buffer(blocksize); | ||
var zeroBuffer = Buffer.alloc(blocksize); | ||
zeroBuffer.fill(0); | ||
function hmac(fn, key, data) { | ||
if(!Buffer.isBuffer(key)) key = new Buffer(key); | ||
if(!Buffer.isBuffer(data)) data = new Buffer(data); | ||
if(!Buffer.isBuffer(key)) key = Buffer.from(key); | ||
if(!Buffer.isBuffer(data)) data = Buffer.from(data); | ||
@@ -28,3 +28,3 @@ if(key.length > blocksize) { | ||
var ipad = new Buffer(blocksize), opad = new Buffer(blocksize); | ||
var ipad = Buffer.alloc(blocksize), opad = Buffer.alloc(blocksize); | ||
for(var i = 0; i < blocksize; i++) { | ||
@@ -47,3 +47,3 @@ ipad[i] = key[i] ^ 0x36 | ||
update: function (data) { | ||
if(!Buffer.isBuffer(data)) data = new Buffer(data); | ||
if(!Buffer.isBuffer(data)) data = Buffer.from(data); | ||
@@ -50,0 +50,0 @@ bufs.push(data); |
var Buffer = require('buffer').Buffer; | ||
var intSize = 4; | ||
var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0); | ||
var zeroBuffer = Buffer.alloc(intSize); zeroBuffer.fill(0); | ||
var chrsz = 8; | ||
@@ -21,3 +21,3 @@ | ||
function toBuffer(arr, size, bigEndian) { | ||
var buf = new Buffer(size); | ||
var buf = Buffer.alloc(size); | ||
var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; | ||
@@ -31,3 +31,3 @@ for (var i = 0; i < arr.length; i++) { | ||
function hash(buf, fn, hashSize, bigEndian) { | ||
if (!Buffer.isBuffer(buf)) buf = new Buffer(buf); | ||
if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); | ||
var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); | ||
@@ -34,0 +34,0 @@ return toBuffer(arr, hashSize, bigEndian); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
3605556
24
49
41378
3393
44
- Removedsnyk@^1.231.0
- Removed@sentry-internal/tracing@7.120.0(transitive)
- Removed@sentry/core@7.120.0(transitive)
- Removed@sentry/integrations@7.120.0(transitive)
- Removed@sentry/node@7.120.0(transitive)
- Removed@sentry/types@7.120.0(transitive)
- Removed@sentry/utils@7.120.0(transitive)
- Removedboolean@3.2.0(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddetect-node@2.1.0(transitive)
- Removedes6-error@4.1.1(transitive)
- Removedescape-string-regexp@4.0.0(transitive)
- Removedglobal-agent@3.0.0(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedimmediate@3.0.6(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedlie@3.1.1(transitive)
- Removedlocalforage@1.10.0(transitive)
- Removedmatcher@3.0.0(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedroarr@2.15.4(transitive)
- Removedsemver@7.6.3(transitive)
- Removedsemver-compare@1.0.0(transitive)
- Removedserialize-error@7.0.1(transitive)
- Removedsnyk@1.1294.2(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedtype-fest@0.13.1(transitive)