
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
rack-rest_api_versioning
Advanced tools
= Rack REST API Versioning
This Rack middleware adds support for RESTful API versioning. According to RESTful best practices, the API version should be specified using content negotiation and custom vendor MIME types. For example, if your application's API supports multiple versions, a client can ask for a specific version like this:
GET /foo HTTP/1.1 Accept: application/vnd.foo.bar-v2+xml
Where "application/vnd.foo.bar-v2+xml" is vendor MIME type your application defines.
See this article: http://barelyenough.org/blog/2008/05/versioning-rest-web-services/ for more information about this practice.
This middleware is used like any other rack middleware:
use Rack::RestApiVersioning
When used, it extracts the version from the Accept header, and makes it available in the Rack environment hash as "api_version":
app = lambda { |env puts env['api_version'] [200, {}, []] }
To simplify testing and debugging, this middleware also allows the version to be overriden using simple query string parameter:
GET /foo?version=2 HTTP/1.1
This will ask for version 2, no matter what the Accept header is set to.
Finally, a default version can be specified. This will be used if no version can be extracted:
use Rack::RestApiVersioning, :default_version => '2.0'
== Legal
Copyright (c) 2010 Adam Cigánek adam.ciganek@gmail.com. Released under the terms of MIT License: www.opensource.org/licenses/mit-license.php
FAQs
Unknown package
We found that rack-rest_api_versioning 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.