diff --git a/CHANGELOG.md b/CHANGELOG.md index 81d32ac..c073887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # CHANGELOG +## 1.0.0-rc.39(2023-06-14) + +- BosClient: Add 'x-bce-security-token' when using generatePresignedUrl with sessionToken; ## 1.0.0-rc.38(2023-02-16) - BosClient: support symlink; diff --git a/package.json b/package.json index 91cf094..f1ee219 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@baiducloud/sdk", - "version": "1.0.0-rc.38", + "version": "1.0.0-rc.39", "description": "Baidu Cloud Engine JavaScript SDK", "main": "./index.js", "browser": { diff --git a/src/bos_client.js b/src/bos_client.js index 10703c4..96ddd2b 100644 --- a/src/bos_client.js +++ b/src/bos_client.js @@ -112,6 +112,10 @@ BosClient.prototype.generatePresignedUrl = function (bucketName, key, timestamp, params.authorization = authorization; + if (config.sessionToken) { + params['x-bce-security-token'] = config.sessionToken; + } + return util.format('%s%s?%s', config.endpoint, resource, qs.encode(params)); }; @@ -950,6 +954,7 @@ BosClient.prototype.getObjectToFile = function (bucketName, key, filename, range }); }; + BosClient.prototype.copyObject = function (sourceBucketName, sourceKey, targetBucketName, targetKey, options) { /* eslint-disable */ if (!sourceBucketName) {