rack-oauth2_utils 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ module Rack
22
22
  end
23
23
 
24
24
  def authorization_param
25
- @authorization_param ||= self.GET['access_token']
25
+ @authorization_param ||= (self.GET['access_token'] || self.GET['bearer_token'])
26
26
  end
27
27
 
28
28
  # True if authentication scheme is OAuth.
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module OAuth2Utils
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -137,5 +137,17 @@ describe Rack::OAuth2Utils::Middleware do
137
137
  last_response.body.must_equal 'Hello world'
138
138
  end
139
139
  end
140
+
141
+ describe 'with alternative valid token as query param named "bearer_token"' do
142
+ before {get '/private', 'access_token' => 'aaaaa'}
143
+
144
+ it 'should return 200 Ok' do
145
+ last_response.status.must_equal 200
146
+ end
147
+
148
+ it 'should return body' do
149
+ last_response.body.must_equal 'Hello world'
150
+ end
151
+ end
140
152
 
141
153
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-oauth2_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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: 2011-12-03 00:00:00.000000000Z
12
+ date: 2011-12-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &2152747200 !ruby/object:Gem::Requirement
16
+ requirement: &2152549680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152747200
24
+ version_requirements: *2152549680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &2152738640 !ruby/object:Gem::Requirement
27
+ requirement: &2152549020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2152738640
35
+ version_requirements: *2152549020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: minitest
38
- requirement: &2152737980 !ruby/object:Gem::Requirement
38
+ requirement: &2152548460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2152737980
46
+ version_requirements: *2152548460
47
47
  description: Simple Rack middleware that catches OAuth2 access tokens and validates
48
48
  identity
49
49
  email: