
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
adonis5-nats
Advanced tools
Adonis, microservices, nats
Need microservices in your Adonis5 application? Just use it.
This package provide wrapper for NATs broker (based on moleculer). For better experience you must implement two classes called ${AnyService}Server
and ${AnyService}client
who extends ${AnyService}Server
(for better autocomplete)
npm i adonis5-nats
node ace configure adonis5-nats
import { ServiceSchema } from 'moleculer'
const sleep = (ms: number = 3000) => new Promise((res) => setTimeout(() => res(true), ms))
export class UserServiceClassServer {
public static serviceName = 'UserServiceClassServer' //required field
public static serviceOptions: ServiceSchema = {} //any optins like metadata and other
/** Your any logic: */
public users: [1, 2, 3]
public async getUsersIDs() {
await sleep()
return this.users
}
public async getTestVars<T>(data: T): Promise<T> {
await sleep()
return data
}
}
import { UserServiceClassServer } from 'App/Services/UserServiceServer'
import Broker from '@ioc:Adonis/Addons/NATS'
class UserServiceClassClient extends UserServiceClassServer {
public static serviceName = 'UserServiceClassServer'
constructor() {
super()
}
}
export const UserServiceClient = Broker.addClient<UserServiceClassClient>(
UserServiceClassClient,
UserServiceClassServer
)
import { BaseCommand } from '@adonisjs/core/build/standalone'
import { UserServiceClassServer } from 'App/Services/UserServiceServer'
import Broker from '@ioc:Adonis/Addons/NATS'
export default class UsersService extends BaseCommand {
public static commandName = 'users:service'
public static description = ''
public static settings = {
loadApp: true,
stayAlive: true,
}
public async run() {
await Broker.addServer<UserServiceClassServer>(UserServiceClassServer)
this.logger.info('users service run')
}
}
import Route from '@ioc:Adonis/Core/Route'
import { UserServiceClient } from 'App/Services/UserServiceClient'
Route.get('/get-users-ids', async () => {
return await UserServiceClient.getUsersIDs()
})
version: '3.7'
services:
nats:
image: 'nats'
ports:
- '4222:4222'
docker-compose up nats
node ace generate:manifest
node ace users:service
node ace serve --watch
FAQs
Adonis NATS broker
We found that adonis5-nats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.