omniauth-osso 0.1.8 → 0.1.9

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: 56e18431f00e10031a36b55c2ebc0fbb472b27fb98cc794bd0925a80bd6a85f4
4
- data.tar.gz: 9cf0b3999072a6cceb1ff764cb3c55d5f0c16d0dd122f24c1b8fee6c92eb29d6
3
+ metadata.gz: '060189c38f08e460d75fea568f52d1d91790e2be8e096e85ad40eb82e16ffbc9'
4
+ data.tar.gz: 3f40dd45f8ee43d1c5278e84d7fab10147f9281f8dd451b660184b96ace3b928
5
5
  SHA512:
6
- metadata.gz: 26ac30a6016727d1a97bcd3c2b6a49911da1b044487fb626b111586552e9ccf4cd8dd30b2866e3c4bc84ceb7218fb6200a745ffcc4e34ad906105029a24f16a6
7
- data.tar.gz: 92dc68770cc6445875a73375b02f5bc56704630ba735635d97b686476cdf80ad1cbb87a77cbcb030b4cb5c1a8e65a7b0bdc854de6bb3723b3c3fd2decd44d7aa
6
+ metadata.gz: 8b343a5cf6b1220f4bd10435790c862167e741cba2b2e8d798f137b2e4142628be1e06437fc76153ef298c817317e840befcc005090632e375cfbfd3e8431768
7
+ data.tar.gz: 6cbf6d78ac3229480f880c5082c781600fe5a42cd0cbd14aa34523d3b0997790310207a245b4d0acac1a4b900a0674b22fc5b7fb3ad352d9cf9e1c1720a62c56
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-osso (0.1.8.pre)
5
- omniauth (~> 2.0.1)
4
+ omniauth-osso (0.2.0)
5
+ omniauth (< 2.0.0)
6
6
  omniauth-oauth2 (>= 1.6, < 1.8)
7
7
 
8
8
  GEM
@@ -33,10 +33,9 @@ GEM
33
33
  multi_json (~> 1.3)
34
34
  multi_xml (~> 0.5)
35
35
  rack (>= 1.2, < 3)
36
- omniauth (2.0.1)
36
+ omniauth (1.9.1)
37
37
  hashie (>= 3.4.6)
38
38
  rack (>= 1.6.2, < 3)
39
- rack-protection
40
39
  omniauth-oauth2 (1.7.1)
41
40
  oauth2 (~> 1.4)
42
41
  omniauth (>= 1.9, < 3)
@@ -48,8 +47,6 @@ GEM
48
47
  method_source (~> 1.0)
49
48
  public_suffix (4.0.6)
50
49
  rack (2.2.3)
51
- rack-protection (2.1.0)
52
- rack
53
50
  rack-test (1.1.0)
54
51
  rack (>= 1.0, < 3)
55
52
  rainbow (3.0.0)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Osso
5
- VERSION = '0.1.8'
5
+ VERSION = '0.1.9'
6
6
  end
7
7
  end
@@ -88,10 +88,13 @@ module OmniAuth
88
88
  def user_param
89
89
  return @user_param if defined?(@user_param)
90
90
 
91
- @user_param = {
92
- domain: request.params['domain'],
93
- email: request.params['email']
94
- }.compact
91
+ params = request.params.reject { |_k, v| v.empty? }
92
+
93
+ @user_param = {}
94
+ @user_param = { domain: request.params['domain'] } if params['domain']
95
+ @user_param = { email: request.params['email'] } if params['email']
96
+
97
+ @user_param
95
98
  end
96
99
  end
97
100
  end
@@ -10,7 +10,7 @@ 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', '~> 2.0.1'
13
+ gem.add_dependency 'omniauth', '< 2.0.0'
14
14
  gem.add_dependency 'omniauth-oauth2', '>= 1.6', '< 1.8'
15
15
  gem.add_development_dependency 'bundler', '~> 2.1'
16
16
 
@@ -70,13 +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 email when an email address is passed as an authorize option' do
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
+
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
+
79
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
+
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])
80
115
  end
81
116
  end
82
117
 
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-osso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
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: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.1
19
+ version: 2.0.0
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: 2.0.1
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement