restful_api_authentication 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/README.md +3 -4
- data/lib/restful_api_authentication/checker.rb +2 -2
- data/lib/restful_api_authentication/version.rb +1 -1
- metadata +8 -8
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,8 +4,6 @@ RestfulApiAuthentication is a gem which implements a standard api_key/secret aut
|
|
4
4
|
|
5
5
|
With most RESTful Web API's, it is important to know which app is using your resources and that only the apps you allow access those resources. This gem allows you to easily add this layer of authentication to any Rails RESTful resource you want, and it even includes protection against various forms of attack.
|
6
6
|
|
7
|
-
Go here to read a more lengthy description of the problem this gem is attempting to solve: [Authentication of a Ruby on Rails RESTful Web API / Service](http://www.djkiger.com/?p=41)
|
8
|
-
|
9
7
|
## Requirements
|
10
8
|
|
11
9
|
1. Rails 3.2.0+
|
@@ -85,8 +83,9 @@ class MyTestApi
|
|
85
83
|
end
|
86
84
|
|
87
85
|
def authenticate_test
|
88
|
-
|
89
|
-
|
86
|
+
base_url = "https://api.mywebservice.com"
|
87
|
+
end_point = "/help/authenticate"
|
88
|
+
self.class.post(base_url + end_point, { :headers => auth_headers(end_point) })
|
90
89
|
end
|
91
90
|
|
92
91
|
end
|
@@ -39,7 +39,7 @@ module RestfulApiAuthentication
|
|
39
39
|
return_val = false
|
40
40
|
if headers_have_values?
|
41
41
|
if in_time_window?
|
42
|
-
if test_hash == @http_headers[@@header_signature]
|
42
|
+
if test_hash.downcase == @http_headers[@@header_signature].downcase
|
43
43
|
if options[:require_master] == true
|
44
44
|
if is_master?
|
45
45
|
return_val = true
|
@@ -106,4 +106,4 @@ module RestfulApiAuthentication
|
|
106
106
|
end
|
107
107
|
|
108
108
|
end
|
109
|
-
end
|
109
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful_api_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70257440207460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70257440207460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: uuid
|
27
|
-
requirement: &
|
27
|
+
requirement: &70257440206640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.3.5
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70257440206640
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: chronic
|
38
|
-
requirement: &
|
38
|
+
requirement: &70257440205960 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 0.6.7
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70257440205960
|
47
47
|
description: A gem which implements a standard api_key / secret authentication system
|
48
48
|
for your Ruby on Rails RESTful web services.
|
49
49
|
email:
|