arcadex 1.2.1 → 1.2.3
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 +4 -4
- data/lib/arcadex/authentication.rb +3 -3
- data/lib/arcadex/header.rb +4 -1
- data/lib/arcadex/version.rb +1 -1
- data/test/test_app/Gemfile.lock +1 -1
- data/test/test_app/app/controllers/api/v1/api_controller.rb +1 -1
- data/test/test_app/log/test.log +1264 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 131b7e365740221eec23b5de5f450fac54b4ffe9
|
4
|
+
data.tar.gz: eb091d93fe323bdba94ba31768e9baad2558c0a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 544f23519b59276329521da64283b4649f94dff195a778e1a5e8a01d4946bdf85b516c6ada6380b9f56918149f65c443b4a7536f47b0dac9a4dc84d409f5b239
|
7
|
+
data.tar.gz: 9fa1f03f48764aceac6bd93e97a798cf95b09a91a53bccb3dd59145da8ad87fff5cae38c015acba893c7bc9423c88bf20550c0d273a3b14e8abfa629ff588b24
|
@@ -3,9 +3,9 @@ module Arcadex
|
|
3
3
|
|
4
4
|
################Below are authentication methods###########################
|
5
5
|
############This should be called by the user##############################
|
6
|
-
def self.authenticate_owner_with_index(params,request,auth_key,index_key,index_attr)
|
6
|
+
def self.authenticate_owner_with_index(params,request,auth_key,index_key,index_attr,downcase)
|
7
7
|
instance_hash = ::Arcadex::Authentication.get_instance(params,request,auth_key)
|
8
|
-
index = ::Arcadex::Header.grab_param_header(params,request,index_key)
|
8
|
+
index = ::Arcadex::Header.grab_param_header(params,request,index_key,downcase)
|
9
9
|
if instance_hash.nil? || index.nil?
|
10
10
|
return nil
|
11
11
|
end
|
@@ -23,7 +23,7 @@ module Arcadex
|
|
23
23
|
|
24
24
|
#Returns the object that is mapped to the key. The key is in the params or heaaders
|
25
25
|
def self.get_instance(params,request,key)
|
26
|
-
auth_token = ::Arcadex::Header.grab_param_header(params,request,key)
|
26
|
+
auth_token = ::Arcadex::Header.grab_param_header(params,request,key,false)
|
27
27
|
if auth_token.nil?
|
28
28
|
return nil
|
29
29
|
end
|
data/lib/arcadex/header.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Arcadex
|
2
2
|
module Header
|
3
3
|
|
4
|
-
def self.grab_param_header(params,request,key)
|
4
|
+
def self.grab_param_header(params,request,key,downcase)
|
5
5
|
#Values in the headers have preference
|
6
6
|
if !params[key].blank?
|
7
7
|
value = params[key]
|
@@ -9,6 +9,9 @@ module Arcadex
|
|
9
9
|
if !request.headers[key].blank?
|
10
10
|
value = request.headers[key]
|
11
11
|
end
|
12
|
+
if downcase
|
13
|
+
value = value.downcase
|
14
|
+
end
|
12
15
|
return value
|
13
16
|
end
|
14
17
|
|
data/lib/arcadex/version.rb
CHANGED
data/test/test_app/Gemfile.lock
CHANGED
@@ -31,7 +31,7 @@ class Api::V1::ApiController < ::ActionController::API
|
|
31
31
|
def set_hash
|
32
32
|
#["current_owner","current_token"] Make this true to check for email also
|
33
33
|
#@instance_hash = ::Arcadex::Authentication.get_instance(params,request,"Auth-Token")
|
34
|
-
@instance_hash = ::Arcadex::Authentication.authenticate_owner_with_index(params,request,"Auth-Token","Email","email")
|
34
|
+
@instance_hash = ::Arcadex::Authentication.authenticate_owner_with_index(params,request,"Auth-Token","Email","email",true)
|
35
35
|
end
|
36
36
|
|
37
37
|
def current_user
|