oa-core 0.2.6 → 0.3.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,10 +55,14 @@ module OmniAuth
55
55
 
56
56
  def add_mock(provider, mock={})
57
57
  # Stringify keys recursively one level.
58
- mock.stringify_keys!
59
- mock.keys.each do|key|
60
- if mock[key].is_a? Hash
61
- mock[key].stringify_keys!
58
+ mock.keys.each do |key|
59
+ mock[key.to_s] = mock.delete(key)
60
+ end
61
+ mock.each_pair do |key, val|
62
+ if val.is_a? Hash
63
+ val.keys.each do |subkey|
64
+ val[subkey.to_s] = val.delete(subkey)
65
+ end
62
66
  end
63
67
  end
64
68
 
@@ -98,7 +102,8 @@ module OmniAuth
98
102
  'smugmug' => 'SmugMug',
99
103
  'cas' => 'CAS',
100
104
  'trademe' => 'TradeMe',
101
- 'ldap' => 'LDAP'
105
+ 'ldap' => 'LDAP',
106
+ 'google_oauth2' => 'GoogleOAuth2'
102
107
  }
103
108
 
104
109
  module_function
@@ -95,7 +95,7 @@ module OmniAuth
95
95
  elsif env['HTTP_REFERER'] && !env['HTTP_REFERER'].match(/#{request_path}$/)
96
96
  @env['rack.session']['omniauth.origin'] = env['HTTP_REFERER']
97
97
  end
98
- redirect(script_name + callback_path)
98
+ redirect(script_name + callback_path + query_string)
99
99
  end
100
100
 
101
101
  def mock_callback_call
@@ -126,6 +126,8 @@ module OmniAuth
126
126
 
127
127
  def callback_phase
128
128
  @env['omniauth.auth'] = auth_hash
129
+ @env['omniauth.params'] = session['query_params'] || {}
130
+ session['query_params'] = nil if session['query_params']
129
131
  call_app!
130
132
  end
131
133
 
@@ -155,6 +157,7 @@ module OmniAuth
155
157
 
156
158
  def call_through_to_app
157
159
  status, headers, body = *call_app!
160
+ session['query_params'] = Rack::Request.new(env).params
158
161
  @response = Rack::Response.new(body, status, headers)
159
162
 
160
163
  status == 404 ? nil : @response.finish
@@ -4,13 +4,13 @@ module OmniAuth
4
4
  MAJOR = 0
5
5
  end
6
6
  unless defined?(::OmniAuth::Version::MINOR)
7
- MINOR = 2
7
+ MINOR = 3
8
8
  end
9
9
  unless defined?(::OmniAuth::Version::PATCH)
10
- PATCH = 6
10
+ PATCH = 0
11
11
  end
12
12
  unless defined?(::OmniAuth::Version::PRE)
13
- PRE = nil
13
+ PRE = "rc3"
14
14
  end
15
15
  unless defined?(::OmniAuth::Version::STRING)
16
16
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
@@ -1,24 +1,22 @@
1
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
2
2
  require File.expand_path('../lib/omniauth/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.add_development_dependency 'maruku', '~> 0.6'
6
- gem.add_development_dependency 'simplecov', '~> 0.4'
7
5
  gem.add_development_dependency 'rack-test', '~> 0.5'
8
6
  gem.add_development_dependency 'rake', '~> 0.8'
7
+ gem.add_development_dependency 'rdiscount', '~> 1.6'
9
8
  gem.add_development_dependency 'rspec', '~> 2.5'
9
+ gem.add_development_dependency 'simplecov', '~> 0.4'
10
10
  gem.add_development_dependency 'yard', '~> 0.7'
11
- gem.add_development_dependency 'ZenTest', '~> 4.5'
12
- gem.name = 'oa-core'
13
- gem.version = OmniAuth::Version::STRING
11
+ gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
14
12
  gem.description = %q{Core strategies for OmniAuth.}
15
- gem.summary = gem.description
16
13
  gem.email = ['michael@intridea.com', 'sferik@gmail.com']
17
- gem.homepage = 'http://github.com/intridea/omniauth'
18
- gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
19
- gem.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
20
14
  gem.files = `git ls-files`.split("\n")
21
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ gem.homepage = 'http://github.com/intridea/omniauth'
16
+ gem.name = 'oa-core'
22
17
  gem.require_paths = ['lib']
23
18
  gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
19
+ gem.summary = gem.description
20
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ gem.version = OmniAuth::Version::STRING
24
22
  end
@@ -267,6 +267,11 @@ describe OmniAuth::Strategy do
267
267
  strategy.call(make_env('/AUTH/TeSt/CaLlBAck')).should == strategy.call(make_env('/auth/test/callback'))
268
268
  end
269
269
 
270
+ it 'should maintain query string parameters' do
271
+ response = strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'cheese=stilton'))
272
+ response[1]['Location'].should == '/auth/test/callback?cheese=stilton'
273
+ end
274
+
270
275
  it 'should not short circuit requests outside of authentication' do
271
276
  strategy.call(make_env('/')).should == app.call(make_env('/'))
272
277
  end
metadata CHANGED
@@ -1,8 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oa-core
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.6
4
+ hash: 15424035
5
+ prerelease: 6
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 0
10
+ - rc
11
+ - 3
12
+ version: 0.3.0.rc3
6
13
  platform: ruby
7
14
  authors:
8
15
  - Michael Bleigh
@@ -11,61 +18,81 @@ autorequire:
11
18
  bindir: bin
12
19
  cert_chain: []
13
20
 
14
- date: 2011-05-20 00:00:00 Z
21
+ date: 2011-09-03 00:00:00 Z
15
22
  dependencies:
16
23
  - !ruby/object:Gem::Dependency
17
- name: maruku
24
+ name: rack-test
18
25
  prerelease: false
19
26
  requirement: &id001 !ruby/object:Gem::Requirement
20
27
  none: false
21
28
  requirements:
22
29
  - - ~>
23
30
  - !ruby/object:Gem::Version
24
- version: "0.6"
31
+ hash: 1
32
+ segments:
33
+ - 0
34
+ - 5
35
+ version: "0.5"
25
36
  type: :development
26
37
  version_requirements: *id001
27
38
  - !ruby/object:Gem::Dependency
28
- name: simplecov
39
+ name: rake
29
40
  prerelease: false
30
41
  requirement: &id002 !ruby/object:Gem::Requirement
31
42
  none: false
32
43
  requirements:
33
44
  - - ~>
34
45
  - !ruby/object:Gem::Version
35
- version: "0.4"
46
+ hash: 27
47
+ segments:
48
+ - 0
49
+ - 8
50
+ version: "0.8"
36
51
  type: :development
37
52
  version_requirements: *id002
38
53
  - !ruby/object:Gem::Dependency
39
- name: rack-test
54
+ name: rdiscount
40
55
  prerelease: false
41
56
  requirement: &id003 !ruby/object:Gem::Requirement
42
57
  none: false
43
58
  requirements:
44
59
  - - ~>
45
60
  - !ruby/object:Gem::Version
46
- version: "0.5"
61
+ hash: 3
62
+ segments:
63
+ - 1
64
+ - 6
65
+ version: "1.6"
47
66
  type: :development
48
67
  version_requirements: *id003
49
68
  - !ruby/object:Gem::Dependency
50
- name: rake
69
+ name: rspec
51
70
  prerelease: false
52
71
  requirement: &id004 !ruby/object:Gem::Requirement
53
72
  none: false
54
73
  requirements:
55
74
  - - ~>
56
75
  - !ruby/object:Gem::Version
57
- version: "0.8"
76
+ hash: 9
77
+ segments:
78
+ - 2
79
+ - 5
80
+ version: "2.5"
58
81
  type: :development
59
82
  version_requirements: *id004
60
83
  - !ruby/object:Gem::Dependency
61
- name: rspec
84
+ name: simplecov
62
85
  prerelease: false
63
86
  requirement: &id005 !ruby/object:Gem::Requirement
64
87
  none: false
65
88
  requirements:
66
89
  - - ~>
67
90
  - !ruby/object:Gem::Version
68
- version: "2.5"
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ - 4
95
+ version: "0.4"
69
96
  type: :development
70
97
  version_requirements: *id005
71
98
  - !ruby/object:Gem::Dependency
@@ -76,20 +103,13 @@ dependencies:
76
103
  requirements:
77
104
  - - ~>
78
105
  - !ruby/object:Gem::Version
106
+ hash: 5
107
+ segments:
108
+ - 0
109
+ - 7
79
110
  version: "0.7"
80
111
  type: :development
81
112
  version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: ZenTest
84
- prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
86
- none: false
87
- requirements:
88
- - - ~>
89
- - !ruby/object:Gem::Version
90
- version: "4.5"
91
- type: :development
92
- version_requirements: *id007
93
113
  description: Core strategies for OmniAuth.
94
114
  email:
95
115
  - michael@intridea.com
@@ -136,17 +156,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
156
  requirements:
137
157
  - - ">="
138
158
  - !ruby/object:Gem::Version
159
+ hash: 3
160
+ segments:
161
+ - 0
139
162
  version: "0"
140
163
  required_rubygems_version: !ruby/object:Gem::Requirement
141
164
  none: false
142
165
  requirements:
143
- - - ">="
166
+ - - ">"
144
167
  - !ruby/object:Gem::Version
145
- version: 1.3.6
168
+ hash: 25
169
+ segments:
170
+ - 1
171
+ - 3
172
+ - 1
173
+ version: 1.3.1
146
174
  requirements: []
147
175
 
148
176
  rubyforge_project:
149
- rubygems_version: 1.8.2
177
+ rubygems_version: 1.8.10
150
178
  signing_key:
151
179
  specification_version: 3
152
180
  summary: Core strategies for OmniAuth.