grape-tokeeo 0.0.1 → 0.0.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: f5fcfd1763b17a097bd9e0a671cf52250a353e9a
4
- data.tar.gz: c2f064374c1c0d8305a931afcd98e3817a18fe2f
3
+ metadata.gz: 73a938d4c5e8df95dea6c749924342fe12cb3575
4
+ data.tar.gz: 7ee68e55a44683a681eaa30cf06a175bcea133f9
5
5
  SHA512:
6
- metadata.gz: bfaa25be554550e1b95b72e4543429448cd9e5e1b0d1fe09dbf34ccea04d68e59fdd0c2265d3af058db1ab7ec48fe62ba6562d5f23daaca6cc07686bb828b6e3
7
- data.tar.gz: c0ac60c5852715d72194de623a60ba1acc8e11a527750de1db4774b99cafa27d31dcef0df02e873e299ee090ef15b3840650de39013c14cc6fbc7b8b16f6a38f
6
+ metadata.gz: 288a681d0afc9626b134527f60070df7e572e963770cb9e494d2aafa1eac087f14daf576657477aafc1490455ae14910e0ba5ac36194e8ab53ec0070334d8df2
7
+ data.tar.gz: f14c5a28246c5b9871cbe81ea9f514e6ca1784248f5751d504834d711352a50c567980e2588c8db3d50b5df5d31452a41fadeaffc5750dc98d2c901a43bd097e
@@ -34,10 +34,15 @@ module Grape
34
34
  header_to_use ||= DEFAULT_HEADER
35
35
  end
36
36
 
37
+ def header_for( key )
38
+ token = request.headers[header]
39
+ token ||= request.env[header]
40
+ end
41
+
37
42
  def build_preshared_token_security(options, api_instance)
38
43
  api_instance.before do
39
- header = Grape::Tokeeo.header_to_verify(options)
40
- token = env[header]
44
+ header_key = Grape::Tokeeo.header_to_verify(options)
45
+ token = header_for header_key
41
46
  preshared_token = options[:is]
42
47
 
43
48
  error!(DEFAULT_MISSING_MESSAGE, 401) unless token.present?
@@ -1,5 +1,5 @@
1
1
  module Grape
2
2
  module Tokeeo
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-tokeeo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Pagano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2015-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler