scout 5.7.1 → 5.7.2.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +5 -0
- data/lib/scout/command/run.rb +1 -1
- data/lib/scout/server.rb +2 -1
- data/lib/scout/streamer.rb +3 -2
- data/lib/scout/streamer_daemon.rb +4 -4
- data/lib/scout/version.rb +1 -1
- data/test/scout_test.rb +7 -8
- data/vendor/httpclient/README.txt +759 -0
- data/vendor/httpclient/bin/httpclient +65 -0
- data/vendor/httpclient/lib/hexdump.rb +50 -0
- data/vendor/httpclient/lib/http-access2.rb +55 -0
- data/vendor/httpclient/lib/http-access2/cookie.rb +1 -0
- data/vendor/httpclient/lib/http-access2/http.rb +1 -0
- data/vendor/httpclient/lib/httpclient.rb +1156 -0
- data/vendor/httpclient/lib/httpclient/auth.rb +899 -0
- data/vendor/httpclient/lib/httpclient/cacert.p7s +1912 -0
- data/vendor/httpclient/lib/httpclient/connection.rb +88 -0
- data/vendor/httpclient/lib/httpclient/cookie.rb +438 -0
- data/vendor/httpclient/lib/httpclient/http.rb +1046 -0
- data/vendor/httpclient/lib/httpclient/include_client.rb +83 -0
- data/vendor/httpclient/lib/httpclient/session.rb +1025 -0
- data/vendor/httpclient/lib/httpclient/ssl_config.rb +403 -0
- data/vendor/httpclient/lib/httpclient/timeout.rb +140 -0
- data/vendor/httpclient/lib/httpclient/util.rb +178 -0
- data/vendor/httpclient/lib/httpclient/version.rb +3 -0
- data/vendor/httpclient/lib/oauthclient.rb +110 -0
- data/vendor/httpclient/sample/async.rb +8 -0
- data/vendor/httpclient/sample/auth.rb +11 -0
- data/vendor/httpclient/sample/cookie.rb +18 -0
- data/vendor/httpclient/sample/dav.rb +103 -0
- data/vendor/httpclient/sample/howto.rb +49 -0
- data/vendor/httpclient/sample/oauth_buzz.rb +57 -0
- data/vendor/httpclient/sample/oauth_friendfeed.rb +59 -0
- data/vendor/httpclient/sample/oauth_salesforce_10.rb +63 -0
- data/vendor/httpclient/sample/oauth_twitter.rb +61 -0
- data/vendor/httpclient/sample/ssl/0cert.pem +22 -0
- data/vendor/httpclient/sample/ssl/0key.pem +30 -0
- data/vendor/httpclient/sample/ssl/1000cert.pem +19 -0
- data/vendor/httpclient/sample/ssl/1000key.pem +18 -0
- data/vendor/httpclient/sample/ssl/htdocs/index.html +10 -0
- data/vendor/httpclient/sample/ssl/ssl_client.rb +22 -0
- data/vendor/httpclient/sample/ssl/webrick_httpsd.rb +29 -0
- data/vendor/httpclient/sample/stream.rb +21 -0
- data/vendor/httpclient/sample/thread.rb +27 -0
- data/vendor/httpclient/sample/wcat.rb +21 -0
- data/vendor/httpclient/test/ca-chain.cert +44 -0
- data/vendor/httpclient/test/ca.cert +23 -0
- data/vendor/httpclient/test/client.cert +19 -0
- data/vendor/httpclient/test/client.key +15 -0
- data/vendor/httpclient/test/helper.rb +129 -0
- data/vendor/httpclient/test/htdigest +1 -0
- data/vendor/httpclient/test/htpasswd +2 -0
- data/vendor/httpclient/test/runner.rb +2 -0
- data/vendor/httpclient/test/server.cert +19 -0
- data/vendor/httpclient/test/server.key +15 -0
- data/vendor/httpclient/test/sslsvr.rb +65 -0
- data/vendor/httpclient/test/subca.cert +21 -0
- data/vendor/httpclient/test/test_auth.rb +321 -0
- data/vendor/httpclient/test/test_cookie.rb +391 -0
- data/vendor/httpclient/test/test_hexdump.rb +14 -0
- data/vendor/httpclient/test/test_http-access2.rb +507 -0
- data/vendor/httpclient/test/test_httpclient.rb +1783 -0
- data/vendor/httpclient/test/test_include_client.rb +52 -0
- data/vendor/httpclient/test/test_ssl.rb +235 -0
- data/vendor/multi_json/.document +5 -0
- data/vendor/multi_json/.rspec +3 -0
- data/vendor/multi_json/.travis.yml +11 -0
- data/vendor/multi_json/.yardopts +6 -0
- data/vendor/multi_json/CHANGELOG.md +169 -0
- data/vendor/multi_json/CONTRIBUTING.md +46 -0
- data/vendor/multi_json/Gemfile +31 -0
- data/vendor/multi_json/LICENSE.md +20 -0
- data/vendor/multi_json/README.md +109 -0
- data/vendor/multi_json/Rakefile +12 -0
- data/vendor/multi_json/lib/multi_json.rb +157 -0
- data/vendor/multi_json/lib/multi_json/adapter.rb +48 -0
- data/vendor/multi_json/lib/multi_json/adapters/gson.rb +19 -0
- data/vendor/multi_json/lib/multi_json/adapters/jr_jackson.rb +19 -0
- data/vendor/multi_json/lib/multi_json/adapters/json_common.rb +25 -0
- data/vendor/multi_json/lib/multi_json/adapters/json_gem.rb +11 -0
- data/vendor/multi_json/lib/multi_json/adapters/json_pure.rb +11 -0
- data/vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb +34 -0
- data/vendor/multi_json/lib/multi_json/adapters/oj.rb +24 -0
- data/vendor/multi_json/lib/multi_json/adapters/ok_json.rb +22 -0
- data/vendor/multi_json/lib/multi_json/adapters/yajl.rb +19 -0
- data/vendor/multi_json/lib/multi_json/convertible_hash_keys.rb +43 -0
- data/vendor/multi_json/lib/multi_json/load_error.rb +11 -0
- data/vendor/multi_json/lib/multi_json/options.rb +48 -0
- data/vendor/multi_json/lib/multi_json/vendor/okjson.rb +606 -0
- data/vendor/multi_json/lib/multi_json/version.rb +20 -0
- data/vendor/multi_json/multi_json.gemspec +22 -0
- data/vendor/multi_json/spec/adapter_shared_example.rb +235 -0
- data/vendor/multi_json/spec/has_options.rb +119 -0
- data/vendor/multi_json/spec/helper.rb +35 -0
- data/vendor/multi_json/spec/json_common_shared_example.rb +30 -0
- data/vendor/multi_json/spec/multi_json_spec.rb +226 -0
- data/vendor/{signature → pusher}/.document +0 -0
- data/vendor/{json_pure/diagrams/.keep → pusher/.gemtest} +0 -0
- data/vendor/pusher/.gitignore +23 -0
- data/vendor/pusher/.travis.yml +15 -0
- data/vendor/pusher/Gemfile +2 -0
- data/vendor/{pusher-gem → pusher}/LICENSE +1 -1
- data/vendor/pusher/README.md +186 -0
- data/vendor/{pusher-gem → pusher}/Rakefile +0 -0
- data/vendor/{pusher-gem → pusher}/examples/async_message.rb +0 -0
- data/vendor/pusher/lib/pusher.rb +60 -0
- data/vendor/{pusher-gem → pusher}/lib/pusher/channel.rb +47 -54
- data/vendor/pusher/lib/pusher/client.rb +306 -0
- data/vendor/pusher/lib/pusher/request.rb +107 -0
- data/vendor/pusher/lib/pusher/resource.rb +36 -0
- data/vendor/pusher/lib/pusher/webhook.rb +110 -0
- data/vendor/{pusher-gem → pusher}/pusher.gemspec +6 -5
- data/vendor/pusher/spec/channel_spec.rb +127 -0
- data/vendor/pusher/spec/client_spec.rb +464 -0
- data/vendor/{pusher-gem → pusher}/spec/spec_helper.rb +12 -0
- data/vendor/pusher/spec/web_hook_spec.rb +117 -0
- data/vendor/signature/.travis.yml +15 -0
- data/vendor/signature/Gemfile +1 -1
- data/vendor/signature/README.md +38 -28
- data/vendor/signature/lib/signature.rb +97 -15
- data/vendor/signature/lib/signature/query_encoder.rb +47 -0
- data/vendor/signature/lib/signature/version.rb +1 -1
- data/vendor/signature/signature.gemspec +3 -2
- data/vendor/signature/spec/signature_spec.rb +164 -55
- data/vendor/signature/spec/spec_helper.rb +2 -3
- metadata +120 -145
- data/vendor/json_pure/.gitignore +0 -12
- data/vendor/json_pure/.travis.yml +0 -20
- data/vendor/json_pure/CHANGES +0 -282
- data/vendor/json_pure/COPYING +0 -58
- data/vendor/json_pure/COPYING-json-jruby +0 -57
- data/vendor/json_pure/GPL +0 -340
- data/vendor/json_pure/Gemfile +0 -11
- data/vendor/json_pure/README-json-jruby.markdown +0 -33
- data/vendor/json_pure/README.rdoc +0 -358
- data/vendor/json_pure/Rakefile +0 -412
- data/vendor/json_pure/TODO +0 -1
- data/vendor/json_pure/VERSION +0 -1
- data/vendor/json_pure/data/example.json +0 -1
- data/vendor/json_pure/data/index.html +0 -38
- data/vendor/json_pure/data/prototype.js +0 -4184
- data/vendor/json_pure/ext/json/ext/fbuffer/fbuffer.h +0 -181
- data/vendor/json_pure/ext/json/ext/generator/depend +0 -1
- data/vendor/json_pure/ext/json/ext/generator/extconf.rb +0 -14
- data/vendor/json_pure/ext/json/ext/generator/generator.c +0 -1435
- data/vendor/json_pure/ext/json/ext/generator/generator.h +0 -148
- data/vendor/json_pure/ext/json/ext/parser/depend +0 -1
- data/vendor/json_pure/ext/json/ext/parser/extconf.rb +0 -13
- data/vendor/json_pure/ext/json/ext/parser/parser.c +0 -2204
- data/vendor/json_pure/ext/json/ext/parser/parser.h +0 -77
- data/vendor/json_pure/ext/json/ext/parser/parser.rl +0 -927
- data/vendor/json_pure/install.rb +0 -23
- data/vendor/json_pure/java/src/json/ext/ByteListTranscoder.java +0 -167
- data/vendor/json_pure/java/src/json/ext/Generator.java +0 -444
- data/vendor/json_pure/java/src/json/ext/GeneratorMethods.java +0 -232
- data/vendor/json_pure/java/src/json/ext/GeneratorService.java +0 -43
- data/vendor/json_pure/java/src/json/ext/GeneratorState.java +0 -543
- data/vendor/json_pure/java/src/json/ext/OptionsReader.java +0 -114
- data/vendor/json_pure/java/src/json/ext/Parser.java +0 -2644
- data/vendor/json_pure/java/src/json/ext/Parser.rl +0 -968
- data/vendor/json_pure/java/src/json/ext/ParserService.java +0 -35
- data/vendor/json_pure/java/src/json/ext/RuntimeInfo.java +0 -121
- data/vendor/json_pure/java/src/json/ext/StringDecoder.java +0 -167
- data/vendor/json_pure/java/src/json/ext/StringEncoder.java +0 -106
- data/vendor/json_pure/java/src/json/ext/Utils.java +0 -89
- data/vendor/json_pure/json-java.gemspec +0 -23
- data/vendor/json_pure/json.gemspec +0 -37
- data/vendor/json_pure/json_pure.gemspec +0 -39
- data/vendor/json_pure/lib/json.rb +0 -62
- data/vendor/json_pure/lib/json/add/bigdecimal.rb +0 -28
- data/vendor/json_pure/lib/json/add/complex.rb +0 -22
- data/vendor/json_pure/lib/json/add/core.rb +0 -11
- data/vendor/json_pure/lib/json/add/date.rb +0 -34
- data/vendor/json_pure/lib/json/add/date_time.rb +0 -50
- data/vendor/json_pure/lib/json/add/exception.rb +0 -31
- data/vendor/json_pure/lib/json/add/ostruct.rb +0 -31
- data/vendor/json_pure/lib/json/add/range.rb +0 -29
- data/vendor/json_pure/lib/json/add/rational.rb +0 -22
- data/vendor/json_pure/lib/json/add/regexp.rb +0 -30
- data/vendor/json_pure/lib/json/add/struct.rb +0 -30
- data/vendor/json_pure/lib/json/add/symbol.rb +0 -25
- data/vendor/json_pure/lib/json/add/time.rb +0 -38
- data/vendor/json_pure/lib/json/common.rb +0 -487
- data/vendor/json_pure/lib/json/ext.rb +0 -21
- data/vendor/json_pure/lib/json/ext/.keep +0 -0
- data/vendor/json_pure/lib/json/generic_object.rb +0 -70
- data/vendor/json_pure/lib/json/pure.rb +0 -21
- data/vendor/json_pure/lib/json/pure/generator.rb +0 -522
- data/vendor/json_pure/lib/json/pure/parser.rb +0 -359
- data/vendor/json_pure/lib/json/version.rb +0 -8
- data/vendor/json_pure/tests/fixtures/fail1.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail10.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail11.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail12.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail13.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail14.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail18.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail19.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail2.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail20.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail21.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail22.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail23.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail24.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail25.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail27.json +0 -2
- data/vendor/json_pure/tests/fixtures/fail28.json +0 -2
- data/vendor/json_pure/tests/fixtures/fail3.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail4.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail5.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail6.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail7.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail8.json +0 -1
- data/vendor/json_pure/tests/fixtures/fail9.json +0 -1
- data/vendor/json_pure/tests/fixtures/pass1.json +0 -56
- data/vendor/json_pure/tests/fixtures/pass15.json +0 -1
- data/vendor/json_pure/tests/fixtures/pass16.json +0 -1
- data/vendor/json_pure/tests/fixtures/pass17.json +0 -1
- data/vendor/json_pure/tests/fixtures/pass2.json +0 -1
- data/vendor/json_pure/tests/fixtures/pass26.json +0 -1
- data/vendor/json_pure/tests/fixtures/pass3.json +0 -6
- data/vendor/json_pure/tests/setup_variant.rb +0 -11
- data/vendor/json_pure/tests/test_json.rb +0 -545
- data/vendor/json_pure/tests/test_json_addition.rb +0 -196
- data/vendor/json_pure/tests/test_json_encoding.rb +0 -65
- data/vendor/json_pure/tests/test_json_fixtures.rb +0 -35
- data/vendor/json_pure/tests/test_json_generate.rb +0 -322
- data/vendor/json_pure/tests/test_json_generic_object.rb +0 -75
- data/vendor/json_pure/tests/test_json_string_matching.rb +0 -39
- data/vendor/json_pure/tests/test_json_unicode.rb +0 -72
- data/vendor/json_pure/tools/fuzz.rb +0 -139
- data/vendor/json_pure/tools/server.rb +0 -62
- data/vendor/pusher-gem/Gemfile +0 -2
- data/vendor/pusher-gem/README.md +0 -80
- data/vendor/pusher-gem/lib/pusher.rb +0 -107
- data/vendor/pusher-gem/lib/pusher/request.rb +0 -107
- data/vendor/pusher-gem/spec/channel_spec.rb +0 -274
- data/vendor/pusher-gem/spec/pusher_spec.rb +0 -87
- data/vendor/ruby-hmac/History.txt +0 -15
- data/vendor/ruby-hmac/Manifest.txt +0 -11
- data/vendor/ruby-hmac/README.md +0 -41
- data/vendor/ruby-hmac/Rakefile +0 -23
- data/vendor/ruby-hmac/lib/hmac-md5.rb +0 -11
- data/vendor/ruby-hmac/lib/hmac-rmd160.rb +0 -11
- data/vendor/ruby-hmac/lib/hmac-sha1.rb +0 -11
- data/vendor/ruby-hmac/lib/hmac-sha2.rb +0 -25
- data/vendor/ruby-hmac/lib/hmac.rb +0 -118
- data/vendor/ruby-hmac/lib/ruby_hmac.rb +0 -2
- data/vendor/ruby-hmac/ruby-hmac.gemspec +0 -33
- data/vendor/ruby-hmac/test/test_hmac.rb +0 -89
- data/vendor/signature/VERSION +0 -1
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency "
|
21
|
-
s.add_development_dependency "rspec"
|
20
|
+
s.add_dependency "jruby-openssl" if defined?(JRUBY_VERSION)
|
21
|
+
s.add_development_dependency "rspec"
|
22
|
+
s.add_development_dependency "em-spec"
|
22
23
|
end
|
@@ -10,72 +10,103 @@ describe Signature do
|
|
10
10
|
"query" => "params",
|
11
11
|
"go" => "here"
|
12
12
|
})
|
13
|
-
@signature = @request.sign(@token)[:auth_signature]
|
14
13
|
end
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
describe "generating signatures" do
|
16
|
+
before :each do
|
17
|
+
@signature = "3b237953a5ba6619875cbb2a2d43e8da9ef5824e8a2c689f6284ac85bc1ea0db"
|
18
|
+
end
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
lambda {
|
26
|
-
request.auth_hash
|
27
|
-
}.should raise_error('Request not signed')
|
28
|
-
|
29
|
-
request.sign(@token)
|
30
|
-
request.auth_hash.should == {
|
31
|
-
:auth_signature => "da078fcedd72941b6c873caa40d0d6b2000ebfc700cee802b128dd20f72e74e9",
|
32
|
-
:auth_version => "1.0",
|
33
|
-
:auth_key => "key",
|
34
|
-
:auth_timestamp => '1234'
|
35
|
-
}
|
36
|
-
end
|
20
|
+
it "should generate signature correctly" do
|
21
|
+
@request.sign(@token)
|
22
|
+
string = @request.send(:string_to_sign)
|
23
|
+
string.should == "POST\n/some/path\nauth_key=key&auth_timestamp=1234&auth_version=1.0&go=here&query=params"
|
37
24
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
@request.sign(@token)[:auth_signature].should == @signature
|
44
|
-
end
|
25
|
+
digest = OpenSSL::Digest::SHA256.new
|
26
|
+
signature = OpenSSL::HMAC.hexdigest(digest, @token.secret, string)
|
27
|
+
signature.should == @signature
|
28
|
+
end
|
45
29
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
30
|
+
it "should make auth_hash available after request is signed" do
|
31
|
+
@request.query_hash = {
|
32
|
+
"query" => "params"
|
33
|
+
}
|
34
|
+
lambda {
|
35
|
+
@request.auth_hash
|
36
|
+
}.should raise_error('Request not signed')
|
53
37
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
38
|
+
@request.sign(@token)
|
39
|
+
@request.auth_hash.should == {
|
40
|
+
:auth_signature => "da078fcedd72941b6c873caa40d0d6b2000ebfc700cee802b128dd20f72e74e9",
|
41
|
+
:auth_version => "1.0",
|
42
|
+
:auth_key => "key",
|
43
|
+
:auth_timestamp => '1234'
|
44
|
+
}
|
45
|
+
end
|
58
46
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
47
|
+
it "should cope with symbol keys" do
|
48
|
+
@request.query_hash = {
|
49
|
+
:query => "params",
|
50
|
+
:go => "here"
|
51
|
+
}
|
52
|
+
@request.sign(@token)[:auth_signature].should == @signature
|
53
|
+
end
|
65
54
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
55
|
+
it "should cope with upcase keys (keys are lowercased before signing)" do
|
56
|
+
@request.query_hash = {
|
57
|
+
"Query" => "params",
|
58
|
+
"GO" => "here"
|
59
|
+
}
|
60
|
+
@request.sign(@token)[:auth_signature].should == @signature
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should generate correct string when query hash contains array" do
|
64
|
+
@request.query_hash = {
|
65
|
+
"things" => ["thing1", "thing2"]
|
66
|
+
}
|
67
|
+
@request.send(:string_to_sign).should == "POST\n/some/path\nthings[]=thing1&things[]=thing2"
|
68
|
+
end
|
69
|
+
|
70
|
+
# This may well change in auth version 2
|
71
|
+
it "should not escape keys or values in the query string" do
|
72
|
+
@request.query_hash = {
|
73
|
+
"key;" => "value@"
|
74
|
+
}
|
75
|
+
@request.send(:string_to_sign).should == "POST\n/some/path\nkey;=value@"
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should cope with requests where the value is nil (antiregression)" do
|
79
|
+
@request.query_hash = {
|
80
|
+
"key" => nil
|
81
|
+
}
|
82
|
+
@request.send(:string_to_sign).should == "POST\n/some/path\nkey="
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should use the path to generate signature" do
|
86
|
+
@request.path = '/some/other/path'
|
87
|
+
@request.sign(@token)[:auth_signature].should_not == @signature
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should use the query string keys to generate signature" do
|
91
|
+
@request.query_hash = {
|
92
|
+
"other" => "query"
|
93
|
+
}
|
94
|
+
@request.sign(@token)[:auth_signature].should_not == @signature
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should use the query string values to generate signature" do
|
98
|
+
@request.query_hash = {
|
99
|
+
"key" => "notfoo",
|
100
|
+
"other" => 'bar'
|
101
|
+
}
|
102
|
+
@request.sign(@token)[:signature].should_not == @signature
|
103
|
+
end
|
72
104
|
end
|
73
105
|
|
74
106
|
describe "verification" do
|
75
107
|
before :each do
|
76
|
-
Time.stub!(:now).and_return(Time.at(1234))
|
77
108
|
@request.sign(@token)
|
78
|
-
@params = @request.
|
109
|
+
@params = @request.signed_params
|
79
110
|
end
|
80
111
|
|
81
112
|
it "should verify requests" do
|
@@ -148,6 +179,15 @@ describe Signature do
|
|
148
179
|
}.should raise_error('Version not supported')
|
149
180
|
end
|
150
181
|
|
182
|
+
it "should validate that the provided token has a non-empty secret" do
|
183
|
+
token = Signature::Token.new('key', '')
|
184
|
+
request = Signature::Request.new('POST', '/some/path', @params)
|
185
|
+
|
186
|
+
lambda {
|
187
|
+
request.authenticate_by_token!(token)
|
188
|
+
}.should raise_error('Provided token is missing secret')
|
189
|
+
end
|
190
|
+
|
151
191
|
describe "when used with optional block" do
|
152
192
|
it "should optionally take a block which yields the signature" do
|
153
193
|
request = Signature::Request.new('POST', '/some/path', @params)
|
@@ -162,14 +202,83 @@ describe Signature do
|
|
162
202
|
request = Signature::Request.new('POST', '/some/path', @params)
|
163
203
|
lambda {
|
164
204
|
request.authenticate { |key| nil }
|
165
|
-
}.should raise_error('
|
205
|
+
}.should raise_error('Missing parameter: auth_key')
|
166
206
|
end
|
167
207
|
|
168
208
|
it "should raise error if block returns nil (i.e. key doesn't exist)" do
|
169
209
|
request = Signature::Request.new('POST', '/some/path', @params)
|
170
210
|
lambda {
|
171
211
|
request.authenticate { |key| nil }
|
172
|
-
}.should raise_error('
|
212
|
+
}.should raise_error('Unknown auth_key')
|
213
|
+
end
|
214
|
+
|
215
|
+
it "should raise unless block given" do
|
216
|
+
request = Signature::Request.new('POST', '/some/path', @params)
|
217
|
+
lambda {
|
218
|
+
request.authenticate
|
219
|
+
}.should raise_error(ArgumentError, "Block required")
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
describe "authenticate_async" do
|
224
|
+
include EM::SpecHelper
|
225
|
+
default_timeout 1
|
226
|
+
|
227
|
+
it "returns a deferrable which succeeds if authentication passes" do
|
228
|
+
request = Signature::Request.new('POST', '/some/path', @params)
|
229
|
+
em {
|
230
|
+
df = EM::DefaultDeferrable.new
|
231
|
+
|
232
|
+
request_df = request.authenticate_async do |key|
|
233
|
+
df
|
234
|
+
end
|
235
|
+
|
236
|
+
df.succeed(@token)
|
237
|
+
|
238
|
+
request_df.callback { |token|
|
239
|
+
token.should == @token
|
240
|
+
done
|
241
|
+
}
|
242
|
+
}
|
243
|
+
end
|
244
|
+
|
245
|
+
it "returns a deferrable which fails if block df fails" do
|
246
|
+
request = Signature::Request.new('POST', '/some/path', @params)
|
247
|
+
em {
|
248
|
+
df = EM::DefaultDeferrable.new
|
249
|
+
|
250
|
+
request_df = request.authenticate_async do |key|
|
251
|
+
df
|
252
|
+
end
|
253
|
+
|
254
|
+
df.fail()
|
255
|
+
|
256
|
+
request_df.errback { |e|
|
257
|
+
e.class.should == Signature::AuthenticationError
|
258
|
+
e.message.should == 'Unknown auth_key'
|
259
|
+
done
|
260
|
+
}
|
261
|
+
}
|
262
|
+
end
|
263
|
+
|
264
|
+
it "returns a deferrable which fails if request does not validate" do
|
265
|
+
request = Signature::Request.new('POST', '/some/path', @params)
|
266
|
+
em {
|
267
|
+
df = EM::DefaultDeferrable.new
|
268
|
+
|
269
|
+
request_df = request.authenticate_async do |key|
|
270
|
+
df
|
271
|
+
end
|
272
|
+
|
273
|
+
token = Signature::Token.new('key', 'wrong_secret')
|
274
|
+
df.succeed(token)
|
275
|
+
|
276
|
+
request_df.errback { |e|
|
277
|
+
e.class.should == Signature::AuthenticationError
|
278
|
+
e.message.should =~ /Invalid signature/
|
279
|
+
done
|
280
|
+
}
|
281
|
+
}
|
173
282
|
end
|
174
283
|
end
|
175
284
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.7.
|
5
|
-
prerelease:
|
4
|
+
version: 5.7.2.pre
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andre Lewis
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: elif
|
@@ -71,145 +71,123 @@ files:
|
|
71
71
|
- scout.gemspec
|
72
72
|
- test/plugins/disk_usage.rb
|
73
73
|
- test/scout_test.rb
|
74
|
-
- vendor/
|
75
|
-
- vendor/
|
76
|
-
- vendor/
|
77
|
-
- vendor/
|
78
|
-
- vendor/
|
79
|
-
- vendor/
|
80
|
-
- vendor/
|
81
|
-
- vendor/
|
82
|
-
- vendor/
|
83
|
-
- vendor/
|
84
|
-
- vendor/
|
85
|
-
- vendor/
|
86
|
-
- vendor/
|
87
|
-
- vendor/
|
88
|
-
- vendor/
|
89
|
-
- vendor/
|
90
|
-
- vendor/
|
91
|
-
- vendor/
|
92
|
-
- vendor/
|
93
|
-
- vendor/
|
94
|
-
- vendor/
|
95
|
-
- vendor/
|
96
|
-
- vendor/
|
97
|
-
- vendor/
|
98
|
-
- vendor/
|
99
|
-
- vendor/
|
100
|
-
- vendor/
|
101
|
-
- vendor/
|
102
|
-
- vendor/
|
103
|
-
- vendor/
|
104
|
-
- vendor/
|
105
|
-
- vendor/
|
106
|
-
- vendor/
|
107
|
-
- vendor/
|
108
|
-
- vendor/
|
109
|
-
- vendor/
|
110
|
-
- vendor/
|
111
|
-
- vendor/
|
112
|
-
- vendor/
|
113
|
-
- vendor/
|
114
|
-
- vendor/
|
115
|
-
- vendor/
|
116
|
-
- vendor/
|
117
|
-
- vendor/
|
118
|
-
- vendor/
|
119
|
-
- vendor/
|
120
|
-
- vendor/
|
121
|
-
- vendor/
|
122
|
-
- vendor/
|
123
|
-
- vendor/
|
124
|
-
- vendor/
|
125
|
-
- vendor/
|
126
|
-
- vendor/
|
127
|
-
- vendor/
|
128
|
-
- vendor/
|
129
|
-
- vendor/
|
130
|
-
- vendor/
|
131
|
-
- vendor/
|
132
|
-
- vendor/
|
133
|
-
- vendor/
|
134
|
-
- vendor/
|
135
|
-
- vendor/
|
136
|
-
- vendor/
|
137
|
-
- vendor/
|
138
|
-
- vendor/
|
139
|
-
- vendor/
|
140
|
-
- vendor/
|
141
|
-
- vendor/
|
142
|
-
- vendor/
|
143
|
-
- vendor/
|
144
|
-
- vendor/
|
145
|
-
- vendor/
|
146
|
-
- vendor/
|
147
|
-
- vendor/
|
148
|
-
- vendor/
|
149
|
-
- vendor/
|
150
|
-
- vendor/
|
151
|
-
- vendor/
|
152
|
-
- vendor/
|
153
|
-
- vendor/
|
154
|
-
- vendor/
|
155
|
-
- vendor/
|
156
|
-
- vendor/
|
157
|
-
- vendor/
|
158
|
-
- vendor/
|
159
|
-
- vendor/
|
160
|
-
- vendor/
|
161
|
-
- vendor/
|
162
|
-
- vendor/
|
163
|
-
- vendor/
|
164
|
-
- vendor/
|
165
|
-
- vendor/
|
166
|
-
- vendor/
|
167
|
-
- vendor/
|
168
|
-
- vendor/
|
169
|
-
- vendor/
|
170
|
-
- vendor/
|
171
|
-
- vendor/
|
172
|
-
- vendor/
|
173
|
-
- vendor/
|
174
|
-
- vendor/
|
175
|
-
- vendor/
|
176
|
-
- vendor/
|
177
|
-
- vendor/
|
178
|
-
- vendor/
|
179
|
-
- vendor/
|
180
|
-
- vendor/
|
181
|
-
- vendor/pusher
|
182
|
-
- vendor/pusher
|
183
|
-
- vendor/pusher-gem/README.md
|
184
|
-
- vendor/pusher-gem/Rakefile
|
185
|
-
- vendor/pusher-gem/examples/async_message.rb
|
186
|
-
- vendor/pusher-gem/lib/pusher.rb
|
187
|
-
- vendor/pusher-gem/lib/pusher/channel.rb
|
188
|
-
- vendor/pusher-gem/lib/pusher/request.rb
|
189
|
-
- vendor/pusher-gem/pusher.gemspec
|
190
|
-
- vendor/pusher-gem/spec/channel_spec.rb
|
191
|
-
- vendor/pusher-gem/spec/pusher_spec.rb
|
192
|
-
- vendor/pusher-gem/spec/spec_helper.rb
|
193
|
-
- vendor/ruby-hmac/History.txt
|
194
|
-
- vendor/ruby-hmac/Manifest.txt
|
195
|
-
- vendor/ruby-hmac/README.md
|
196
|
-
- vendor/ruby-hmac/Rakefile
|
197
|
-
- vendor/ruby-hmac/lib/hmac-md5.rb
|
198
|
-
- vendor/ruby-hmac/lib/hmac-rmd160.rb
|
199
|
-
- vendor/ruby-hmac/lib/hmac-sha1.rb
|
200
|
-
- vendor/ruby-hmac/lib/hmac-sha2.rb
|
201
|
-
- vendor/ruby-hmac/lib/hmac.rb
|
202
|
-
- vendor/ruby-hmac/lib/ruby_hmac.rb
|
203
|
-
- vendor/ruby-hmac/ruby-hmac.gemspec
|
204
|
-
- vendor/ruby-hmac/test/test_hmac.rb
|
205
|
-
- vendor/signature/.document
|
74
|
+
- vendor/httpclient/README.txt
|
75
|
+
- vendor/httpclient/bin/httpclient
|
76
|
+
- vendor/httpclient/lib/hexdump.rb
|
77
|
+
- vendor/httpclient/lib/http-access2.rb
|
78
|
+
- vendor/httpclient/lib/http-access2/cookie.rb
|
79
|
+
- vendor/httpclient/lib/http-access2/http.rb
|
80
|
+
- vendor/httpclient/lib/httpclient.rb
|
81
|
+
- vendor/httpclient/lib/httpclient/auth.rb
|
82
|
+
- vendor/httpclient/lib/httpclient/cacert.p7s
|
83
|
+
- vendor/httpclient/lib/httpclient/connection.rb
|
84
|
+
- vendor/httpclient/lib/httpclient/cookie.rb
|
85
|
+
- vendor/httpclient/lib/httpclient/http.rb
|
86
|
+
- vendor/httpclient/lib/httpclient/include_client.rb
|
87
|
+
- vendor/httpclient/lib/httpclient/session.rb
|
88
|
+
- vendor/httpclient/lib/httpclient/ssl_config.rb
|
89
|
+
- vendor/httpclient/lib/httpclient/timeout.rb
|
90
|
+
- vendor/httpclient/lib/httpclient/util.rb
|
91
|
+
- vendor/httpclient/lib/httpclient/version.rb
|
92
|
+
- vendor/httpclient/lib/oauthclient.rb
|
93
|
+
- vendor/httpclient/sample/async.rb
|
94
|
+
- vendor/httpclient/sample/auth.rb
|
95
|
+
- vendor/httpclient/sample/cookie.rb
|
96
|
+
- vendor/httpclient/sample/dav.rb
|
97
|
+
- vendor/httpclient/sample/howto.rb
|
98
|
+
- vendor/httpclient/sample/oauth_buzz.rb
|
99
|
+
- vendor/httpclient/sample/oauth_friendfeed.rb
|
100
|
+
- vendor/httpclient/sample/oauth_salesforce_10.rb
|
101
|
+
- vendor/httpclient/sample/oauth_twitter.rb
|
102
|
+
- vendor/httpclient/sample/ssl/0cert.pem
|
103
|
+
- vendor/httpclient/sample/ssl/0key.pem
|
104
|
+
- vendor/httpclient/sample/ssl/1000cert.pem
|
105
|
+
- vendor/httpclient/sample/ssl/1000key.pem
|
106
|
+
- vendor/httpclient/sample/ssl/htdocs/index.html
|
107
|
+
- vendor/httpclient/sample/ssl/ssl_client.rb
|
108
|
+
- vendor/httpclient/sample/ssl/webrick_httpsd.rb
|
109
|
+
- vendor/httpclient/sample/stream.rb
|
110
|
+
- vendor/httpclient/sample/thread.rb
|
111
|
+
- vendor/httpclient/sample/wcat.rb
|
112
|
+
- vendor/httpclient/test/ca-chain.cert
|
113
|
+
- vendor/httpclient/test/ca.cert
|
114
|
+
- vendor/httpclient/test/client.cert
|
115
|
+
- vendor/httpclient/test/client.key
|
116
|
+
- vendor/httpclient/test/helper.rb
|
117
|
+
- vendor/httpclient/test/htdigest
|
118
|
+
- vendor/httpclient/test/htpasswd
|
119
|
+
- vendor/httpclient/test/runner.rb
|
120
|
+
- vendor/httpclient/test/server.cert
|
121
|
+
- vendor/httpclient/test/server.key
|
122
|
+
- vendor/httpclient/test/sslsvr.rb
|
123
|
+
- vendor/httpclient/test/subca.cert
|
124
|
+
- vendor/httpclient/test/test_auth.rb
|
125
|
+
- vendor/httpclient/test/test_cookie.rb
|
126
|
+
- vendor/httpclient/test/test_hexdump.rb
|
127
|
+
- vendor/httpclient/test/test_http-access2.rb
|
128
|
+
- vendor/httpclient/test/test_httpclient.rb
|
129
|
+
- vendor/httpclient/test/test_include_client.rb
|
130
|
+
- vendor/httpclient/test/test_ssl.rb
|
131
|
+
- vendor/multi_json/.document
|
132
|
+
- vendor/multi_json/.rspec
|
133
|
+
- vendor/multi_json/.travis.yml
|
134
|
+
- vendor/multi_json/.yardopts
|
135
|
+
- vendor/multi_json/CHANGELOG.md
|
136
|
+
- vendor/multi_json/CONTRIBUTING.md
|
137
|
+
- vendor/multi_json/Gemfile
|
138
|
+
- vendor/multi_json/LICENSE.md
|
139
|
+
- vendor/multi_json/README.md
|
140
|
+
- vendor/multi_json/Rakefile
|
141
|
+
- vendor/multi_json/lib/multi_json.rb
|
142
|
+
- vendor/multi_json/lib/multi_json/adapter.rb
|
143
|
+
- vendor/multi_json/lib/multi_json/adapters/gson.rb
|
144
|
+
- vendor/multi_json/lib/multi_json/adapters/jr_jackson.rb
|
145
|
+
- vendor/multi_json/lib/multi_json/adapters/json_common.rb
|
146
|
+
- vendor/multi_json/lib/multi_json/adapters/json_gem.rb
|
147
|
+
- vendor/multi_json/lib/multi_json/adapters/json_pure.rb
|
148
|
+
- vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb
|
149
|
+
- vendor/multi_json/lib/multi_json/adapters/oj.rb
|
150
|
+
- vendor/multi_json/lib/multi_json/adapters/ok_json.rb
|
151
|
+
- vendor/multi_json/lib/multi_json/adapters/yajl.rb
|
152
|
+
- vendor/multi_json/lib/multi_json/convertible_hash_keys.rb
|
153
|
+
- vendor/multi_json/lib/multi_json/load_error.rb
|
154
|
+
- vendor/multi_json/lib/multi_json/options.rb
|
155
|
+
- vendor/multi_json/lib/multi_json/vendor/okjson.rb
|
156
|
+
- vendor/multi_json/lib/multi_json/version.rb
|
157
|
+
- vendor/multi_json/multi_json.gemspec
|
158
|
+
- vendor/multi_json/spec/adapter_shared_example.rb
|
159
|
+
- vendor/multi_json/spec/has_options.rb
|
160
|
+
- vendor/multi_json/spec/helper.rb
|
161
|
+
- vendor/multi_json/spec/json_common_shared_example.rb
|
162
|
+
- vendor/multi_json/spec/multi_json_spec.rb
|
163
|
+
- vendor/pusher/.document
|
164
|
+
- vendor/pusher/.gemtest
|
165
|
+
- vendor/pusher/.gitignore
|
166
|
+
- vendor/pusher/.travis.yml
|
167
|
+
- vendor/pusher/Gemfile
|
168
|
+
- vendor/pusher/LICENSE
|
169
|
+
- vendor/pusher/README.md
|
170
|
+
- vendor/pusher/Rakefile
|
171
|
+
- vendor/pusher/examples/async_message.rb
|
172
|
+
- vendor/pusher/lib/pusher.rb
|
173
|
+
- vendor/pusher/lib/pusher/channel.rb
|
174
|
+
- vendor/pusher/lib/pusher/client.rb
|
175
|
+
- vendor/pusher/lib/pusher/request.rb
|
176
|
+
- vendor/pusher/lib/pusher/resource.rb
|
177
|
+
- vendor/pusher/lib/pusher/webhook.rb
|
178
|
+
- vendor/pusher/pusher.gemspec
|
179
|
+
- vendor/pusher/spec/channel_spec.rb
|
180
|
+
- vendor/pusher/spec/client_spec.rb
|
181
|
+
- vendor/pusher/spec/spec_helper.rb
|
182
|
+
- vendor/pusher/spec/web_hook_spec.rb
|
206
183
|
- vendor/signature/.gitignore
|
184
|
+
- vendor/signature/.travis.yml
|
207
185
|
- vendor/signature/Gemfile
|
208
186
|
- vendor/signature/LICENSE
|
209
187
|
- vendor/signature/README.md
|
210
188
|
- vendor/signature/Rakefile
|
211
|
-
- vendor/signature/VERSION
|
212
189
|
- vendor/signature/lib/signature.rb
|
190
|
+
- vendor/signature/lib/signature/query_encoder.rb
|
213
191
|
- vendor/signature/lib/signature/version.rb
|
214
192
|
- vendor/signature/signature.gemspec
|
215
193
|
- vendor/signature/spec/signature_spec.rb
|
@@ -227,18 +205,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
227
205
|
- - ! '>='
|
228
206
|
- !ruby/object:Gem::Version
|
229
207
|
version: '0'
|
230
|
-
segments:
|
231
|
-
- 0
|
232
|
-
hash: -2051011438505824188
|
233
208
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
209
|
none: false
|
235
210
|
requirements:
|
236
|
-
- - ! '
|
211
|
+
- - ! '>'
|
237
212
|
- !ruby/object:Gem::Version
|
238
|
-
version:
|
239
|
-
segments:
|
240
|
-
- 0
|
241
|
-
hash: -2051011438505824188
|
213
|
+
version: 1.3.1
|
242
214
|
requirements: []
|
243
215
|
rubyforge_project: scout
|
244
216
|
rubygems_version: 1.8.25
|
@@ -247,4 +219,7 @@ specification_version: 3
|
|
247
219
|
summary: Scout is an easy-to-use hosted server monitoring service. The scout Ruby
|
248
220
|
gem reports metrics to our service. The agent runs plugins, configured via the Scout
|
249
221
|
web interface, to monitor a server.
|
250
|
-
test_files:
|
222
|
+
test_files:
|
223
|
+
- test/plugins/disk_usage.rb
|
224
|
+
- test/scout_test.rb
|
225
|
+
has_rdoc:
|