
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Validate parameters like strong-parameters(rails)
require "monban/params"
Monban::Params.new.validate(params) do |v|
v.hash(
"name" => v.combine([v.string, v.not_empty]),
"token" => v.combine([v.string, v.allow_empty(v.length(5))]),
"int" => v.integer,
"bool" => v.bool,
"key" => v.equal("KEY"),
"string" => v.in(["param1","param2"]),
"tel" => v.combine([v.string, v.match(%r{\A[0-9]+([0-9-]*)\Z})]),
"date" => v.combine([v.string, v.match_date]),
"number" => v.combine([v.string, v.match_integer]),
"bool" => v.combine([v.string, v.match_bool]),
"data" => v.not_nil,
"hash" => v.hash_strict(
"array" => v.array(v.string),
"keys" => v.array_include(["key1","key2","key3"]),
),
)
end
# => raise Monban::Params::Error if validation failed
require "monban/params"
Monban::Params.new.validate(params) do |v|
# argument `params` should be hash
v.hash(
# "key" should be String
"key" => v.string,
# "key" should be Integer
"key" => v.integer,
# "key" should be Boolean
"key" => v.bool,
# "key" should not be empty
"key" => v.not_empty,
# validate not_nil
"key" => v.not_nil,
# "key" should be equal to "value"
"key" => v.equal("value"),
# "key" should be equal to "value1" or "value2"
"key" => v.in(["value1","value2"]),
# "key" length should be 10,
"key" => v.length(10),
# "key" should match %r{example}
"key" => v.match(%r{example}),
# "key" should match integer (value is string, but seem to be a Integer)
"key" => v.match_integer,
# "key" downcase should be equal to "true" or "false"
"key" => v.match_bool,
# "key" should match date
"key" => v.match_date,
# "key" should be hash includes :key that value should be string
"key" => v.hash(
key: v.string,
),
# "key" should be hash only includes :key that value should be string
"key" => v.hash_strict(
key: v.string,
),
# "key" should be array that has string value
"key" => v.array(v.string),
# "key" should be array that has "value1" or "value2"
"key" => v.array_include(["value1","value2"])
# "key" should be match integer if value is not empty
"key" => v.allow_empty(v.match_integer),
# "key" validate string and not_empty
"key" => v.combine([v.string, v.not_empty]),
)
end
# => raise Monban::Params::Error if validation failed
Add this line to your application's Gemfile:
gem 'monban-params'
And then execute:
$ bundle
Or install it yourself as:
$ gem install monban-params
monban/params is licensed under the MIT license.
Copyright © since 2018 shun@getto.systems
FAQs
Unknown package
We found that monban-params 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.