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.
A Rails responder that will apply a decorator to a resource in the responder chain.
Add this line to your application's Gemfile:
gem 'decorate-responder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install decorate-responder
You will also need a decorator gem like draper or your own decorator implementation.
Add Responders::DecorateResponder
to your responder chain:
class AppResponder < Responder
include Responders::DecorateResponder
end
class MyController < ApplicationController
self.responder = AppResponder
end
Or use it with plataformatec/responders:
class MyController < ApplicationController
responders Responders::DecorateResponder
end
If you're using a decorator gem such as draper that injects a decorate
method into your resources they will get decorated automatically.
When using draper, you may want to pass a context hash from the controller to the decorator.
You can provide this context by adding a (public!) decoration_context
method to the controller:
class AppController
responders Responder::DecorateResponder
def decoration_context
{ color: false }
end
end
If you want to build even more advanced decoration logic, you can also explicitly decorate your resources by adding a decorate
method to your controller:
class AppController
responders Responders::DecorateResponder
def decorate(resource)
MyDecorator.new resource
end
end
If the resource and controller do not have a decorate
method the resource will not be decorated.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright (c) 2013, Jan Graichen
FAQs
Unknown package
We found that decorate-responder 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
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.