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.
Allows easily sending state_machine events to a model from Rails Admin, including support for ActiveRecord \ Mongoid and custom state field name and multiple state machines per model.
Based on https://github.com/rs-pro/rails_admin_state. Since state_machine currently is not maintained, I turn to AASM https://github.com/aasm/aasm.
Add this line to your application's Gemfile:
#please use `0.1.1` if rails_admin <= `0.8.1`
gem 'rails_admin_aasm'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails_admin_aasm
Add the state action:
RailsAdmin.config do |config|
config.actions do
......
state
end
end
Mark the field you need display as state:
rails_admin do
list do
field :state, :state
...
end
edit do
field :state, :state
...
end
...
end
rails_admin do
list do
field :state, :state
...
end
...
state({
events: {dead: 'btn-danger', drain: 'btn-warning', alive: 'btn-success'},
states: {dead: 'label-important', drain: 'label-warning', alive: 'label-success'}
disable: [:dead] # disable some events so they are not shown.
})
end
Some classes are preset by default (published, deleted, etc)
cannot :manage, Recipes::Recipe
can :read, Recipes::Recipe
can :state, Recipes::Recipe # required to do any transitions
can :all_events, Recipes::Recipe
Events:
activerecord:
events:
product_order:
pay: 支付
refund: 同意退款
reject_refund: 拒绝退款
State:
product_order:
status/unpaid: 未支付
notice the state must combine with /
, see: https://github.com/aasm/aasm/issues/38
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that rails_admin_aasm 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.