omniauth-parallelmarkets 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 730b44e26921f1aad13a281a367d4dd2cbe9570d23753446d6ecf6fa4edb7748
4
- data.tar.gz: a4e0bb4f3a5c8b5989542200bfb897e3a6c74cca66a56d709203454498504859
3
+ metadata.gz: 2c6b382d351a845a0e8b4edb867ca7b49fee4ea70bff43092ff4996766900478
4
+ data.tar.gz: 27eb701bbeffaf81d32ed6090f73dd79b181fd393b984b80a9a51e5f477b9331
5
5
  SHA512:
6
- metadata.gz: 5ce112a2d2b3608ece94ab87c7b687ceeb793aae2e7c96df4d540b2a11c3ce7a35ed13e66e893d5a10407ee53be468bf39b1792243a4666d97e796b0deac099c
7
- data.tar.gz: e74674e76bf1de82a28ecd846d89b06145fa8b50f53eb6accdd20733c4a6866fb56611ab12a785ce0b11c4f134ac799e5f4bb462bb40b79c7ff8355ff64da174
6
+ metadata.gz: ab7b0e609c87ac035242a887879d8a150039ab6e58d55fea0ceec816e3736a6d40e26679d3c239e6eb7e11b3a9040a4f2fd6f7ad110b6d4b2899e74581b6688b
7
+ data.tar.gz: 2c70c949e15ad49b3e37004c4c97f34c7123e929a1fdce5b6d7e9613628e8c122d5220b52928fbcc395a3b0b1dc892c128dc3584699697b3d331c29f1739385a
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  This gem contains the [Parallel Markets](https://parallelmarkets.com) strategy for OmniAuth.
7
7
 
8
- ParallelMarkets uses the OAuth2 flow, you can read about at [docs.parallelmarkets.com/api](https://docs.parallelmarkets.com/api/).
8
+ ParallelMarkets uses the OAuth2 flow, you can read about at [developer.parallelmarkets.com/api](https://developer.parallelmarkets.com).
9
9
 
10
10
  ## Installation
11
11
 
@@ -28,6 +28,7 @@ Or install it yourself as:
28
28
  You'll need to register your application with [Parallel Markets Support](mailto:help@parallelmarkets.com) and get `client_id` & `client_secret`.
29
29
 
30
30
  Here's an example for adding the middleware to a Rails app in config/initializers/omniauth.rb:
31
+
31
32
  ```ruby
32
33
  Rails.application.config.middleware.use OmniAuth::Builder do
33
34
  provider :parallelmarkets, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"]
@@ -40,7 +41,7 @@ See the documentation for [OmniAuth](https://github.com/omniauth/omniauth) for m
40
41
  ```ruby
41
42
  {
42
43
  "provider"=>"parallelmarkets",
43
- "uid"=>"123456",
44
+ "uid"=>"VXNlcjox",
44
45
  "info"=> {
45
46
  "name"=>"Snake Plissken",
46
47
  "email"=>"snake@example.com",
@@ -54,6 +55,8 @@ See the documentation for [OmniAuth](https://github.com/omniauth/omniauth) for m
54
55
  "expires"=>true
55
56
  },
56
57
  "extra"=> {
58
+ "type"=>"individual",
59
+ "user_id"=>"VXNlcjox",
57
60
  "accreditations"=>[
58
61
  {
59
62
  "id"=>321,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module ParallelMarkets
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
@@ -10,21 +10,23 @@ module OmniAuth
10
10
  authorize_url: '/v1/oauth/authorize',
11
11
  token_url: '/v1/oauth/token'
12
12
 
13
- uid { raw_info['uid'] }
13
+ uid { raw_info['id'] }
14
14
 
15
15
  info do
16
16
  {
17
- name: raw_info['name'] || "#{raw_info['first_name']} #{raw_info['last_name']}",
18
- first_name: raw_info['first_name'],
19
- last_name: raw_info['last_name'],
20
- email: raw_info['email']
17
+ name: profile['name'] || "#{profile['first_name']} #{profile['last_name']}",
18
+ first_name: profile['first_name'],
19
+ last_name: profile['last_name'],
20
+ email: profile['email']
21
21
  }
22
22
  end
23
23
 
24
24
  extra do
25
25
  {
26
26
  accreditations: raw_info['accreditations'],
27
+ business_type: profile['business_type'],
27
28
  type: raw_info['type'],
29
+ user_id: raw_info['user_id'],
28
30
  raw_info: raw_info
29
31
  }
30
32
  end
@@ -40,6 +42,10 @@ module OmniAuth
40
42
  def raw_info
41
43
  @raw_info ||= access_token.get('/v1/me').parsed
42
44
  end
45
+
46
+ def profile
47
+ @profile ||= raw_info.fetch('profile', {})
48
+ end
43
49
  end
44
50
  end
45
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-parallelmarkets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Muller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-15 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2