arcadex 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arcadex/authentication.rb +17 -0
- data/lib/arcadex/version.rb +1 -1
- 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: bae371fe1dadc2669a6393b54e5b5aa747aa2718
|
4
|
+
data.tar.gz: dbac1294e91a6a943d47f8ed95d94b75db14f099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862b90ffb3d78585441e0e14042dc70856227991d3f088ac0f33787bfe64be2d4f36e661b8bf235fe3c92257862c7bc513b775819050a9f0f3535529c49e09fe
|
7
|
+
data.tar.gz: 3f942cea20f74ef39c84877b4392a2d3f47243cf92b98becf6c8ca62259cda5e6ce713a5154280c65b7d7016745f0113b3fa6ddc7d5dbfd0b0bcfefaf99edfb5
|
@@ -41,6 +41,23 @@ module Arcadex
|
|
41
41
|
return instance_hash
|
42
42
|
end
|
43
43
|
|
44
|
+
#Returns the object that is mapped to the key. The key is in the params or heaaders
|
45
|
+
def self.get_instance_no_update(params,request,key)
|
46
|
+
auth_token = ::Arcadex::Header.grab_param_header(params,request,key,false)
|
47
|
+
if auth_token.nil?
|
48
|
+
return nil
|
49
|
+
end
|
50
|
+
token = ::Arcadex::Find.find_token_by_auth_token(auth_token)
|
51
|
+
owner = ::Arcadex::Find.find_owner_by_token(token)
|
52
|
+
#This is to mitigate timing attacks
|
53
|
+
::Devise.secure_compare(auth_token,auth_token)
|
54
|
+
if token.nil? || owner.nil?
|
55
|
+
return nil
|
56
|
+
end
|
57
|
+
instance_hash = {"current_owner" => owner, "current_token" => token}
|
58
|
+
return instance_hash
|
59
|
+
end
|
60
|
+
|
44
61
|
def self.update_token(token,request)
|
45
62
|
if token.first_ip_address.nil?
|
46
63
|
token.first_ip_address = request.remote_ip
|
data/lib/arcadex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arcadex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cleophus Robinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|