
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
adonis-binding-resolver
Advanced tools
Resolves a closure or adonis ioc container binding transparently
Adonis binding resolver is a thin module to validate, resolve and execute bindings attached as a closure or IoC container binding.
For example: A route handler can point to closure
or reference to controller method.
Route.get('/', function * (request, response) {
})
// or
Route.get('/', 'HomeController.index')
Now manually parsing the 2nd argument can become a little gross as you have to take care of following things.
this
.This module takes care of all this for you.
const Resolver = require('adonis-binding-resolver')
const Ioc = require('adonis-fold').Ioc
const resolver = new Resolver(Ioc)
Ioc.validateBinding('App/Http/Controllers/HomeController.index') // works fine
Ioc.validateBinding(function () {}) // works fine
Ioc.validateBinding(null) // throws exception
Ioc.validateBinding({}) // throws exception
Ioc.validateBinding('') // throws exception
Ioc.validateBinding('App/Http/Controllers/HomeController') // throws exception, since method is not defined
const Resolver = require('adonis-binding-resolver')
const Ioc = require('adonis-fold').Ioc
const resolver = new Resolver(Ioc)
Ioc.resolveBinding('App/Http/Controllers/HomeController.index') // returns {instance: HomeController, method: 'index'}
Ioc.resolveBinding(function () {}) // returns function () {}
Executing binding will automatically resolve it for you. Just make sure to call validatingBinding
first.
const Resolver = require('adonis-binding-resolver')
const Ioc = require('adonis-fold').Ioc
const resolver = new Resolver(Ioc)
Ioc.validateBinding('App/Http/Controllers/HomeController.index') // make sure binding is fine
const result = Ioc.executeBinding('App/Http/Controllers/HomeController.index')
console.log(result)
You can also pass data when executing a binding. Data is passed as an array, which is passed as multiple arguments to the resolved method using apply
method.
const request = {} // your http request
const response = {} // your http response
const result = Ioc.executeBinding('App/Http/Controllers/HomeController.index', [request, response])
At times you may want to override the current instance of a module/class and pass your own custom instance. Same can be done by passing 3rd argument to the executeBinding
method.
const modelInstance = {}
const result = Ioc.executeBinding('App/Http/Model/Hooks/Password.encrypt', [], modelInstance)
This module is used by
FAQs
Resolves a closure or adonis ioc container binding transparently
The npm package adonis-binding-resolver receives a total of 43 weekly downloads. As such, adonis-binding-resolver popularity was classified as not popular.
We found that adonis-binding-resolver 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.