rack-simple_auth 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/rack/simple_auth/hmac.rb +3 -1
- data/lib/rack/simple_auth/version.rb +1 -1
- data/task/floodtest.rake +1 -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: 8fa6b100a85c9fd7a4a16745a3669038ef8f48ce
|
4
|
+
data.tar.gz: fbf000d057d5df50733d04cc3d4afcda972ff192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee7d6fb78ea972bdd943eda54f9056acf6d10e4b8754af7da87dcc626c7183ad92497d676eacc598a444acbf628695d0ad07ef368ac8f26175753755d7c869ed
|
7
|
+
data.tar.gz: 44d6c7373f234946f22246b5729ea14fbd47b942fb29a81db0d344ba8cc6f294b6ad5de842d245e8ab3649693500b15c0a9b1436495166550f7dab008052e9e1
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Or install it yourself as:
|
|
24
24
|
[![Coverage Status](https://coveralls.io/repos/Benny1992/rack-simple_auth/badge.png?branch=master)](https://coveralls.io/r/Benny1992/rack-simple_auth?branch=master)
|
25
25
|
[![Gem Version](https://badge.fury.io/rb/rack-simple_auth.png)](http://badge.fury.io/rb/rack-simple_auth)
|
26
26
|
[![Dependency Status](https://gemnasium.com/Benny1992/rack-simple_auth.png)](https://gemnasium.com/Benny1992/rack-simple_auth)
|
27
|
+
[![Codeship](https://www.codeship.io/projects/f2d9d790-b0fe-0131-3fd5-025f180094b5/status)](https://www.codeship.io/projects/f2d9d790-b0fe-0131-3fd5-025f180094b5/status)
|
27
28
|
|
28
29
|
## Usage
|
29
30
|
|
@@ -68,6 +68,7 @@ module Rack
|
|
68
68
|
def allowed_messages
|
69
69
|
messages = []
|
70
70
|
|
71
|
+
@date = Time.now.to_i.freeze
|
71
72
|
(-(@tolerance)..@tolerance).step(@steps) do |i|
|
72
73
|
i = i.round(2)
|
73
74
|
messages << OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @secret, message(i))
|
@@ -80,8 +81,9 @@ module Rack
|
|
80
81
|
# @param [Fixnum] delay [delay in timestamp format]
|
81
82
|
# @return [Hash] message [message which will be encrypted]
|
82
83
|
def message(delay = 0)
|
83
|
-
date =
|
84
|
+
date = @date + delay
|
84
85
|
date = date.to_i if delay.eql?(0.0)
|
86
|
+
puts "Delay: #{delay}, Timestamp: #{date}"
|
85
87
|
|
86
88
|
case @request.request_method
|
87
89
|
when 'GET'
|
data/task/floodtest.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-simple_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benny1992
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|