Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

egg-oss

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-oss - npm Package Compare versions

Comparing version
2.0.0
to
3.0.0
+9
-6
agent.js

@@ -1,10 +0,13 @@

'use strict';
const oss = require('./lib/oss');
module.exports = agent => {
const useAgent = agent.config.oss.useAgent;
if (useAgent) {
oss(agent);
module.exports = class {
constructor(agent) {
this.agent = agent;
}
configDidLoad() {
if (this.agent.config.oss.useAgent) {
oss(this.agent);
}
}
};
+8
-4

@@ -1,7 +0,11 @@

'use strict';
const oss = require('./lib/oss');
module.exports = app => {
oss(app);
module.exports = class {
constructor(app) {
this.app = app;
}
configDidLoad() {
oss(this.app);
}
};

@@ -1,3 +0,1 @@

'use strict';
module.exports = {

@@ -4,0 +2,0 @@ /**

@@ -1,3 +0,1 @@

'use strict';
exports.oss = {

@@ -4,0 +2,0 @@ default: {

3.0.0 / 2022-10-27
==================
**features**
* [[`cb50f24`](http://github.com/eggjs/egg-oss/commit/cb50f242769cfa45905892746fec14ba41f5bb90)] - 📦 NEW: [BREAKING] Use oss-client instead of ali-oss (#15) (fengmk2 <<fengmk2@gmail.com>>)
**others**
* [[`0101225`](http://github.com/eggjs/egg-oss/commit/010122502e3fa3e47f0aeb4a7d4461d75956e7cf)] - refactor: use lifecycle on start process (#10) (fengmk2 <<fengmk2@gmail.com>>)
* [[`4659a27`](http://github.com/eggjs/egg-oss/commit/4659a27afcc944fcdfc49f4f49b23c31715bff0c)] - docs: correct example endpoint configuration (#14) (Jeff <<jeff.tian@outlook.com>>)
* [[`e909e0d`](http://github.com/eggjs/egg-oss/commit/e909e0dfcc5ef195f3e88a730f4f0a7efd54a43d)] - chore: update travis (#13) (TZ | 天猪 <<atian25@qq.com>>)
* [[`93a05ea`](http://github.com/eggjs/egg-oss/commit/93a05eabba7d0a67f38170d626971341ef92fdc0)] - test: add another client for sts clients test (#9) (Haoliang Gao <<sakura9515@gmail.com>>)
* [[`e1d7a11`](http://github.com/eggjs/egg-oss/commit/e1d7a11c68ea54a75bf9b39fa202f7cdd32ad855)] - test: add sts clients testcase (#8) (Haoliang Gao <<sakura9515@gmail.com>>)
2.0.0 / 2018-10-10

@@ -3,0 +16,0 @@ ==================

@@ -1,7 +0,3 @@

'use strict';
const assert = require('assert');
const OSS = require('ali-oss');
const STS = OSS.STS;
const ClusterClient = OSS.ClusterClient;
const { Client, STS, ClusterClient } = require('oss-client');

@@ -28,5 +24,5 @@ function checkBucketConfig(config) {

checkBucketConfig(config);
return new OSS(config);
return new Client(config);
});
app.createOss = app.oss.createInstance.bind(app.oss);
};
{
"name": "egg-oss",
"version": "2.0.0",
"version": "3.0.0",
"description": "OSS plugin for egg",

@@ -22,18 +22,16 @@ "eggPlugin": {

"dependencies": {
"ali-oss": "^6.0.1"
"oss-client": "^1.1.0"
},
"devDependencies": {
"autod": "^3.0.1",
"egg": "^2.11.2",
"egg-bin": "^4.9.0",
"egg-mock": "^3.20.1",
"eslint": "^5.6.1",
"eslint-config-egg": "^7.1.0",
"egg": "^3.3.3",
"egg-bin": "^5.2.0",
"egg-mock": "^5.0.2",
"eslint": "^8.26.0",
"eslint-config-egg": "^12.1.0",
"is-type-of": "^1.2.1"
},
"engines": {
"node": ">=8.0.0"
"node": ">=14.0.0"
},
"scripts": {
"autod": "autod",
"lint": "eslint .",

@@ -40,0 +38,0 @@ "test": "npm run lint -- --fix && npm run test-local",

+26
-21
# egg-oss
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

@@ -12,10 +9,4 @@

[npm-url]: https://npmjs.org/package/egg-oss
[travis-image]: https://img.shields.io/travis/eggjs/egg-oss.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-oss
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-oss.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-oss?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-oss.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-oss
[snyk-image]: https://snyk.io/test/npm/egg-oss/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-oss
[download-image]: https://img.shields.io/npm/dm/egg-oss.svg?style=flat-square

@@ -46,3 +37,3 @@ [download-url]: https://npmjs.org/package/egg-oss

Mention, `egg-oss` support normal oss client and oss cluster client, based on [ali-oss](https://github.com/ali-sdk/ali-oss):
Mention, `egg-oss` support normal oss client and oss cluster client, based on [oss-client](https://github.com/node-modules/oss-client):

@@ -56,3 +47,3 @@ ```js

bucket: 'your bucket name',
endpoint: 'oss-cn-hongkong.aliyun.com',
endpoint: '{https or http}://{your endpoint name}.aliyun.com',
timeout: '60s',

@@ -67,7 +58,7 @@ },

cluster: [{
endpoint: 'host1',
endpoint: '{https or http}://{your endpoint name}.aliyun.com',
accessKeyId: 'id1',
accessKeySecret: 'secret1',
}, {
endpoint: 'host2',
endpoint: '{https or http}://{your endpoint name}.aliyun.com',
accessKeyId: 'id2',

@@ -134,3 +125,3 @@ accessKeySecret: 'secret2',

To learn OSS client API, please check [oss document](https://github.com/ali-sdk/ali-oss)。
To learn OSS client API, please check [oss document](https://github.com/node-modules/oss-client)。

@@ -156,3 +147,3 @@ ## Create one more OSS buckets

default: {
endpoint: '',
endpoint: '{https or http}://{your endpoint name}.aliyun.com',
accessKeyId: '',

@@ -177,3 +168,3 @@ accessKeySecret: '',

```js
module.exports = function (app) {
module.exports = app => {
const bucket1 = app.oss.get('bucket1');

@@ -186,14 +177,28 @@ const bucket2 = app.oss.get('bucket2');

## Questions & Suggestions
## Development
Please open an issue [here](https://github.com/eggjs/egg/issues).
Create `.env` file for environment that testcase need.
## secure keys
```ini
ALI_SDK_OSS_REGION=oss-cn-hangzhou
ALI_SDK_OSS_ENDPOINT=https://oss-cn-hangzhou.aliyuncs.com
ALI_SDK_OSS_ID=
ALI_SDK_OSS_SECRET=
ALI_SDK_OSS_BUCKET=
ALI_SDK_STS_ID=
ALI_SDK_STS_SECRET=
ALI_SDK_STS_BUCKET=
ALI_SDK_STS_ROLE=
```
ping @fengmk2 to give you the access key!
And run `npm test`.
- [oss secure keys](https://sharelock.io/1/d4dxf7wWoRP2Bh1ogtu4SfP_yt735noKhBld409yX84.acpMDn/-vOrQ4j4BpkMoxKkMeEavhwwUf0d293WY0WzHWDm-iVd8jbSwL/XEd43LrRzS7qmli4oJbbX_GcmG_X4KRu9pCMARJH4n92ebbtP1/y0fqwtoyV3JnK2ZdTJ4Ynky_ZVt7RR_Ji8DhLpn2N9j-A1BabK/FxYHfdXtUUrG4nd0PzN18_W2SuEr8Eyyqc6SHpFHt3qrgdSRse/giuXaV_3igL1CipdL5F5Vy2iDxjeRb_Zt_8Xlkmg1frfQTcnfZ/sfnl9zNYqOBzjGlC8f6YI6dDvShM-o1VoKp5F_kcXok1lAiLt4/3TnriQ6YM-qcx3wL7wgHu7TbzN_-4FN3ijpVOHkIVNPXjIquxL/SfKBlmu50XnZrYetixa0fvlbrc2yIAKx7cPQUxUe33b6Ti8N8b/U_rIfAGGL_8hK4XRLMWGdVevbSbw0IHgokTm6zGvpHj9PEILtP/wGJ5l3-hW6Chr5FJYJO1Wv0H4haJGctf3K2fg40ku8sx7511qv/h8xnoUyQmM0jkRrysIAD7FcW5mplMcvIOVd_CyugoH-NZCZfE1/maLQF303M3Y5_6kLBhF_Yi3jwO-UX7pTFt_Ax_ATh6Wvvix4JC/MjK891qkm4_vumc_Y86XB6HpchO7ox4nW5m2jUJlP016sBEnMw/bKE0FaX2SQ.WSqThAUsnFO7ddCpRJuotw)
The key is saved in [link](https://sharelock.io/1/MJITmvvEAchnIBWfm04PdfgXJs-fzCphRTz-TiVIOMo.wKVjBx/ED9OdTKWdMbkV3OfdJNXX3xG-VductolPWQM36vIgMsfvU2_KE/1XZMzTYEoGZSrCJxERU7iThkRSbhpXB71qYPPbmNbtRHfONL2J/4LB-xlFm82ZoAopEaXriN7IE9O030x3twhCtc0o69Rl5RdXj7b/YjDPa2JHQK7MUDkHskE4AAkmDXqlwoVtbT55bLYjb6tP2uvKtb/LLk1Gdwgjq3ihB1CePk8J3rWWe_-0EwxiLrjoV2tCTgRv18u1B/_AQY3Ui4TM3kQFp_8hfBCMidToOlYgQUwRNQff_Hlc9Ygl_BY6/4vhOrHyFwBg-5_qcAp-NaMeYQ8UN2wdveYQFzdv9CiKO3_Jhdz/JEdNoDO2j9rhRzUdH_c9XaguZ3kO145VRhNxj8WJghpVcmVfJZ/GYv4V-NNF-4Zic0VTtJQ_zs9iJRqHhAxI7GOEOvbaDTzIS2DFI/N5Yc-IcK4d96een8mwzrD81PZmQRYB-X94jMTVIuuDoFrPSaPB/3ks_eN1JnFyIXhshrSIBQvCtm20nyTlgvI3CjZ6mIdZBoRVDVB/e7btgHqXtuCmBgW2FNdk_eqfXDr2LFFwXzgBp5w.fwKGWMsFGx/mNYbeP11buRg) (ask @popomore), you can change the key by run `scripts/gen_env.sh`.
## Questions & Suggestions
Please open an issue [here](https://github.com/eggjs/egg/issues).
## License
[MIT](LICENSE)