Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
aliyun ons plugin for egg
$ npm i egg-ons --save
// {app_root}/config/plugin.js
exports.ons = {
enable: true,
package: 'egg-ons',
};
// {app_root}/config/config.default.js
exports.ons = {
default: {
accessKey: 'your-accessKey',
secretKey: 'your-secretKey',
// prod:http://onsaddr-internal.aliyun.com:8080/rocketmq/nsaddr4client-internal
// dev: http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet
// onsAddr: 'http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet',
},
sub: [{
consumerGroup: 'your-consumer-group',
topics: [
'your-topic',
],
}],
pub: [{
producerGroup: 'your-producer-group',
topics: [
'your-topic',
],
}],
};
see config/config.default.js for more detail.
put your subscription codes under the folder {app_root}/app/ons
and named as the topic name e.g TP_NAME.js
.
├── app
│ ├── ons
│ │ └── TP_NAME.js
│ ├── public
│ └── router.js
├── config
│ └── config.default.js
├── package.json
you should implment a subscriber as blow
// TP_NAME.js
'use strict';
class TestSubscriber {
constructor(ctx) {
this.ctx = ctx;
}
* subscribe(msg) {
yield this.ctx.service.messageService.process(msg);
}
static get subExpression() {
return 'TagA';
}
}
module.exports = TestSubscriber;
see RPC for more detail.
using app.ons / ctx.ons
to create & send messages
const Message = ctx.ons.Message;
const msg = new Message('TP_NAME', // topic
'TagA', // tag
'Hello ONS !!!' // body
);
const sendResult = yield ctx.ons.send(msg);
Please open an issue here.
ping @fengmk2 to give you the access key!
FAQs
aliyun ons plugin for egg
The npm package egg-ons receives a total of 4 weekly downloads. As such, egg-ons popularity was classified as not popular.
We found that egg-ons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.