
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
A thyng is a ruby object with the convention of saving state in key:value pairs that are public on the object rather than in private instance variables.
Instead of private attributes a thyng has public aspects. Basic access to these can be declared with asect_reader, aspect_write & aspect_accessor.
With all state external a thyng can be reconstructed completly from its data. This allows it to be passed as JSON or easily stored in a database.
class Person < Thyng
aspect_accessor :name
end
person = Person.new
# => {}
person.name = 'Fester'
puts person
# => {name: 'Fester'}
Thyng objects are subclassed from ruby hashes. This means most database orm's know exactly how handle them
class Person < Thyng
aspect_accessor :name
aspect_accessor :age
end
class Credentials < Thyng
extend Thyng::CryptedAspect
aspect_accessor :email
crypted_accessor :password # <- Oooh!
end
person = Person.new name: 'Morticia', age: '41'
credentials = Credentials.new email: 'm@addams.biz', password: 'password'
record = Record.last
record.set person
record.set credentials
record.save
Add this line to your application's Gemfile:
gem 'thyng'
And then execute:
$ bundle
Or install it yourself as:
$ gem install thyng
See introduction Example
To use this you must first add the module to thyng or your subclass of thyng. This will add the crypted_accessor method to your class.
crypted_accessor takes an aspect and adds five methods to you class. These are reader and writer methods for both the Bcrypt object and raw crypted string, as well as a check_aspect method
Example
class Credentials < Thyng
extend Thyng::CryptedAspect
aspect_accessor :email
crypted_accessor :password
end
credentials = Credentials.new email: 'test@example.com', password: 'password'
# => {:email=>"test@example.com", "crypted_password"=>"$2a$10$Bw4qH9Hp3iMG7c97SIBgJ.ahpXbL8M95FyDU7O.UHo4zgnxcm3bBi"}
credentials.password.class
# => BCrypt::Password
credentials.crypted_password.class
# => BCrypt::Password
credentials.check_password? 'password'
# => true
password_hash = BCrypt::Password.create('secret')
# => "$2a$10$O5DChGjqYxAU7yxo/J9.7uK55XPeWQxP0hU7nPYQNE85yDbl3H3I6"
credentials.crypted_password = password_hash
# => "$2a$10$O5DChGjqYxAU7yxo/J9.7uK55XPeWQxP0hU7nPYQNE85yDbl3H3I6"
credentials.check_password? 'secret'
# => true
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)FAQs
Unknown package
We found that thyng 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.