omniauth-parallelmarkets 0.1.1 → 0.4.1
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 +4 -4
- data/.github/workflows/ci.yml +18 -0
- data/README.md +1 -1
- data/lib/omniauth-parallelmarkets/version.rb +1 -1
- data/lib/omniauth/strategies/parallelmarkets.rb +28 -3
- data/omniauth-parallelmarkets.gemspec +0 -1
- metadata +7 -22
- data/.rubocop.yml +0 -11
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d1a9cc04610afce884e57adc8800b29b434dfcdb07e6cb18271906e0681d34f
|
4
|
+
data.tar.gz: 7aef3c3db5c6fb704abc875b28403cd8ca645fe7778656dd91805cde9b54cb21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1ccb2af52e3e33924183dab77dac16c345fa645564c54dd4bf67837b43a0f7d9e4bbc6d42b39bff127b44347842c341296c76369044c2a00b1a2bb705a0b00a
|
7
|
+
data.tar.gz: 46ed239d34cc0feb7e8b8ea2cde691570c5b1d77a5950ec0fdea32d46a7fbc9669ea1fea33bcb70941c0b0301df98cb0695c1d62878099530c370d93db6de445
|
@@ -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
|
[](https://badge.fury.io/rb/omniauth-parallelmarkets)
|
2
|
-
[](https://github.com/parallel-markets/omniauth-parallelmarkets/actions/workflows/ci.yml)
|
3
3
|
|
4
4
|
# OmniAuth ParallelMarkets
|
5
5
|
|
@@ -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]
|
12
13
|
|
13
14
|
uid { raw_info['id'] }
|
14
15
|
|
@@ -23,8 +24,15 @@ module OmniAuth
|
|
23
24
|
|
24
25
|
extra do
|
25
26
|
{
|
26
|
-
accreditations:
|
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
|
-
|
37
|
-
params[
|
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
|
@@ -46,6 +59,18 @@ module OmniAuth
|
|
46
59
|
def profile
|
47
60
|
@profile ||= raw_info.fetch('profile', {})
|
48
61
|
end
|
62
|
+
|
63
|
+
def raw_accreditations
|
64
|
+
@raw_accreditations ||= access_token.get('/v1/accreditations').parsed
|
65
|
+
end
|
66
|
+
|
67
|
+
def indicated_unaccredited
|
68
|
+
raw_accreditations['indicated_unaccredited']
|
69
|
+
end
|
70
|
+
|
71
|
+
def accreditations
|
72
|
+
raw_accreditations['accreditations']
|
73
|
+
end
|
49
74
|
end
|
50
75
|
end
|
51
76
|
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.
|
4
|
+
version: 0.4.1
|
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:
|
11
|
+
date: 2021-06-04 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.
|
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