g5_authenticatable_api 0.3.1 → 0.3.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12624771940d7daf4727fa08cf7befcc04883458
|
4
|
+
data.tar.gz: d247b5ed06aa6e2b82c6c99b48916edc0e2962fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f8d08300206e3a3eacbff455df57cbf336199695887fb32fffee241c2856f0b81bd572f412e71fb0c96ec32fe3194df2b8f9c5f09ff6e85e8fc283bd15ee1e0
|
7
|
+
data.tar.gz: 08d6b7e24da4e71f447c26925265fd60efd8e3efec9145028a78a35989d5a7fe6db7e57909502c8a442a72266989cf8b3ad52c3c162211c9bf505c629b145852
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.5
|
@@ -61,8 +61,8 @@ module G5AuthenticatableApi
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def extract_token_from_header
|
64
|
-
if
|
65
|
-
parts =
|
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
|
@@ -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.
|
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-
|
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:
|