restful_api_authentication 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change History / Release Notes
2
2
 
3
+ ## Version 0.2.1
4
+
5
+ * Closed Issue #3 - Failing to define an environment in the YML causes a fatal error
6
+ * Closed Issue #4 - Changes to the request_window in the YML were ignored in favor of the default 4 minute window
7
+
3
8
  ## Version 0.2.0
4
9
 
5
10
  * Added verbose error messaging; if this is enabled in the YML config file, then the response to an authentication failure will be more descriptive as to why the authentication failed. To enable, add `verbose_errors: true` to the `config/restful_api_authentication.yml`.
@@ -79,6 +79,10 @@ module RestfulApiAuthentication
79
79
  ts = Chronic.parse @http_headers[@@header_timestamp]
80
80
  before = Time.now.utc - 60*minutes
81
81
  after = Time.now.utc + 60*minutes
82
+ if ts.nil?
83
+ @errors << "timestamp was in an invalid format; should be YYYY-MM-DD HH:MM:SS UTC"
84
+ return false
85
+ end
82
86
  ts > before && ts < after
83
87
  end
84
88
 
@@ -22,5 +22,5 @@
22
22
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
24
  module RestfulApiAuthentication
25
- VERSION = "0.2.1"
25
+ VERSION = "0.2.2"
26
26
  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.1
4
+ version: 0.2.2
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: 2012-06-12 00:00:00.000000000 Z
12
+ date: 2012-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70131007101400 !ruby/object:Gem::Requirement
16
+ requirement: &70287685333760 !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: *70131007101400
24
+ version_requirements: *70287685333760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: uuid
27
- requirement: &70131007100900 !ruby/object:Gem::Requirement
27
+ requirement: &70287685332920 !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: *70131007100900
35
+ version_requirements: *70287685332920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chronic
38
- requirement: &70131007100420 !ruby/object:Gem::Requirement
38
+ requirement: &70287685332320 !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: *70131007100420
46
+ version_requirements: *70287685332320
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: