omniauth-osso 0.1.5 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/pipeline.yml +2 -2
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/automerge.yml +19 -0
- data/.rubocop.yml +3 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +47 -40
- data/LICENSE +21 -23
- data/lib/omniauth-osso/version.rb +1 -1
- data/lib/omniauth/strategies/osso.rb +12 -10
- data/omniauth-osso.gemspec +3 -1
- data/spec/omniauth/strategies/osso_spec.rb +38 -6
- metadata +30 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '060189c38f08e460d75fea568f52d1d91790e2be8e096e85ad40eb82e16ffbc9'
|
4
|
+
data.tar.gz: 3f40dd45f8ee43d1c5278e84d7fab10147f9281f8dd451b660184b96ace3b928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b343a5cf6b1220f4bd10435790c862167e741cba2b2e8d798f137b2e4142628be1e06437fc76153ef298c817317e840befcc005090632e375cfbfd3e8431768
|
7
|
+
data.tar.gz: 6cbf6d78ac3229480f880c5082c781600fe5a42cd0cbd14aa34523d3b0997790310207a245b4d0acac1a4b900a0674b22fc5b7fb3ad352d9cf9e1c1720a62c56
|
data/.buildkite/pipeline.yml
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
name: auto-merge
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
auto-approve:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- uses: ahmadnassri/action-dependabot-auto-merge@v2
|
12
|
+
with:
|
13
|
+
target: minor
|
14
|
+
github-token: ${{ secrets.TOKEN }}
|
15
|
+
- uses: hmarr/auto-approve-action@v2.0.0
|
16
|
+
if: github.actor == 'dependabot[bot]'
|
17
|
+
with:
|
18
|
+
github-token: "${{ secrets.TOKEN }}"
|
19
|
+
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -7,9 +7,9 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
7
7
|
group :test do
|
8
8
|
gem 'pry'
|
9
9
|
gem 'rack-test'
|
10
|
-
gem 'rspec', '~> 3.
|
10
|
+
gem 'rspec', '~> 3.10'
|
11
11
|
gem 'rubocop'
|
12
|
-
gem 'webmock', '~> 3.
|
12
|
+
gem 'webmock', '~> 3.11'
|
13
13
|
end
|
14
14
|
|
15
15
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,25 +1,28 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omniauth-osso (0.
|
5
|
-
omniauth
|
4
|
+
omniauth-osso (0.2.0)
|
5
|
+
omniauth (< 2.0.0)
|
6
|
+
omniauth-oauth2 (>= 1.6, < 1.8)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
11
|
addressable (2.7.0)
|
11
12
|
public_suffix (>= 2.0.2, < 5.0)
|
12
|
-
ast (2.4.
|
13
|
-
coderay (1.1.
|
14
|
-
crack (0.4.
|
15
|
-
|
16
|
-
diff-lcs (1.
|
17
|
-
faraday (1.0
|
13
|
+
ast (2.4.2)
|
14
|
+
coderay (1.1.3)
|
15
|
+
crack (0.4.5)
|
16
|
+
rexml
|
17
|
+
diff-lcs (1.4.4)
|
18
|
+
faraday (1.3.0)
|
19
|
+
faraday-net_http (~> 1.0)
|
18
20
|
multipart-post (>= 1.2, < 3)
|
21
|
+
ruby2_keywords
|
22
|
+
faraday-net_http (1.0.1)
|
19
23
|
hashdiff (1.0.1)
|
20
24
|
hashie (4.1.0)
|
21
|
-
|
22
|
-
jwt (2.2.1)
|
25
|
+
jwt (2.2.2)
|
23
26
|
method_source (1.0.0)
|
24
27
|
multi_json (1.15.0)
|
25
28
|
multi_xml (0.6.0)
|
@@ -33,46 +36,50 @@ GEM
|
|
33
36
|
omniauth (1.9.1)
|
34
37
|
hashie (>= 3.4.6)
|
35
38
|
rack (>= 1.6.2, < 3)
|
36
|
-
omniauth-oauth2 (1.
|
37
|
-
oauth2 (~> 1.
|
38
|
-
omniauth (
|
39
|
-
parallel (1.
|
40
|
-
parser (
|
41
|
-
ast (~> 2.4.
|
42
|
-
pry (0.13.
|
39
|
+
omniauth-oauth2 (1.7.1)
|
40
|
+
oauth2 (~> 1.4)
|
41
|
+
omniauth (>= 1.9, < 3)
|
42
|
+
parallel (1.20.1)
|
43
|
+
parser (3.0.0.0)
|
44
|
+
ast (~> 2.4.1)
|
45
|
+
pry (0.13.1)
|
43
46
|
coderay (~> 1.1)
|
44
47
|
method_source (~> 1.0)
|
45
|
-
public_suffix (4.0.
|
46
|
-
rack (2.2.
|
48
|
+
public_suffix (4.0.6)
|
49
|
+
rack (2.2.3)
|
47
50
|
rack-test (1.1.0)
|
48
51
|
rack (>= 1.0, < 3)
|
49
52
|
rainbow (3.0.0)
|
53
|
+
regexp_parser (2.0.3)
|
50
54
|
rexml (3.2.4)
|
51
|
-
rspec (3.
|
52
|
-
rspec-core (~> 3.
|
53
|
-
rspec-expectations (~> 3.
|
54
|
-
rspec-mocks (~> 3.
|
55
|
-
rspec-core (3.
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-expectations (3.
|
55
|
+
rspec (3.10.0)
|
56
|
+
rspec-core (~> 3.10.0)
|
57
|
+
rspec-expectations (~> 3.10.0)
|
58
|
+
rspec-mocks (~> 3.10.0)
|
59
|
+
rspec-core (3.10.1)
|
60
|
+
rspec-support (~> 3.10.0)
|
61
|
+
rspec-expectations (3.10.1)
|
58
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-mocks (3.
|
63
|
+
rspec-support (~> 3.10.0)
|
64
|
+
rspec-mocks (3.10.1)
|
61
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-support (3.
|
64
|
-
rubocop (
|
65
|
-
jaro_winkler (~> 1.5.1)
|
66
|
+
rspec-support (~> 3.10.0)
|
67
|
+
rspec-support (3.10.1)
|
68
|
+
rubocop (1.8.1)
|
66
69
|
parallel (~> 1.10)
|
67
|
-
parser (>=
|
70
|
+
parser (>= 3.0.0.0)
|
68
71
|
rainbow (>= 2.2.2, < 4.0)
|
72
|
+
regexp_parser (>= 1.8, < 3.0)
|
69
73
|
rexml
|
74
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
70
75
|
ruby-progressbar (~> 1.7)
|
71
|
-
unicode-display_width (>= 1.4.0, <
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
77
|
+
rubocop-ast (1.4.1)
|
78
|
+
parser (>= 2.7.1.5)
|
79
|
+
ruby-progressbar (1.11.0)
|
80
|
+
ruby2_keywords (0.0.4)
|
81
|
+
unicode-display_width (2.0.0)
|
82
|
+
webmock (3.11.1)
|
76
83
|
addressable (>= 2.3.6)
|
77
84
|
crack (>= 0.3.2)
|
78
85
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -85,9 +92,9 @@ DEPENDENCIES
|
|
85
92
|
omniauth-osso!
|
86
93
|
pry
|
87
94
|
rack-test
|
88
|
-
rspec (~> 3.
|
95
|
+
rspec (~> 3.10)
|
89
96
|
rubocop
|
90
|
-
webmock (~> 3.
|
97
|
+
webmock (~> 3.11)
|
91
98
|
|
92
99
|
BUNDLED WITH
|
93
100
|
2.1.4
|
data/LICENSE
CHANGED
@@ -2,33 +2,31 @@ Business Source License 1.1
|
|
2
2
|
|
3
3
|
Parameters
|
4
4
|
|
5
|
-
Licensor:
|
5
|
+
Licensor: EnterpriseOSS, Inc.
|
6
6
|
Licensed Work: omniauth-osso
|
7
|
-
The Licensed Work is (c) 2020
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
Change Date: 2023-05-01
|
7
|
+
The Licensed Work is (c) 2020 EnterpriseOSS, Inc.
|
8
|
+
|
9
|
+
Additional Use Grant: You and your Authorized Users may make use of the
|
10
|
+
Licensed Work for your internal business purposes,
|
11
|
+
provided that you do not (i) rent, lease, copy, transfer,
|
12
|
+
resell, sublicense, lease, time-share, or otherwise provide
|
13
|
+
access to the Licensed Work to a third party (except
|
14
|
+
Authorized Users) or (ii) incorporate the Licensed Work
|
15
|
+
(or any portion of such) with, or use it with or to provide,
|
16
|
+
any site, product, or service, other than on sites/applications
|
17
|
+
owned and operated by you.
|
18
|
+
|
19
|
+
An “Authorized User” is defined as an individual person
|
20
|
+
(e.g. your employee, contractor, agent) who is registered and
|
21
|
+
permitted by you to use the Licensed Work subject to these
|
22
|
+
restrictions.
|
23
|
+
|
24
|
+
Change Date: 2025-10-01
|
27
25
|
|
28
26
|
Change License: Apache License, Version 2.0
|
29
27
|
|
30
28
|
For information about alternative licensing arrangements for the Software,
|
31
|
-
contact: hello@
|
29
|
+
contact: hello@enterpriseoss.dev
|
32
30
|
|
33
31
|
Notice
|
34
32
|
|
@@ -108,4 +106,4 @@ other recipients of the licensed work to be provided by Licensor:
|
|
108
106
|
|
109
107
|
3. To specify a Change Date.
|
110
108
|
|
111
|
-
4. Not to modify this License in any other way.
|
109
|
+
4. Not to modify this License in any other way.
|
@@ -27,9 +27,8 @@ module OmniAuth
|
|
27
27
|
|
28
28
|
def request_params
|
29
29
|
{
|
30
|
-
redirect_uri: callback_url
|
31
|
-
|
32
|
-
}
|
30
|
+
redirect_uri: callback_url
|
31
|
+
}.merge(user_param)
|
33
32
|
end
|
34
33
|
|
35
34
|
uid { raw_info['id'] }
|
@@ -42,7 +41,8 @@ module OmniAuth
|
|
42
41
|
|
43
42
|
extra do
|
44
43
|
{
|
45
|
-
idp: raw_info['idp']
|
44
|
+
idp: raw_info['idp'],
|
45
|
+
requested: raw_info['requested']
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
@@ -82,17 +82,19 @@ module OmniAuth
|
|
82
82
|
protected
|
83
83
|
|
84
84
|
def callback_url
|
85
|
-
|
85
|
+
full_host + callback_path
|
86
86
|
end
|
87
87
|
|
88
|
-
def
|
89
|
-
return @
|
88
|
+
def user_param
|
89
|
+
return @user_param if defined?(@user_param)
|
90
90
|
|
91
|
-
|
91
|
+
params = request.params.reject { |_k, v| v.empty? }
|
92
92
|
|
93
|
-
|
93
|
+
@user_param = {}
|
94
|
+
@user_param = { domain: request.params['domain'] } if params['domain']
|
95
|
+
@user_param = { email: request.params['email'] } if params['email']
|
94
96
|
|
95
|
-
@
|
97
|
+
@user_param
|
96
98
|
end
|
97
99
|
end
|
98
100
|
end
|
data/omniauth-osso.gemspec
CHANGED
@@ -10,7 +10,8 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.homepage = 'https://github.com/enterprise-oss/omniauth-osso'
|
11
11
|
gem.license = 'BSL'
|
12
12
|
|
13
|
-
gem.add_dependency 'omniauth
|
13
|
+
gem.add_dependency 'omniauth', '< 2.0.0'
|
14
|
+
gem.add_dependency 'omniauth-oauth2', '>= 1.6', '< 1.8'
|
14
15
|
gem.add_development_dependency 'bundler', '~> 2.1'
|
15
16
|
|
16
17
|
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
@@ -19,4 +20,5 @@ Gem::Specification.new do |gem|
|
|
19
20
|
gem.name = 'omniauth-osso'
|
20
21
|
gem.require_paths = ['lib']
|
21
22
|
gem.version = OmniAuth::Osso::VERSION
|
23
|
+
gem.required_ruby_version = '~> 2.4'
|
22
24
|
end
|
@@ -57,12 +57,12 @@ describe OmniAuth::Strategies::Osso do
|
|
57
57
|
subject { fresh_strategy }
|
58
58
|
|
59
59
|
before do
|
60
|
-
|
61
|
-
ENV['OSSO_BASE_URL'] = 'https://osso-base.com'
|
60
|
+
OmniAuth.config.full_host = 'https://osso-base.com'
|
62
61
|
end
|
63
62
|
|
64
63
|
it 'includes domain passed as a request param' do
|
65
64
|
instance = subject.new('abc', 'def')
|
65
|
+
instance.env = {}
|
66
66
|
allow(instance).to receive(:request) do
|
67
67
|
double('Request', params: { 'domain' => 'example.com' }, scheme: 'https', url: url)
|
68
68
|
end
|
@@ -70,14 +70,48 @@ describe OmniAuth::Strategies::Osso do
|
|
70
70
|
expect(instance.request_params[:domain]).to eq('example.com')
|
71
71
|
end
|
72
72
|
|
73
|
-
it 'includes
|
73
|
+
it 'includes email passed as a request param' do
|
74
74
|
instance = subject.new('abc', 'def')
|
75
|
-
|
75
|
+
instance.env = {}
|
76
76
|
allow(instance).to receive(:request) do
|
77
77
|
double('Request', params: { 'email' => 'user@example.com' }, scheme: 'https', url: url)
|
78
78
|
end
|
79
79
|
|
80
|
+
expect(instance.request_params[:email]).to eq('user@example.com')
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'only includes email as a request param when both keys are provided' do
|
84
|
+
instance = subject.new('abc', 'def')
|
85
|
+
instance.env = {}
|
86
|
+
allow(instance).to receive(:request) do
|
87
|
+
double('Request', params: { 'email' => 'user@example.com', 'domain' => 'example.com' }, scheme: 'https',
|
88
|
+
url: url)
|
89
|
+
end
|
90
|
+
|
91
|
+
expect(instance.request_params[:email]).to eq('user@example.com')
|
92
|
+
expect(instance.request_params.keys).to_not include(:domain)
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'domain as a request param when email key is a blank string' do
|
96
|
+
instance = subject.new('abc', 'def')
|
97
|
+
instance.env = {}
|
98
|
+
allow(instance).to receive(:request) do
|
99
|
+
double('Request', params: { 'email' => '', 'domain' => 'example.com' }, scheme: 'https',
|
100
|
+
url: url)
|
101
|
+
end
|
102
|
+
|
80
103
|
expect(instance.request_params[:domain]).to eq('example.com')
|
104
|
+
expect(instance.request_params.keys).to_not include(:email)
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'only includes redirect_uri as a request param if neither email or domain are provided' do
|
108
|
+
instance = subject.new('abc', 'def')
|
109
|
+
instance.env = {}
|
110
|
+
allow(instance).to receive(:request) do
|
111
|
+
double('Request', params: {}, scheme: 'https', url: url)
|
112
|
+
end
|
113
|
+
|
114
|
+
expect(instance.request_params.keys).to eq([:redirect_uri])
|
81
115
|
end
|
82
116
|
end
|
83
117
|
|
@@ -96,7 +130,6 @@ describe OmniAuth::Strategies::Osso do
|
|
96
130
|
|
97
131
|
before do
|
98
132
|
OmniAuth.config.test_mode = true
|
99
|
-
ENV['OSSO_REDIRECT_URI'] = url
|
100
133
|
ENV['OSSO_BASE_URL'] = 'https://osso-base.com'
|
101
134
|
allow(instance).to receive(:auth_hash) { auth_hash }
|
102
135
|
instance.env = {}
|
@@ -131,7 +164,6 @@ describe OmniAuth::Strategies::Osso do
|
|
131
164
|
end
|
132
165
|
|
133
166
|
it 'calls fail with the client error received' do
|
134
|
-
instance = subject.new('abc', 'def')
|
135
167
|
allow(instance).to receive(:request) do
|
136
168
|
double('Request', params: { 'error_reason' => 'user_denied', 'error' => 'access_denied' })
|
137
169
|
end
|
metadata
CHANGED
@@ -1,29 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-osso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Bauch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "<"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: omniauth-oauth2
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- - "
|
31
|
+
- - ">="
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.6
|
33
|
+
version: '1.6'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '1.8'
|
20
37
|
type: :runtime
|
21
38
|
prerelease: false
|
22
39
|
version_requirements: !ruby/object:Gem::Requirement
|
23
40
|
requirements:
|
24
|
-
- - "
|
41
|
+
- - ">="
|
25
42
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.6
|
43
|
+
version: '1.6'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.8'
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: bundler
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,6 +71,8 @@ files:
|
|
51
71
|
- ".buildkite/hooks/environment"
|
52
72
|
- ".buildkite/hooks/pre-command"
|
53
73
|
- ".buildkite/pipeline.yml"
|
74
|
+
- ".github/dependabot.yml"
|
75
|
+
- ".github/workflows/automerge.yml"
|
54
76
|
- ".gitignore"
|
55
77
|
- ".rspec"
|
56
78
|
- ".rubocop.yml"
|
@@ -79,9 +101,9 @@ require_paths:
|
|
79
101
|
- lib
|
80
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
81
103
|
requirements:
|
82
|
-
- - "
|
104
|
+
- - "~>"
|
83
105
|
- !ruby/object:Gem::Version
|
84
|
-
version: '
|
106
|
+
version: '2.4'
|
85
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
108
|
requirements:
|
87
109
|
- - ">="
|