GithubHelp home page GithubHelp logo

shinjitsu's Introduction

Shinjitsu

Build Status

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.

Installation

Add this line to your application's Gemfile:

gem 'shinjitsu'

And then execute:

$ bundle

Or install it yourself as:

$ gem install shinjitsu

Usage

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.

Contributing

  • 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

License

Copyright (c) 2015 Tony Arcieri. Distributed under the MIT License. See LICENSE.txt for further details.

shinjitsu's People

Contributors

tarcieri avatar

Stargazers

Charlton Trezevant avatar Sean Huber avatar

Watchers

 avatar Frank Denis avatar James Cloos avatar  avatar

shinjitsu's Issues

Usecase?

Perhaps a usecase in the README could be great :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.