No commit activity in last 3 years
No release in over 3 years
WIP!!! escher sign and validation for faraday http rest client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

FaradayMiddleware for Escher secure authorization

escher sign and validation for faraday http rest client

Installation

Add this line to your application's Gemfile:

gem 'faraday_middleware-escher'

And then execute:

$ bundle

Or install it yourself as:

$ gem install faraday_middleware-escher

Usage

for sign requests

The FaradayMiddleware::Escher::RequestSigner will help you sign your requests before sending them

    
require 'faraday_middleware/escher'

conn = Faraday.new do |builder|

  builder.use FaradayMiddleware::Escher::RequestSigner,
              credential_scope: CredentialScope,
              options: AuthOptions,
              active_key: -> { Escher::Keypool.new.get_active_key('EscherExample') }

  builder.adapter :net_http


end

Response Validator

The FaradayMiddleware::Escher::ResponseValidator will help you authenticate responses on receiving

    
require 'faraday_middleware/escher'

conn = Faraday.new do |builder|

  builder.use FaradayMiddleware::Escher::ResponseValidator,
              credential_scope: CredentialScope,
              options: AuthOptions,
              keydb_constructor: -> { Escher::Keypool.new.get_key_db }

  builder.adapter :net_http


end

You can mix the two in one case

Who loves Man in the Middle? If you not, this is your setup!

require 'faraday_middleware/escher'

conn = Faraday.new do |builder|

  builder.use FaradayMiddleware::Escher::RequestSigner,
              credential_scope: CredentialScope,
              options: AuthOptions,
              active_key: -> { Escher::Keypool.new.get_active_key('EscherExample') }

  builder.use FaradayMiddleware::Escher::ResponseValidator,
              credential_scope: CredentialScope,
              options: AuthOptions,
              keydb_constructor: -> { Escher::Keypool.new.get_key_db }

  builder.adapter :net_http


end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/faraday_middleware-escher/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