omniauth-osso 0.1.4 → 0.1.8
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 +51 -41
- data/LICENSE +21 -23
- data/lib/omniauth-osso/version.rb +1 -1
- data/lib/omniauth/strategies/osso.rb +12 -13
- data/omniauth-osso.gemspec +3 -1
- data/spec/omniauth/strategies/osso_spec.rb +5 -8
- metadata +29 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56e18431f00e10031a36b55c2ebc0fbb472b27fb98cc794bd0925a80bd6a85f4
|
4
|
+
data.tar.gz: 9cf0b3999072a6cceb1ff764cb3c55d5f0c16d0dd122f24c1b8fee6c92eb29d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26ac30a6016727d1a97bcd3c2b6a49911da1b044487fb626b111586552e9ccf4cd8dd30b2866e3c4bc84ceb7218fb6200a745ffcc4e34ad906105029a24f16a6
|
7
|
+
data.tar.gz: 92dc68770cc6445875a73375b02f5bc56704630ba735635d97b686476cdf80ad1cbb87a77cbcb030b4cb5c1a8e65a7b0bdc854de6bb3723b3c3fd2decd44d7aa
|
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.1.
|
5
|
-
omniauth
|
4
|
+
omniauth-osso (0.1.8.pre)
|
5
|
+
omniauth (~> 2.0.1)
|
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)
|
@@ -30,49 +33,56 @@ GEM
|
|
30
33
|
multi_json (~> 1.3)
|
31
34
|
multi_xml (~> 0.5)
|
32
35
|
rack (>= 1.2, < 3)
|
33
|
-
omniauth (
|
36
|
+
omniauth (2.0.1)
|
34
37
|
hashie (>= 3.4.6)
|
35
38
|
rack (>= 1.6.2, < 3)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
rack-protection
|
40
|
+
omniauth-oauth2 (1.7.1)
|
41
|
+
oauth2 (~> 1.4)
|
42
|
+
omniauth (>= 1.9, < 3)
|
43
|
+
parallel (1.20.1)
|
44
|
+
parser (3.0.0.0)
|
45
|
+
ast (~> 2.4.1)
|
46
|
+
pry (0.13.1)
|
43
47
|
coderay (~> 1.1)
|
44
48
|
method_source (~> 1.0)
|
45
|
-
public_suffix (4.0.
|
46
|
-
rack (2.2.
|
49
|
+
public_suffix (4.0.6)
|
50
|
+
rack (2.2.3)
|
51
|
+
rack-protection (2.1.0)
|
52
|
+
rack
|
47
53
|
rack-test (1.1.0)
|
48
54
|
rack (>= 1.0, < 3)
|
49
55
|
rainbow (3.0.0)
|
56
|
+
regexp_parser (2.0.3)
|
50
57
|
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.
|
58
|
+
rspec (3.10.0)
|
59
|
+
rspec-core (~> 3.10.0)
|
60
|
+
rspec-expectations (~> 3.10.0)
|
61
|
+
rspec-mocks (~> 3.10.0)
|
62
|
+
rspec-core (3.10.1)
|
63
|
+
rspec-support (~> 3.10.0)
|
64
|
+
rspec-expectations (3.10.1)
|
58
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-mocks (3.
|
66
|
+
rspec-support (~> 3.10.0)
|
67
|
+
rspec-mocks (3.10.1)
|
61
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-support (3.
|
64
|
-
rubocop (
|
65
|
-
jaro_winkler (~> 1.5.1)
|
69
|
+
rspec-support (~> 3.10.0)
|
70
|
+
rspec-support (3.10.1)
|
71
|
+
rubocop (1.8.1)
|
66
72
|
parallel (~> 1.10)
|
67
|
-
parser (>=
|
73
|
+
parser (>= 3.0.0.0)
|
68
74
|
rainbow (>= 2.2.2, < 4.0)
|
75
|
+
regexp_parser (>= 1.8, < 3.0)
|
69
76
|
rexml
|
77
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
70
78
|
ruby-progressbar (~> 1.7)
|
71
|
-
unicode-display_width (>= 1.4.0, <
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
79
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
80
|
+
rubocop-ast (1.4.1)
|
81
|
+
parser (>= 2.7.1.5)
|
82
|
+
ruby-progressbar (1.11.0)
|
83
|
+
ruby2_keywords (0.0.4)
|
84
|
+
unicode-display_width (2.0.0)
|
85
|
+
webmock (3.11.1)
|
76
86
|
addressable (>= 2.3.6)
|
77
87
|
crack (>= 0.3.2)
|
78
88
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -85,9 +95,9 @@ DEPENDENCIES
|
|
85
95
|
omniauth-osso!
|
86
96
|
pry
|
87
97
|
rack-test
|
88
|
-
rspec (~> 3.
|
98
|
+
rspec (~> 3.10)
|
89
99
|
rubocop
|
90
|
-
webmock (~> 3.
|
100
|
+
webmock (~> 3.11)
|
91
101
|
|
92
102
|
BUNDLED WITH
|
93
103
|
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.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'omniauth-oauth2'
|
4
|
-
|
4
|
+
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
7
|
# The main source for the Osso Omniauth Strategy
|
@@ -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,16 @@ 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 @
|
90
|
-
|
91
|
-
@request_domain = request.params['domain'] || request.params['email'].split('@')[1]
|
92
|
-
|
93
|
-
raise StandardError if @request_domain.nil?
|
88
|
+
def user_param
|
89
|
+
return @user_param if defined?(@user_param)
|
94
90
|
|
95
|
-
@
|
91
|
+
@user_param = {
|
92
|
+
domain: request.params['domain'],
|
93
|
+
email: request.params['email']
|
94
|
+
}.compact
|
96
95
|
end
|
97
96
|
end
|
98
97
|
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.1'
|
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,13 @@ 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 when an email address is passed as an authorize option' 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
|
-
|
80
|
-
expect(instance.request_params[:domain]).to eq('example.com')
|
79
|
+
expect(instance.request_params[:email]).to eq('user@example.com')
|
81
80
|
end
|
82
81
|
end
|
83
82
|
|
@@ -96,7 +95,6 @@ describe OmniAuth::Strategies::Osso do
|
|
96
95
|
|
97
96
|
before do
|
98
97
|
OmniAuth.config.test_mode = true
|
99
|
-
ENV['OSSO_REDIRECT_URI'] = url
|
100
98
|
ENV['OSSO_BASE_URL'] = 'https://osso-base.com'
|
101
99
|
allow(instance).to receive(:auth_hash) { auth_hash }
|
102
100
|
instance.env = {}
|
@@ -131,7 +129,6 @@ describe OmniAuth::Strategies::Osso do
|
|
131
129
|
end
|
132
130
|
|
133
131
|
it 'calls fail with the client error received' do
|
134
|
-
instance = subject.new('abc', 'def')
|
135
132
|
allow(instance).to receive(:request) do
|
136
133
|
double('Request', params: { 'error_reason' => 'user_denied', 'error' => 'access_denied' })
|
137
134
|
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.8
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: omniauth
|
14
|
+
name: omniauth
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: omniauth-oauth2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '1.8'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
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
|
- - ">="
|