omniauth-oauth2 1.0.0.beta1 → 1.0.0.pr1
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.
Potentially problematic release.
This version of omniauth-oauth2 might be problematic. Click here for more details.
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/lib/omniauth-oauth2/version.rb +1 -1
- data/lib/omniauth/strategies/oauth2.rb +2 -12
- data/omniauth-oauth2.gemspec +1 -2
- data/spec/omniauth/strategies/oauth2_spec.rb +0 -28
- metadata +15 -26
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -19,9 +19,7 @@ module OmniAuth
|
|
19
19
|
option :client_secret, nil
|
20
20
|
option :client_options, {}
|
21
21
|
option :authorize_params, {}
|
22
|
-
option :authorize_options, [:scope]
|
23
22
|
option :token_params, {}
|
24
|
-
option :token_options, []
|
25
23
|
|
26
24
|
attr_accessor :access_token
|
27
25
|
|
@@ -40,15 +38,7 @@ module OmniAuth
|
|
40
38
|
end
|
41
39
|
|
42
40
|
def request_phase
|
43
|
-
redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(authorize_params))
|
44
|
-
end
|
45
|
-
|
46
|
-
def authorize_params
|
47
|
-
options.authorize_params.merge(options.authorize_options.inject({}){|h,k| h[k.to_sym] = options[k] if options[k]; h})
|
48
|
-
end
|
49
|
-
|
50
|
-
def token_params
|
51
|
-
options.token_params.merge(options.token_options.inject({}){|h,k| h[k.to_sym] = options[k] if options[k]; h})
|
41
|
+
redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(options.authorize_params))
|
52
42
|
end
|
53
43
|
|
54
44
|
def callback_phase
|
@@ -72,7 +62,7 @@ module OmniAuth
|
|
72
62
|
|
73
63
|
def build_access_token
|
74
64
|
verifier = request.params['code']
|
75
|
-
client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(options.token_params.to_hash(
|
65
|
+
client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(options.token_params.to_hash.inject({}){|h,(k,v)| h[k.to_sym] = v; h}))
|
76
66
|
rescue ::OAuth2::Error => e
|
77
67
|
raise e.response.inspect
|
78
68
|
end
|
data/omniauth-oauth2.gemspec
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
require File.expand_path('../lib/omniauth-oauth2/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.add_dependency '
|
6
|
-
gem.add_dependency 'omniauth', '~> 1.0.0.beta1'
|
5
|
+
gem.add_dependency 'omniauth', '~> 1.0.0.alpha'
|
7
6
|
gem.add_dependency 'oauth2', '~> 0.5.0'
|
8
7
|
|
9
8
|
gem.add_development_dependency 'rspec', '~> 2.6'
|
@@ -12,32 +12,4 @@ describe OmniAuth::Strategies::OAuth2 do
|
|
12
12
|
instance.client.options[:authorize_url].should == 'https://example.com'
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
16
|
-
describe '#authorize_params' do
|
17
|
-
subject { fresh_strategy }
|
18
|
-
|
19
|
-
it 'should include any authorize params passed in the :authorize_params option' do
|
20
|
-
instance = subject.new('abc', 'def', :authorize_params => {:foo => 'bar', :baz => 'zip'})
|
21
|
-
instance.authorize_params.should == {'foo' => 'bar', 'baz' => 'zip'}
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should include top-level options that are marked as :authorize_options' do
|
25
|
-
instance = subject.new('abc', 'def', :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz')
|
26
|
-
instance.authorize_params.should == {'scope' => 'bar', 'foo' => 'baz'}
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe '#token_params' do
|
31
|
-
subject { fresh_strategy }
|
32
|
-
|
33
|
-
it 'should include any authorize params passed in the :authorize_params option' do
|
34
|
-
instance = subject.new('abc', 'def', :token_params => {:foo => 'bar', :baz => 'zip'})
|
35
|
-
instance.token_params.should == {'foo' => 'bar', 'baz' => 'zip'}
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should include top-level options that are marked as :authorize_options' do
|
39
|
-
instance = subject.new('abc', 'def', :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz')
|
40
|
-
instance.token_params.should == {'scope' => 'bar', 'foo' => 'baz'}
|
41
|
-
end
|
42
|
-
end
|
43
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pr1
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,33 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-13 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: hashie
|
16
|
-
requirement: &70318691424740 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '1.2'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70318691424740
|
25
14
|
- !ruby/object:Gem::Dependency
|
26
15
|
name: omniauth
|
27
|
-
requirement: &
|
16
|
+
requirement: &70197584085140 !ruby/object:Gem::Requirement
|
28
17
|
none: false
|
29
18
|
requirements:
|
30
19
|
- - ~>
|
31
20
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.0.
|
21
|
+
version: 1.0.0.alpha
|
33
22
|
type: :runtime
|
34
23
|
prerelease: false
|
35
|
-
version_requirements: *
|
24
|
+
version_requirements: *70197584085140
|
36
25
|
- !ruby/object:Gem::Dependency
|
37
26
|
name: oauth2
|
38
|
-
requirement: &
|
27
|
+
requirement: &70197584084640 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
29
|
requirements:
|
41
30
|
- - ~>
|
@@ -43,10 +32,10 @@ dependencies:
|
|
43
32
|
version: 0.5.0
|
44
33
|
type: :runtime
|
45
34
|
prerelease: false
|
46
|
-
version_requirements: *
|
35
|
+
version_requirements: *70197584084640
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: rspec
|
49
|
-
requirement: &
|
38
|
+
requirement: &70197584113860 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
40
|
requirements:
|
52
41
|
- - ~>
|
@@ -54,10 +43,10 @@ dependencies:
|
|
54
43
|
version: '2.6'
|
55
44
|
type: :development
|
56
45
|
prerelease: false
|
57
|
-
version_requirements: *
|
46
|
+
version_requirements: *70197584113860
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: rack-test
|
60
|
-
requirement: &
|
49
|
+
requirement: &70197584113480 !ruby/object:Gem::Requirement
|
61
50
|
none: false
|
62
51
|
requirements:
|
63
52
|
- - ! '>='
|
@@ -65,10 +54,10 @@ dependencies:
|
|
65
54
|
version: '0'
|
66
55
|
type: :development
|
67
56
|
prerelease: false
|
68
|
-
version_requirements: *
|
57
|
+
version_requirements: *70197584113480
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
59
|
name: webmock
|
71
|
-
requirement: &
|
60
|
+
requirement: &70197584113020 !ruby/object:Gem::Requirement
|
72
61
|
none: false
|
73
62
|
requirements:
|
74
63
|
- - ! '>='
|
@@ -76,10 +65,10 @@ dependencies:
|
|
76
65
|
version: '0'
|
77
66
|
type: :development
|
78
67
|
prerelease: false
|
79
|
-
version_requirements: *
|
68
|
+
version_requirements: *70197584113020
|
80
69
|
- !ruby/object:Gem::Dependency
|
81
70
|
name: simplecov
|
82
|
-
requirement: &
|
71
|
+
requirement: &70197584112600 !ruby/object:Gem::Requirement
|
83
72
|
none: false
|
84
73
|
requirements:
|
85
74
|
- - ! '>='
|
@@ -87,7 +76,7 @@ dependencies:
|
|
87
76
|
version: '0'
|
88
77
|
type: :development
|
89
78
|
prerelease: false
|
90
|
-
version_requirements: *
|
79
|
+
version_requirements: *70197584112600
|
91
80
|
description: An abstract OAuth2 strategy for OmniAuth.
|
92
81
|
email:
|
93
82
|
- michael@intridea.com
|