
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
apiify is a little gem that takes any .csv file and turns it into an API.
It's aimed at large organisations, e.g. government departments, that publish a lot of data as .csv and who want a quick way to access this data as JSON in their digital services.
You will need to initialize a Rails API-only application with a Postgres database, by running something like the following:
$ rails new <my-api> -d=postgresql --api
Then make your database with $ bin/rake db:create
.
Add this line to your application's Gemfile:
gem 'apiify'
And install with bundle
. Or install it yourself as:
$ gem install apiify
Locate the CSV file you want to turn into an API. The name of the CSV file will become the name of the database table you will create, so ensure it is named appropriately.
Bad:
Good:
In your Rails API project directory, run $ apiify new <path-to-csv> [index]
. This will run an API-appropriate scaffold via rails (i.e. a model, controller, and serializer will be created; so will a migration). The optional [index] argument takes the name of a column header and indexes that column in the database.
The model's properties will be derived from the CSV column headers, so ensure they are properly named. apiify auto-detects an appropriate property type based on the contents of each column.
Bad:
Good:
apiify will prompt you to run $ bin/rake db:migrate
. Do so.
Then run $ apiify import <path-to-csv>
. This will import each row in your CSV file as a new record in your database.
Run $ bin/rails s
to boot up your rails server. Visit localhost:3000/<pluralised model name>
to see your data in lovely, lovely JSON format.
Run apiify help [COMMAND]
to see a list of commands and get help with their usage.
This gem currently does not work with databases other than Postgresql.
It currently does not support updating a database table based on a CSV input - it creates a new table each time the gem is used.
Please take a look at the list of known issues before using the gem.
Bug reports and pull requests are welcome on GitHub at https://github.com/oscar-barlow/apiify.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that apiify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.