g5_authenticatable_api 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 3fab392aec338c014086e508dfc7f257d848f0aa
4
- data.tar.gz: 9a034d766e6f79ba7eb9c0e66df420c4665e9d8d
3
+ metadata.gz: 12624771940d7daf4727fa08cf7befcc04883458
4
+ data.tar.gz: d247b5ed06aa6e2b82c6c99b48916edc0e2962fc
5
5
  SHA512:
6
- metadata.gz: f1b27503517f7a269af86515e56e8c0185572d62b9db6802c75a6248a4e9d29448ccc46fd4bb88f1539c7613bb40acb822d9a60a4cb99948bac36b83fcaae13f
7
- data.tar.gz: bdf990ae909d110075ff2ef0ab52ad6a4c2024a42f62501498fd86712293599892c15f5417baa7b62cfd803a19462b59cd27c0e353d314e0e9619670d3c1aa14
6
+ metadata.gz: 2f8d08300206e3a3eacbff455df57cbf336199695887fb32fffee241c2856f0b81bd572f412e71fb0c96ec32fe3194df2b8f9c5f09ff6e85e8fc283bd15ee1e0
7
+ data.tar.gz: 08d6b7e24da4e71f447c26925265fd60efd8e3efec9145028a78a35989d5a7fe6db7e57909502c8a442a72266989cf8b3ad52c3c162211c9bf505c629b145852
@@ -1 +1 @@
1
- 2.1.2
1
+ 2.1.5
@@ -61,8 +61,8 @@ module G5AuthenticatableApi
61
61
  end
62
62
 
63
63
  def extract_token_from_header
64
- if @headers['Authorization']
65
- parts = @headers['Authorization'].match(/Bearer (?<access_token>\S+)/)
64
+ if authorization_header
65
+ parts = authorization_header.match(/Bearer (?<access_token>\S+)/)
66
66
  parts['access_token']
67
67
  end
68
68
  end
@@ -70,5 +70,9 @@ module G5AuthenticatableApi
70
70
  def skip_validation?
71
71
  @warden.try(:user) && !G5AuthenticatableApi.strict_token_validation
72
72
  end
73
+
74
+ def authorization_header
75
+ @headers['Authorization'] || @headers['AUTHORIZATION']
76
+ end
73
77
  end
74
78
  end
@@ -1,3 +1,3 @@
1
1
  module G5AuthenticatableApi
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -22,6 +22,15 @@ describe G5AuthenticatableApi::TokenValidator do
22
22
  end
23
23
  end
24
24
 
25
+ context 'with all caps authorization key' do
26
+ let(:headers) { {'AUTHORIZATION' => "Bearer #{token_value}"} }
27
+ let(:params) {}
28
+
29
+ it 'should extract the token value from the header' do
30
+ expect(access_token).to eq(token_value)
31
+ end
32
+ end
33
+
25
34
  context 'with auth param' do
26
35
  let(:params) { {'access_token' => token_value} }
27
36
  let(:headers) {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_authenticatable_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maeve Revels
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -238,4 +238,3 @@ test_files:
238
238
  - spec/support/shared_examples/token_validation.rb
239
239
  - spec/support/shared_examples/warden_authenticatable_api.rb
240
240
  - spec/support/warden.rb
241
- has_rdoc: