Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

avvo/param_signer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParamSigner

Sign params with a shared secret

Installation

Add this line to your application's Gemfile:

gem 'param_signer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install param_signer

Usage

Get a signing key

signature = ParamSigner::Signer.sign({
  foo: 'bar',
  asdf: 'qwer'
}, my_secret)

Or, you can create an instance to reuse:

signer = ParamSigner::Signer.new(my_secret)
signature = signer.sign({
  foo: 'bar',
  asdf: 'qwer'
})

Verify a signing key

ParamSigner::Signer.valid?({
  foo: 'bar',
  asdf: 'qwer'
}, my_secret, signature)

Or, you can create an instance to reuse:

signer = ParamSigner::Signer.new(my_secret)
is_valid = signer.valid?({
  foo: 'bar',
  asdf: 'qwer'
}, signature)

Contributing

  1. Fork it ( https://github.com/avvo/param_signer/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Sign params with a shared secret

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages