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.
= roda-route_list
The Roda route_list plugin reads route information from a json file, and then makes the route metadata available for introspection. This provides a workaround to the general issue of routing trees being unable to introspect the routes.
== Installation
gem install roda-route_list
== Source Code
Source code is available on GitHub at https://github.com/jeremyevans/roda-route_list
== Basic Usage
This plugin assumes that a json file containing the routes metadata has already been created. The recommended way to create one is to add comments above each route in the Roda app, in one of the following formats:
As you can see, the general style is a comment followed by the word route. If you want to name the route, you can put the name in brackets. Then you have a colon. Optionally after that you can have the method for the route, or multiple methods separated by pipes if the path works with multiple methods. The end is the path for the route.
Assuming you have added the appropriate comments as explained above, you can create the json file using the roda-parse_routes executable that came with the roda-route_list gem:
roda-parse_routes -f routes.json app.rb
Assuming you have the necessary json file created, you can then get route information:
plugin :route_list
route_list # => [{:path=>'/path/to/foo', :methods=>['GET', 'POST']}]
listed_route(:route_name) # => '/path/to/foo'
listed_route(:foo, :foo_id=>3) # => '/path/to/foo/3'
listed_route(:foo, [3]) # => '/path/to/foo/3'
The +listed_route+ method is also available at the instance level to make it easier to use inside the route block.
=== Automatically Updating the Routes Metadata
==== On Heroku
You can get this to work on Heroku by hooking into the facility for precompiling assets. If this consider your route list an asset, this makes sense. You just need to add an assets:precompile task, similar to this (or add the code an existing assets:precompile task):
namespace :assets do desc "Update the routes metadata" task :precompile do sh 'roda-parse_routes -f routes.json app.rb' end end
==== Otherwise
At the top of your Roda app file, or at least before you create the Roda app subclass, just call the roda-parse_routes program:
system 'roda-parse_routes', '-f', 'routes.json', FILE require 'roda'
class App < Roda # ... end
== License
MIT
== Maintainer
Jeremy Evans code@jeremyevans.net
FAQs
Unknown package
We found that roda-route_list 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.