omniauth-oauth2 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth-oauth2 might be problematic. Click here for more details.

data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # OmniAuth OAuth2
2
2
 
3
- **Note:** This gem is designed to work with the unreleased OmniAuth 1.0
4
- library. It will not be officially released on RubyGems.org until
5
- OmniAuth 1.0 is released.
6
-
7
3
  This gem contains a generic OAuth2 strategy for OmniAuth. It is meant to
8
4
  serve as a building block strategy for other strategies and not to be
9
5
  used independently (since it has no inherent way to gather uid and user
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module OAuth2
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ module OmniAuth
27
27
  attr_accessor :access_token
28
28
 
29
29
  def client
30
- ::OAuth2::Client.new(options.client_id, options.client_secret, options.client_options.inject({}){|h,(k,v)| h[k.to_sym] = v; h})
30
+ ::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(options.client_options))
31
31
  end
32
32
 
33
33
  def callback_url
@@ -75,6 +75,13 @@ module OmniAuth
75
75
 
76
76
  protected
77
77
 
78
+ def deep_symbolize(hash)
79
+ hash.inject({}) do |h, (k,v)|
80
+ h[k.to_sym] = v.is_a?(Hash) ? deep_symbolize(v) : v
81
+ h
82
+ end
83
+ end
84
+
78
85
  def build_access_token
79
86
  verifier = request.params['code']
80
87
  client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)))
@@ -11,6 +11,11 @@ describe OmniAuth::Strategies::OAuth2 do
11
11
  instance = subject.new(app, :client_options => {'authorize_url' => 'https://example.com'})
12
12
  instance.client.options[:authorize_url].should == 'https://example.com'
13
13
  end
14
+
15
+ it 'should set ssl options as connection options' do
16
+ instance = subject.new(app, :client_options => {'ssl' => {'ca_path' => 'foo'}})
17
+ instance.client.options[:connection_opts][:ssl] =~ {:ca_path => 'foo'}
18
+ end
14
19
  end
15
20
 
16
21
  describe '#authorize_params' do
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.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-13 00:00:00.000000000 Z
12
+ date: 2012-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &70168923789820 !ruby/object:Gem::Requirement
16
+ requirement: &70318242100740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70168923789820
24
+ version_requirements: *70318242100740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth2
27
- requirement: &70168923788900 !ruby/object:Gem::Requirement
27
+ requirement: &70318242100280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.6.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70168923788900
35
+ version_requirements: *70318242100280
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70168923786760 !ruby/object:Gem::Requirement
38
+ requirement: &70318242099820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.7'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70168923786760
46
+ version_requirements: *70318242099820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rack-test
49
- requirement: &70168923785800 !ruby/object:Gem::Requirement
49
+ requirement: &70318242099440 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70168923785800
57
+ version_requirements: *70318242099440
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: webmock
60
- requirement: &70168923763660 !ruby/object:Gem::Requirement
60
+ requirement: &70318242098980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70168923763660
68
+ version_requirements: *70318242098980
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &70168923762320 !ruby/object:Gem::Requirement
71
+ requirement: &70318242098560 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70168923762320
79
+ version_requirements: *70318242098560
80
80
  description: An abstract OAuth2 strategy for OmniAuth.
81
81
  email:
82
82
  - michael@intridea.com