omniauth-parallelmarkets 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74c64edc87f5ab818b9a2f2cf4aa465ae56fdb10cc8ea20a109d2f737368a060
4
- data.tar.gz: d0bfb3bb2dff5b11ff9b5ce73ab2ecbb7e0f8a1dc0771a1b07490b798fd28f38
3
+ metadata.gz: 7166cbae827f2026708ac8741e85854d7fa1ff9c59caa2a00aa5e0b35c446c99
4
+ data.tar.gz: 50251a786f801151e1c9af9e2075f81fe95c3c11bc40659f96b6e0dea175c048
5
5
  SHA512:
6
- metadata.gz: c0ce1f93fe106def6af237efeb358897c6619caa8af112b92088abb836f0a72533660707c7923dbe45681abc26e4cc981c74dc545bcfc5bb609d6eb00c5dc4f2
7
- data.tar.gz: 4a51e656cd6128b705013e01d15f2452d0dddcf01699b4df76a329004313f30acb89378c771f28f6c17274c7e0bbde397566bbe71b0da38e239f1c9c883d4e9d
6
+ metadata.gz: 140cf4c00681023721333acf5c8170760f58be0449aa36aa6ec2eaddddbb0102bc5d2f2b10edef1de5ba6fd7d85866a20f39e6006cc6408a23eea666b438fbbc
7
+ data.tar.gz: 5fe6b709dd389f0269464388e7422b83d2dda3945077752a2a3266a66ead7bc1137392e62cbb5a0388831822ea080abf5f985443bd2e3f12059ba46b591a86d0
data/.travis.yml CHANGED
@@ -1,12 +1,7 @@
1
1
  bundler_args: --without development
2
- before_install:
3
- - gem update --system
4
- - gem update bundler
5
2
  cache: bundler
6
3
  language: ruby
7
4
  rvm:
8
- - 2.2
9
5
  - 2.3
10
6
  - 2.4
11
7
  - 2.5
12
- sudo: false
data/README.md CHANGED
@@ -1,25 +1,72 @@
1
+ [![Gem Version](https://badge.fury.io/rb/omniauth-parallelmarkets.svg)](https://badge.fury.io/rb/omniauth-parallelmarkets)
2
+ [![Build Status](https://travis-ci.org/parallel-markets/omniauth-parallelmarkets.svg?branch=master)](https://travis-ci.org/parallel-markets/omniauth-parallelmarkets)
3
+
1
4
  # OmniAuth ParallelMarkets
2
5
 
3
6
  This gem contains the [Parallel Markets](https://parallelmarkets.com) strategy for OmniAuth.
4
7
 
5
8
  ParallelMarkets uses the OAuth2 flow, you can read about at [docs.parallelmarkets.com/api](https://docs.parallelmarkets.com/api/).
6
9
 
7
- ## How To Use It
10
+ ## Installation
8
11
 
9
- So let's say you're using Rails, you need to add the strategy to your `Gemfile`:
12
+ Add this line to your application's Gemfile:
10
13
 
11
14
  ```ruby
12
15
  gem 'omniauth-parallelmarkets'
13
16
  ```
14
17
 
15
- Once these are in, you need to add the following to your `config/initializers/omniauth.rb`:
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install omniauth-parallelmarkets
25
+
26
+ ## Usage
16
27
 
28
+ You'll need to register your application with [Parallel Markets Support](mailto:help@parallelmarkets.com) and get `client_id` & `client_secret`.
29
+
30
+ Here's an example for adding the middleware to a Rails app in config/initializers/omniauth.rb:
17
31
  ```ruby
18
32
  Rails.application.config.middleware.use OmniAuth::Builder do
19
-  provider :parallelmarkets, YOUR_CUSTOMER_KEY, YOUR_CUSTOMER_SECRET
33
+ provider :parallelmarkets, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"]
20
34
  end
21
35
  ```
22
36
 
23
- You will obviously have to put in your key and secret, which you get when you register your app with Parallel Markets.
37
+ See the documentation for [OmniAuth](https://github.com/omniauth/omniauth) for more information on usage.
38
+
39
+ ## Sample Auth Hash
40
+ ```ruby
41
+ {
42
+ "provider"=>"parallelmarkets",
43
+ "uid"=>"123456",
44
+ "info"=> {
45
+ "name"=>"Snake Plissken",
46
+ "email"=>"snake@example.com",
47
+ "first_name"=>"Snake"
48
+ "last_name"=>"Plissken"
49
+ },
50
+ "credentials"=> {
51
+ "token"=>"parallel_access_token",
52
+ "refresh_token"=>"parallel_refresh_token",
53
+ "expires_at"=>1451681914,
54
+ "expires"=>true
55
+ },
56
+ "extra"=> {
57
+ "accreditations"=>[
58
+ {
59
+ "id"=>321,
60
+ "status"=>"current",
61
+ "expires_at"=>1565317542,
62
+ "assertion_type"=>"income",
63
+ "created_at"=>1565307542
64
+ }
65
+ ]
66
+ }
67
+ }
68
+ ```
69
+
70
+ ## License
24
71
 
25
- Now just follow the README at: https://github.com/intridea/omniauth
72
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module ParallelMarkets
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  end
7
7
  end
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ['lib']
19
19
 
20
20
  s.add_runtime_dependency 'omniauth-oauth2', '~> 1.2'
21
+ s.add_development_dependency 'rake', '~> 12.0'
21
22
  s.add_development_dependency 'rspec', '~> 3.5'
22
23
  s.add_development_dependency 'rubocop'
23
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-parallelmarkets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Muller
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement