omniauth-parallelmarkets 0.2.0 → 0.4.2

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: e4f6fcf2ea0b6a34e008507971044f27933d1b973e15384639551b10cc7087f6
4
- data.tar.gz: ffbd698e80c6bae14b05d7f277b05b9fd4099f16ed229edb45baf20254198b4d
3
+ metadata.gz: bf94329fc1db02d346d0d7befbb29fac39e51d30ec66e9a4a8b538951d3c7ec7
4
+ data.tar.gz: f71b522a1fcf3aee5585575e8446ad97b1d91c0b8bf4dc3f0967fd27a8023bc0
5
5
  SHA512:
6
- metadata.gz: d7f75a678d03e70fdee7fc068ef92f799fd78d54f3f2df14185b8ef2064d3debe12d35f93bbc03702926aea04fd741acd23f76b0d60c4b5f4a004c507ca0aa6b
7
- data.tar.gz: 635a1ed6c37c5476d2f2dbc5a5aa77990056aff7238c463c485dd812959637cadcdc7a94dc4bad651dcc51b57a790aabf8018d6e1d1f3d71918a7130aa98091e
6
+ metadata.gz: 3e2f2d1096227455fb66d03fa9d6896328113f0ba72b81c269bf771a4d4ad51066ab56cee1395584caa256046bce3b8cb5acd5116f94428f26d15c23dbb53d7b
7
+ data.tar.gz: 3297663cf3ca60172a2aa44889a546116c6ac5a89cf6132366d1dab693b65cb698abdefcb868831e08eed8c8f90b8e659eca164c002f47fe7a3c55eebb7b25c8
@@ -0,0 +1,18 @@
1
+ name: Run Tests
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ jobs:
7
+ test:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@master
12
+
13
+ - uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: '3.0.1'
16
+ bundler-cache: true
17
+
18
+ - run: bundle exec rake
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
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)
2
+ [![Tests](https://github.com/parallel-markets/omniauth-parallelmarkets/actions/workflows/ci.yml/badge.svg)](https://github.com/parallel-markets/omniauth-parallelmarkets/actions/workflows/ci.yml)
3
3
 
4
4
  # OmniAuth ParallelMarkets
5
5
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module ParallelMarkets
5
- VERSION = '0.2.0'
5
+ VERSION = '0.4.2'
6
6
  end
7
7
  end
@@ -9,6 +9,7 @@ module OmniAuth
9
9
  site: 'https://api.parallelmarkets.com',
10
10
  authorize_url: '/v1/oauth/authorize',
11
11
  token_url: '/v1/oauth/token'
12
+ option :authorize_options, %i[scope force_accreditation_check force_identity_check identity_claim_override_id]
12
13
 
13
14
  uid { raw_info['id'] }
14
15
 
@@ -24,7 +25,14 @@ module OmniAuth
24
25
  extra do
25
26
  {
26
27
  accreditations: accreditations,
28
+ indicated_unaccredited: indicated_unaccredited,
27
29
  business_type: profile['business_type'],
30
+ primary_contact: profile['primary_contact'].nil? ? nil : {
31
+ name: "#{profile['primary_contact']['first_name']} #{profile['primary_contact']['last_name']}",
32
+ first_name: profile['primary_contact']['first_name'],
33
+ last_name: profile['primary_contact']['last_name'],
34
+ email: profile['primary_contact']['email']
35
+ },
28
36
  type: raw_info['type'],
29
37
  user_id: raw_info['user_id'],
30
38
  raw_info: raw_info
@@ -33,12 +41,17 @@ module OmniAuth
33
41
 
34
42
  def authorize_params
35
43
  super.tap do |params|
36
- %w[scope client_options].each do |v|
37
- params[v.to_sym] = request.params[v] if request.params[v]
44
+ options[:authorize_options].each do |k|
45
+ params[k] = request.params[k.to_s] if request.params[k.to_s]
38
46
  end
39
47
  end
40
48
  end
41
49
 
50
+ # this is dumb, but https://github.com/omniauth/omniauth-oauth2/issues/93 is still open
51
+ def callback_url
52
+ options[:redirect_uri] || (full_host + script_name + callback_path)
53
+ end
54
+
42
55
  def raw_info
43
56
  @raw_info ||= access_token.get('/v1/me').parsed
44
57
  end
@@ -48,7 +61,11 @@ module OmniAuth
48
61
  end
49
62
 
50
63
  def raw_accreditations
51
- @accreditations ||= access_token.get('/v1/accreditations').parsed
64
+ @raw_accreditations ||= access_token.get('/v1/accreditations').parsed
65
+ end
66
+
67
+ def indicated_unaccredited
68
+ raw_accreditations['indicated_unaccredited']
52
69
  end
53
70
 
54
71
  def accreditations
@@ -20,5 +20,4 @@ Gem::Specification.new do |s|
20
20
  s.add_runtime_dependency 'omniauth-oauth2', '~> 1.2'
21
21
  s.add_development_dependency 'rake', '~> 12.0'
22
22
  s.add_development_dependency 'rspec', '~> 3.5'
23
- s.add_development_dependency 'rubocop'
24
23
  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.2.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Muller
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-17 00:00:00.000000000 Z
11
+ date: 2021-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.5'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description: Parallel Markets OAuth strategy for OmniAuth.
70
56
  email:
71
57
  - bamuller@gmail.com
@@ -73,10 +59,9 @@ executables: []
73
59
  extensions: []
74
60
  extra_rdoc_files: []
75
61
  files:
62
+ - ".github/workflows/ci.yml"
76
63
  - ".gitignore"
77
64
  - ".rspec"
78
- - ".rubocop.yml"
79
- - ".travis.yml"
80
65
  - Gemfile
81
66
  - LICENSE
82
67
  - README.md
@@ -89,7 +74,7 @@ homepage: https://github.com/parallel-markets/omniauth-parallelmarkets
89
74
  licenses:
90
75
  - MIT
91
76
  metadata: {}
92
- post_install_message:
77
+ post_install_message:
93
78
  rdoc_options: []
94
79
  require_paths:
95
80
  - lib
@@ -104,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
89
  - !ruby/object:Gem::Version
105
90
  version: '0'
106
91
  requirements: []
107
- rubygems_version: 3.0.6
108
- signing_key:
92
+ rubygems_version: 3.2.15
93
+ signing_key:
109
94
  specification_version: 4
110
95
  summary: Parallel Markets OAuth strategy for OmniAuth
111
96
  test_files: []
data/.rubocop.yml DELETED
@@ -1,11 +0,0 @@
1
- Metrics/LineLength:
2
- Enabled: false
3
-
4
- Metrics/BlockLength:
5
- Enabled: false
6
-
7
- Style/Documentation:
8
- Enabled: false
9
-
10
- Naming/FileName:
11
- Enabled: false
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- cache: bundler
2
- language: ruby
3
- rvm:
4
- - 2.3
5
- - 2.4
6
- - 2.5