Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Simple MongoDb dependency for nameko (microservices framework). Based on https://github.com/saiqi/nameko-mongodb
This is DependencyProvider for Nameko microservices framework which enables users to work with MongoDb.
First of all I should say that this package based on https://github.com/saiqi/nameko-mongodb . Thank you @saiqi :)
What has been changed:
The same as you guessing: pip install nameko-mongodb
There are some configuration options to use this package (required are in bold):
You can use the connection following way:
from nameko.rpc import rpc
import MongoDatabase from nameko_mongodb
class YourService(object):
name = 'your_service'
database = MongoDatabase()
@rpc
def find_item(self):
return self.database.your_collection.find_one()
Also this package can log all executions to logging
collection. If you want to use it:
from nameko.rpc import rpc
import MongoDatabase from nameko_mongodb
class YourService(object):
name = 'your_service'
database = MongoDatabase(result_backend=True)
@rpc
def find_item(self):
return self.database.your_collection.find_one()
Sometimes there can be useful to get possibility executing callbacks for DependencyProvider methods (i.e. migrating data when dependency initialized etc.). There are some callbacks:
on_before_setup
: (instance)on_after_setup
: (instance)on_before_stop
: (instance)on_after_stop
: (instance)on_before_worker_setup
: (instance, worker_ctx)on_after_worker_setup
: (instance, worker_ctx)on_before_worker_result
: (instance, worker_ctx, result, exc_info)on_after_worker_result
: (instance, worker_ctx, result, exc_info)How to use callbacks:
from nameko.rpc import rpc
import MongoDatabase from nameko_mongodb
class YourService(object):
name = 'your_service'
database = MongoDatabase(
on_before_setup=lambda x: print("Start setup DP"),
on_after_setup=lambda x: print("Stop setup DP"),
)
@rpc
def find_item(self):
return self.database.your_collection.find_one()
I'd be glad to see your pull requests
FAQs
Simple MongoDb dependency for nameko (microservices framework). Based on https://github.com/saiqi/nameko-mongodb
We found that nameko-mongodb demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.