rack-simple_auth 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MANIFEST +8 -1
- data/checksum/rack-simple_auth-0.0.9.gem.sha512 +1 -0
- data/checksum/rack-simple_auth-0.1.0.gem.sha512 +1 -0
- data/checksum/rack-simple_auth-0.1.1.gem.sha512 +1 -0
- data/lib/rack/simple_auth/hmac.rb +1 -2
- data/lib/rack/simple_auth/version.rb +1 -1
- data/rubocop-todo.yml +19 -0
- data/task/build.rake +4 -0
- data/task/checksum.rake +15 -0
- data/task/floodtest.rake +3 -3
- data/test/config_fail_step.ru +17 -0
- data/test/config_fail_tolerance.ru +17 -0
- data/test/rack/simple_auth/hmac_fail_test.rb +1 -5
- metadata +10 -3
- data/task/travis.rake +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6323039dc11e2c7a1a274c5771736806cfd79a
|
4
|
+
data.tar.gz: 7a0d1b3f084440c583f281142d3a55c39069c2f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7104b6d521fe419f683d0272e799e3f66b6f1327b96a7ca22ecd4964aac4fef5787dc26cb31aba3b74e04372b4690274623b00ddcbf88f73c090a2f51c44ce28
|
7
|
+
data.tar.gz: be303c35b182ac1dc4cfad28ca7082a044b3a950bb12cfacd78f03b91f07f7f537464585c31e87ead239ccd437a56ecd0950458edda2a19b683b5653af1c272f
|
data/MANIFEST
CHANGED
@@ -7,17 +7,24 @@ LICENSE.txt
|
|
7
7
|
MANIFEST
|
8
8
|
README.md
|
9
9
|
Rakefile
|
10
|
+
checksum/rack-simple_auth-0.0.9.gem.sha512
|
11
|
+
checksum/rack-simple_auth-0.1.0.gem.sha512
|
12
|
+
checksum/rack-simple_auth-0.1.1.gem.sha512
|
10
13
|
lib/rack/simple_auth.rb
|
11
14
|
lib/rack/simple_auth/hmac.rb
|
12
15
|
lib/rack/simple_auth/version.rb
|
13
16
|
rack-simple_auth.gemspec
|
17
|
+
rubocop-todo.yml
|
18
|
+
task/build.rake
|
19
|
+
task/checksum.rake
|
14
20
|
task/default.rake
|
15
21
|
task/floodtest.rake
|
16
22
|
task/manifest.rake
|
17
23
|
task/test.rake
|
18
|
-
task/travis.rake
|
19
24
|
test/config.ru
|
20
25
|
test/config_fail.ru
|
26
|
+
test/config_fail_step.ru
|
27
|
+
test/config_fail_tolerance.ru
|
21
28
|
test/rack/simple_auth/hmac_fail_test.rb
|
22
29
|
test/rack/simple_auth/hmac_test.rb
|
23
30
|
test/test_helper.rb
|
@@ -0,0 +1 @@
|
|
1
|
+
6cea3b5a2a5e2e6f972df781503a4bf41fd51379b30d126c422708b629cb3f4ca297175a0adb78e29ed44be9726ce81aa619636ea3c874fc1c82176a93f2104f
|
@@ -0,0 +1 @@
|
|
1
|
+
3f44ad70bd27de3e3f20ff929fd6b60e485a7b466de3248281015edef5e7b562e3bcc4ccafec834b05e2e797c2d90cdb30ff8b6a1bdd3dc33c4a11ecd962c3ca
|
@@ -0,0 +1 @@
|
|
1
|
+
9b0c40311d24b23a2aeba34dcd217f74539be06e626abfdead5c32447f17513ccb10ec697d4e71f9f374a7daf7fc6edc46373bd89d18a0d0e164ceae9966234f
|
@@ -139,8 +139,7 @@ module Rack
|
|
139
139
|
# @param [float] min [minimum allowed stepsize]
|
140
140
|
def valid_stepsize?(min)
|
141
141
|
if @steps < min
|
142
|
-
|
143
|
-
@steps = min
|
142
|
+
fail "Minimum allowed stepsize is #{min}"
|
144
143
|
end
|
145
144
|
end
|
146
145
|
|
data/rubocop-todo.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2014-04-23 23:22:22 +0200 using RuboCop version 0.20.1.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 1
|
9
|
+
CyclomaticComplexity:
|
10
|
+
Max: 7
|
11
|
+
|
12
|
+
# Offense count: 55
|
13
|
+
LineLength:
|
14
|
+
Max: 129
|
15
|
+
|
16
|
+
# Offense count: 3
|
17
|
+
# Configuration parameters: CountComments.
|
18
|
+
MethodLength:
|
19
|
+
Max: 16
|
data/task/build.rake
ADDED
data/task/checksum.rake
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'digest/sha2'
|
2
|
+
|
3
|
+
desc 'Creates a SHA512 checksum of the current version'
|
4
|
+
task :checksum do
|
5
|
+
checksums = File.expand_path('../../checksum', __FILE__)
|
6
|
+
name = "#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
|
7
|
+
path = File.join(File.expand_path('../../pkg', __FILE__), name)
|
8
|
+
|
9
|
+
checksum_name = File.basename(path) + '.sha512'
|
10
|
+
checksum = Digest::SHA512.new.hexdigest(File.read(path))
|
11
|
+
|
12
|
+
File.open(File.join(checksums, checksum_name), 'w') do |handle|
|
13
|
+
handle.write(checksum)
|
14
|
+
end
|
15
|
+
end
|
data/task/floodtest.rake
CHANGED
@@ -5,24 +5,24 @@ test_runs = if ENV['TESTS']
|
|
5
5
|
end
|
6
6
|
|
7
7
|
namespace :floodtest do
|
8
|
+
desc 'Run Unit floodtest (default 30 tests, configurable via ENV["TESTS"])'
|
8
9
|
task :unit do
|
9
|
-
desc 'Run Unit floodtest (default 30 tests, configurable via ENV["TESTS"])'
|
10
10
|
1.upto(test_runs) do |i|
|
11
11
|
puts "Running test #{i} of #{test_runs}"
|
12
12
|
exit(-1) if !system('bundle exec rake test:unit')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
# desc 'Run Spec floodtest (default 30 tests, configurable via ENV["TESTS"])'
|
16
17
|
# task :spec do
|
17
|
-
# desc 'Run Spec floodtest (default 30 tests, configurable via ENV["TESTS"])'
|
18
18
|
# 1.upto(test_runs) do |i|
|
19
19
|
# puts "Running test #{i} of #{test_runs}"
|
20
20
|
# exit(-1) if !system('bundle exec rake test:spec ')
|
21
21
|
# end
|
22
22
|
# end
|
23
23
|
|
24
|
+
# desc 'Run Feature floodtest (default 30 tests, configurable via ENV["TESTS"])'
|
24
25
|
# task :feature do
|
25
|
-
# desc 'Run Feature floodtest (default 30 tests, configurable via ENV["TESTS"])'
|
26
26
|
# 1.upto(test_runs) do |i|
|
27
27
|
# puts "Running test #{i} of #{test_runs}"
|
28
28
|
# exit(-1) if !system('bundle exec rake test:feature')
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rack/lobster'
|
2
|
+
require 'rack/simple_auth'
|
3
|
+
|
4
|
+
config = {
|
5
|
+
'GET' => 'path',
|
6
|
+
'POST' => 'params',
|
7
|
+
'DELETE' => 'path',
|
8
|
+
'PUT' => 'path',
|
9
|
+
'PATCH' => 'path',
|
10
|
+
'signature' => 'test_signature',
|
11
|
+
'secret' => 'test_secret',
|
12
|
+
'steps' => 0.0001,
|
13
|
+
'tolerance' => 1
|
14
|
+
}
|
15
|
+
|
16
|
+
use Rack::SimpleAuth::HMAC, config
|
17
|
+
run Rack::Lobster.new
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rack/lobster'
|
2
|
+
require 'rack/simple_auth'
|
3
|
+
|
4
|
+
config = {
|
5
|
+
'GET' => 'path',
|
6
|
+
'POST' => 'params',
|
7
|
+
'DELETE' => 'path',
|
8
|
+
'PUT' => 'path',
|
9
|
+
'PATCH' => 'path',
|
10
|
+
'signature' => 'test_signature',
|
11
|
+
'secret' => 'test_secret',
|
12
|
+
'steps' => 0.5,
|
13
|
+
'tolerance' => 0.3
|
14
|
+
}
|
15
|
+
|
16
|
+
use Rack::SimpleAuth::HMAC, config
|
17
|
+
run Rack::Lobster.new
|
@@ -22,11 +22,7 @@ class HMACFailTest < MiniTest::Unit::TestCase
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_fail_step
|
25
|
-
|
26
|
-
Rack::Builder.parse_file("#{Rack::SimpleAuth.root}/test/config_fail_step.ru").first
|
27
|
-
end
|
28
|
-
|
29
|
-
assert_match('Warning: Minimum allowed stepsize is 0.01', out, 'Warning should be printed if stepsize is below 0.01')
|
25
|
+
assert_raises(RuntimeError) { Rack::Builder.parse_file("#{Rack::SimpleAuth.root}/test/config_fail_step.ru").first }
|
30
26
|
end
|
31
27
|
|
32
28
|
def test_fail_tolerance
|
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.2
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -96,17 +96,24 @@ files:
|
|
96
96
|
- MANIFEST
|
97
97
|
- README.md
|
98
98
|
- Rakefile
|
99
|
+
- checksum/rack-simple_auth-0.0.9.gem.sha512
|
100
|
+
- checksum/rack-simple_auth-0.1.0.gem.sha512
|
101
|
+
- checksum/rack-simple_auth-0.1.1.gem.sha512
|
99
102
|
- lib/rack/simple_auth.rb
|
100
103
|
- lib/rack/simple_auth/hmac.rb
|
101
104
|
- lib/rack/simple_auth/version.rb
|
102
105
|
- rack-simple_auth.gemspec
|
106
|
+
- rubocop-todo.yml
|
107
|
+
- task/build.rake
|
108
|
+
- task/checksum.rake
|
103
109
|
- task/default.rake
|
104
110
|
- task/floodtest.rake
|
105
111
|
- task/manifest.rake
|
106
112
|
- task/test.rake
|
107
|
-
- task/travis.rake
|
108
113
|
- test/config.ru
|
109
114
|
- test/config_fail.ru
|
115
|
+
- test/config_fail_step.ru
|
116
|
+
- test/config_fail_tolerance.ru
|
110
117
|
- test/rack/simple_auth/hmac_fail_test.rb
|
111
118
|
- test/rack/simple_auth/hmac_test.rb
|
112
119
|
- test/test_helper.rb
|