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.
Makes Her aware of APIs that return pagination headers like grape-kaminari gem.
Her models can now query these APIs like any other kaminari model:
User.page(1).per(10)
IMPORTANT: Pagination is done by the API not by this gem, this gem just parses the response data and creates a Kaminari compatible collection that you can use in your views.
Add this line to your application's Gemfile:
gem 'her-kaminari'
And then execute:
$ bundle
Or install it yourself as:
$ gem install her-kaminari
First include Her::Kaminari::HeaderParser in your Her setup like this:
Her::API.setup url: 'https://api.example.com' do |c|
#...
# Response
c.use Her::Kaminari::HeaderParser
# ...
end
HeaderParser expects that the API request returns the following headers:
X-Total: Total number of records.
X-Page: Current page number.
X-Per-Page: Number of records per page.
X-Offset: (optional) the starting point for the return data.
Then include Her::Kaminari::Collection in your Her model like this:
class User
include Her::Model
include Her::Kaminari::Collection
end
Now you can use your Her model like any other Kaminari model.
After reading How to pass pagination headers with Kaminari, Her and Grape? post by Artur Hebda I decided that it was a good idea to create a gem with his code.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that her-kaminari demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.