
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
= attr_required
This gem provide attr_required
and attr_optional
like attr_accessor
.
REQUIRED and OPTIONAL are common terminology in RFCs, and used for protocol parameters. This gem helps RFC library developers to define which parameters (attributes in Ruby world) are REQUIRED and which are OPTIONAL. It might be also helpful for other developers.
I've developed this gem to use for rack-oauth2, a Rack-based OAuth 2.0 library. https://github.com/nov/rack-oauth2
== Installation
gem install attr_required
== Usage
require 'attr_required' require 'attr_optional'
class A include AttrRequired, AttrOptional attr_required :required_a attr_optional :optional_a end
class B < A attr_required :required_b attr_optional :optional_b end
A.required_attributes #=> [:required_a] B.required_attributes #=> [:required_a, :required_b] A.optional_attributes #=> [:optional_a] B.optional_attributes #=> [:optional_a, :optional_b]
A.attr_required?(:required_a) #=> true B.attr_optional?(:optional_b) #=> true
@a = A.new @b = B.new
@a.required_attributes #=> [:required_a] @b.required_attributes #=> [:required_a, :required_b] @a.optional_attributes #=> [:optional_a] @b.optional_attributes #=> [:optional_a, :optional_b]
@a.attr_required?(:required_a) #=> true @a.attr_optional?(:optiona_a) #=> true
@a.attr_missing? #=> true @a.attr_missing #=> [:required_a] @a.attr_missing! #=> raise AttrRequired::AttrMissing @a.required_a = "foo" @a.attr_missing? #=> false @a.attr_missing #=> [] @a.attr_missing! #=> do nothing
Check spec/attr_(required|optional).rb for more details.
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2010 nov matake. See LICENSE for details.
FAQs
Unknown package
We found that attr_required 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.