arcadex 1.2.1 → 1.2.3

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: 7eddce1bd73053c36a6d303ef5c75133278688a6
4
- data.tar.gz: 14b389fbdb8e2f41d98b4e4ed7a3915f82f7a376
3
+ metadata.gz: 131b7e365740221eec23b5de5f450fac54b4ffe9
4
+ data.tar.gz: eb091d93fe323bdba94ba31768e9baad2558c0a9
5
5
  SHA512:
6
- metadata.gz: 9e485239a2b294c0e9a021a7d8a5feae30de5caa9d5f58a17483330bc451e5adf0f684b9433b4ea3df2a035660c3ae70c47779c522d6432253fb2b21c077cada
7
- data.tar.gz: 2625368bdee7b183f21901a97d1806bf7fa37c63cc15854c904fbb2f7c15314ebe08f2f085b4168aaf2135082e0f57f8eb5e1ae525414916a78b22b352a45ff4
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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Arcadex
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -19,7 +19,7 @@ GIT
19
19
  PATH
20
20
  remote: ../../../arcadex
21
21
  specs:
22
- arcadex (1.2.0)
22
+ arcadex (1.2.3)
23
23
  devise (>= 3.2.4)
24
24
  rails (>= 4.0.0)
25
25
 
@@ -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