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.
Ruby gRPC extensions/helpers
Mixin for GRPC::RpcServer
:
ActiveRecord
connection (auto-connect + pooling)ActiveSupport::Notifications
(available as process_action.grpc
, includes service: 'package.name.ServiceName', action: 'underscored_action_name'
data)ActiveSupport::Rescuable
and transforms most common ActiveRecord::ActiveRecordError
-s into GRPC::BadStatus
onesExample:
require 'grpcx/server' # or just 'grpcx'
class MyServer < GRPC::RpcServer
include Grpcx::Server
# optional custom error handling:
rescue_from 'MyError' do |e|
raise Grpc::BadStatus.new(e.to_s, my_extra: e.my_extra)
end
end
# proceed as with usual GRPC::RpcServer:
server = MyServer.new(...)
server.handle(MyService.new)
server.add_http2_port '127.0.0.1:8080', :this_port_is_insecure
server.run_till_terminated
Recommended to be used with Grpclb::Server:
require 'grpclb/server'
require 'grpcx/server'
class MyServer < Grpclb::Server
include Grpcx::Server
end
...
Since version >= 0.5.4
Datadog::Notifications.configure do |c|
c.use Datadog::Notifications::Plugins::GRPC
end if RUNNING_IN_PROD?
ActiveSupport::Notifications.subscribe(Grpcx::Server::Interceptors::Instrumentation::METRIC_NAME) do |_name, _start, _finish, _id, payload|
e = payload[:exception_object]
next unless e
Raven.capture_exception(e, extra: {
'service' => payload[:service],
'action' => payload[:action],
})
end
Raven.configure do |config|
config.should_capture = proc {|e|
!e.is_a?(GRPC::BadStatus) # skip GRPC::BadStatus, but report everything else
}
end
Similar approach can be used for logging.
FAQs
Unknown package
We found that grpcx 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.