easy_oauth

Version, currently master branch1 version
  • master branchlatestFeb 27, 2018

github.com/watzon/easy_oauth

Crystal OAuth headers made simple

3 stars
1 dependent
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  easy_oauth:
    github: watzon/easy_oauth
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.24.1
License
MIT
Author
Chris Watson

Dependencies

Development Dependencies

  • mocks~> 0.9github: waterlink/mocks.crdev
  • spec2~> 0.9github: waterlink/spec2.crdev
  • spec2-mocks*github: waterlink/spec2-mocks.crdev

README

easy_oauth

Travis Github search hit counter license

The EasyOAuth shard builds and verifies OAuth headers for use with third party libraries such as Halite. This library is a port of laserlemon/simple_oauth.

Installation

Add this to your application's shard.yml:

dependencies:
  easy_oauth:
    github: watzon/easy_oauth

Usage

require "halite" # or whatever you want
require "easy_oauth"

options = {
  "consumer_key" => "8karQBlMg6gFOwcf8kcoYw",
  "consumer_secret" => "3d0vcHyUiiqADpWxolW8nlDIpSWMlyK7YNgc5Qna2M",
  "token" => "201425800-Sv4sTcgoffmHGkTCue0JnURT8vrm4DiFAkeFNDkh",
  "token_secret" => "T5qa1tF57tfDzKmpM89DHsNuhgOY4NT6DlNLsTFcuQ"
}

url = https://api.twitter.com/1/statuses/update.json
params = {"status" => "hi, again"}
header = EasyOAuth::Header.new(:post, url, params, options)

response = halite.auth(header).post(url, params: params)

Development

  1. Make your changes
  2. Run crystal spec and make sure you didn't break anything
  3. Follow the contributing instructions below
  4. Profit

Contributing

  1. Fork it ( https://github.com/watzon/easy_oauth/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

Contributors

  • watzon Chris Watson - creator, maintainer