Verifiable authenticity for Ruby object attributes.
Shinjitsu uses cryptography (specificaly Merkle trees, MACs, and digital signatures) to ensure attributes of objects are authentic.
This is particularly useful when persisting objects. Support is included for use with ActiveRecord.
Add this line to your application's Gemfile:
gem 'shinjitsu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install shinjitsu
Include Shinjitsu::Verified
in your Ruby class, then call the
verified_attributes
class method to select which attributes will be
verified:
class MyThing
attr_accessor :foo, :bar, :baz
include Shinjitsu::Verified
verified_attributes :foo, :bar, :baz
# Methods for storing digests of foo, bar, and baz:
attr_accessor :foo_digest, :bar_digest, :baz_digest
end
Note that we must add an additional three attributes:
foo_digest
, bar_digest
, and baz_digest
, to store the digests associated
with the foo
, bar
, and baz
attributes.
- Fork this repository on github
- Make your changes and send us a pull request
- If we like them we'll merge them
- If we've accepted a patch, feel free to ask for commit access
Copyright (c) 2015 Tony Arcieri. Distributed under the MIT License. See LICENSE.txt for further details.