+7
-0
| 1.1.0 / 2017-10-12 | ||
| ================== | ||
| **features** | ||
| * [[`1bc0cd3`](http://github.com/eggjs/egg-oss/commit/1bc0cd3901ee008b09722888bb5573ac9fca86ee)] - feat: support sts client (#5) (Haoliang Gao <<sakura9515@gmail.com>>) | ||
| * [[`992f45f`](http://github.com/eggjs/egg-oss/commit/992f45f7f93f2447741b977cc1e7f940887ab905)] - feat: support promise (#4) (Haoliang Gao <<sakura9515@gmail.com>>) | ||
| 1.0.2 / 2017-04-20 | ||
@@ -3,0 +10,0 @@ ================== |
+8
-2
@@ -5,2 +5,4 @@ 'use strict'; | ||
| const OSS = require('ali-oss'); | ||
| const Wrapper = OSS.Wrapper; | ||
| const STS = OSS.STS; | ||
@@ -16,3 +18,3 @@ function checkBucketConfig(config) { | ||
| app.addSingleton('oss', (config, app) => { | ||
| config = Object.assign({}, config, { urllib: app.urllib }); | ||
| config = Object.assign({}, config, { urllib: app.httpclient }); | ||
| if (config.cluster) { | ||
@@ -23,6 +25,10 @@ config.cluster.forEach(checkBucketConfig); | ||
| if (config.sts === true) { | ||
| return new STS(config); | ||
| } | ||
| checkBucketConfig(config); | ||
| return new OSS(config); | ||
| return new Wrapper(config); | ||
| }); | ||
| app.createOss = app.oss.createInstance.bind(app.oss); | ||
| }; |
+9
-10
| { | ||
| "name": "egg-oss", | ||
| "version": "1.0.2", | ||
| "version": "1.1.0", | ||
| "description": "OSS plugin for egg", | ||
@@ -22,14 +22,13 @@ "eggPlugin": { | ||
| "dependencies": { | ||
| "ali-oss": "^4.8.0" | ||
| "ali-oss": "^4.10.1" | ||
| }, | ||
| "devDependencies": { | ||
| "autod": "^2.8.0", | ||
| "autod": "^2.9.0", | ||
| "co": "^4.6.0", | ||
| "egg": "^1.1.0", | ||
| "egg-bin": "^3.3.0", | ||
| "egg-mock": "^3.4.0", | ||
| "eslint": "^3.19.0", | ||
| "eslint-config-egg": "^3.2.0", | ||
| "is-type-of": "^1.0.0", | ||
| "pedding": "^1.1.0" | ||
| "egg": "^1.9.0", | ||
| "egg-bin": "^4.3.3", | ||
| "egg-mock": "^3.12.2", | ||
| "eslint": "^4.8.0", | ||
| "eslint-config-egg": "^5.1.1", | ||
| "is-type-of": "^1.0.0" | ||
| }, | ||
@@ -36,0 +35,0 @@ "engines": { |
+10
-1
@@ -45,3 +45,3 @@ # egg-oss | ||
| Mention, `egg-oss` support normal oss client and oss cluster client, based on [ali-oss](https://github.com/aliyun/oss-nodejs-sdk): | ||
| Mention, `egg-oss` support normal oss client and oss cluster client, based on [ali-oss](https://github.com/ali-sdk/ali-oss): | ||
@@ -77,2 +77,11 @@ ```js | ||
| }; | ||
| // if config.sts == true, oss will create STS client | ||
| exports.oss = { | ||
| client: { | ||
| sts: true, | ||
| accessKeyId: 'your access key', | ||
| accessKeySecret: 'your access secret', | ||
| }, | ||
| }; | ||
| ``` | ||
@@ -79,0 +88,0 @@ |
9781
7.38%8
-11.11%58
9.43%198
4.76%Updated