arachni-rpc 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -3
- data/LICENSE.md +1 -1
- data/README.md +28 -34
- data/Rakefile +16 -19
- data/lib/arachni/rpc.rb +4 -8
- data/lib/arachni/rpc/client.rb +236 -0
- data/lib/arachni/rpc/client/handler.rb +167 -0
- data/lib/arachni/rpc/exceptions.rb +14 -38
- data/lib/arachni/rpc/message.rb +7 -15
- data/lib/arachni/rpc/protocol.rb +103 -0
- data/lib/arachni/rpc/proxy.rb +86 -0
- data/lib/arachni/rpc/request.rb +18 -36
- data/lib/arachni/rpc/response.rb +21 -35
- data/lib/arachni/rpc/server.rb +278 -0
- data/lib/arachni/rpc/server/handler.rb +145 -0
- data/lib/arachni/rpc/version.rb +3 -1
- data/spec/arachni/rpc/client_spec.rb +400 -0
- data/spec/arachni/rpc/exceptions_spec.rb +77 -0
- data/spec/arachni/rpc/message_spec.rb +47 -0
- data/spec/arachni/rpc/proxy_spec.rb +99 -0
- data/spec/arachni/rpc/request_spec.rb +53 -0
- data/spec/arachni/rpc/response_spec.rb +49 -0
- data/spec/arachni/rpc/server_spec.rb +129 -0
- data/spec/pems/cacert.pem +37 -0
- data/spec/pems/client/cert.pem +37 -0
- data/spec/pems/client/foo-cert.pem +39 -0
- data/spec/pems/client/foo-key.pem +51 -0
- data/spec/pems/client/key.pem +51 -0
- data/spec/pems/server/cert.pem +37 -0
- data/spec/pems/server/key.pem +51 -0
- data/spec/servers/basic.rb +3 -0
- data/spec/servers/server.rb +83 -0
- data/spec/servers/unix_socket.rb +8 -0
- data/spec/servers/with_ssl_primitives.rb +11 -0
- data/spec/spec_helper.rb +39 -0
- metadata +78 -21
- data/lib/arachni/rpc/remote_object_mapper.rb +0 -65
metadata
CHANGED
@@ -1,19 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arachni-rpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tasos Laskos
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: arachni-reactor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0.beta2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0.beta2
|
27
|
+
description: |2
|
28
|
+
Arachni::RPC is a simple and lightweight Remote Procedure Call protocol
|
29
|
+
used to provide the basis for Arachni's distributed infrastructure.
|
30
|
+
email: tasos.laskos@arachni-scanner.com
|
17
31
|
executables: []
|
18
32
|
extensions: []
|
19
33
|
extra_rdoc_files:
|
@@ -21,40 +35,83 @@ extra_rdoc_files:
|
|
21
35
|
- LICENSE.md
|
22
36
|
- CHANGELOG.md
|
23
37
|
files:
|
38
|
+
- CHANGELOG.md
|
39
|
+
- LICENSE.md
|
24
40
|
- README.md
|
25
41
|
- Rakefile
|
26
|
-
- LICENSE.md
|
27
|
-
- CHANGELOG.md
|
28
42
|
- lib/arachni/rpc.rb
|
43
|
+
- lib/arachni/rpc/client.rb
|
44
|
+
- lib/arachni/rpc/client/handler.rb
|
45
|
+
- lib/arachni/rpc/exceptions.rb
|
29
46
|
- lib/arachni/rpc/message.rb
|
30
|
-
- lib/arachni/rpc/
|
47
|
+
- lib/arachni/rpc/protocol.rb
|
48
|
+
- lib/arachni/rpc/proxy.rb
|
31
49
|
- lib/arachni/rpc/request.rb
|
50
|
+
- lib/arachni/rpc/response.rb
|
51
|
+
- lib/arachni/rpc/server.rb
|
52
|
+
- lib/arachni/rpc/server/handler.rb
|
32
53
|
- lib/arachni/rpc/version.rb
|
33
|
-
-
|
34
|
-
-
|
54
|
+
- spec/arachni/rpc/client_spec.rb
|
55
|
+
- spec/arachni/rpc/exceptions_spec.rb
|
56
|
+
- spec/arachni/rpc/message_spec.rb
|
57
|
+
- spec/arachni/rpc/proxy_spec.rb
|
58
|
+
- spec/arachni/rpc/request_spec.rb
|
59
|
+
- spec/arachni/rpc/response_spec.rb
|
60
|
+
- spec/arachni/rpc/server_spec.rb
|
61
|
+
- spec/pems/cacert.pem
|
62
|
+
- spec/pems/client/cert.pem
|
63
|
+
- spec/pems/client/foo-cert.pem
|
64
|
+
- spec/pems/client/foo-key.pem
|
65
|
+
- spec/pems/client/key.pem
|
66
|
+
- spec/pems/server/cert.pem
|
67
|
+
- spec/pems/server/key.pem
|
68
|
+
- spec/servers/basic.rb
|
69
|
+
- spec/servers/server.rb
|
70
|
+
- spec/servers/unix_socket.rb
|
71
|
+
- spec/servers/with_ssl_primitives.rb
|
72
|
+
- spec/spec_helper.rb
|
35
73
|
homepage: https://github.com/Arachni/arachni-rpc
|
36
74
|
licenses: []
|
75
|
+
metadata: {}
|
37
76
|
post_install_message:
|
38
77
|
rdoc_options:
|
39
|
-
- --charset=UTF-8
|
78
|
+
- "--charset=UTF-8"
|
40
79
|
require_paths:
|
41
80
|
- lib
|
42
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
82
|
requirements:
|
45
|
-
- -
|
83
|
+
- - ">="
|
46
84
|
- !ruby/object:Gem::Version
|
47
85
|
version: '0'
|
48
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
87
|
requirements:
|
51
|
-
- -
|
88
|
+
- - ">="
|
52
89
|
- !ruby/object:Gem::Version
|
53
90
|
version: '0'
|
54
91
|
requirements: []
|
55
92
|
rubyforge_project:
|
56
|
-
rubygems_version:
|
93
|
+
rubygems_version: 2.2.2
|
57
94
|
signing_key:
|
58
|
-
specification_version:
|
59
|
-
summary: The RPC protocol
|
60
|
-
test_files:
|
95
|
+
specification_version: 4
|
96
|
+
summary: The RPC protocol of the Arachni Framework.
|
97
|
+
test_files:
|
98
|
+
- spec/pems/server/cert.pem
|
99
|
+
- spec/pems/server/key.pem
|
100
|
+
- spec/pems/cacert.pem
|
101
|
+
- spec/pems/client/foo-key.pem
|
102
|
+
- spec/pems/client/cert.pem
|
103
|
+
- spec/pems/client/foo-cert.pem
|
104
|
+
- spec/pems/client/key.pem
|
105
|
+
- spec/servers/with_ssl_primitives.rb
|
106
|
+
- spec/servers/unix_socket.rb
|
107
|
+
- spec/servers/server.rb
|
108
|
+
- spec/servers/basic.rb
|
109
|
+
- spec/spec_helper.rb
|
110
|
+
- spec/arachni/rpc/client_spec.rb
|
111
|
+
- spec/arachni/rpc/server_spec.rb
|
112
|
+
- spec/arachni/rpc/request_spec.rb
|
113
|
+
- spec/arachni/rpc/message_spec.rb
|
114
|
+
- spec/arachni/rpc/response_spec.rb
|
115
|
+
- spec/arachni/rpc/exceptions_spec.rb
|
116
|
+
- spec/arachni/rpc/proxy_spec.rb
|
117
|
+
has_rdoc:
|
@@ -1,65 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
This file is part of the Arachni-RPC project and may be subject to
|
4
|
-
redistribution and commercial restrictions. Please see the Arachni-RPC
|
5
|
-
web site for more information on licensing and terms of use.
|
6
|
-
|
7
|
-
=end
|
8
|
-
|
9
|
-
require File.join( File.expand_path( File.dirname( __FILE__ ) ), '../', 'rpc' )
|
10
|
-
|
11
|
-
module Arachni
|
12
|
-
module RPC
|
13
|
-
|
14
|
-
#
|
15
|
-
# Maps the methods of remote objects to local ones.
|
16
|
-
# (Well, not really, it just passes the message along to the remote end.)
|
17
|
-
#
|
18
|
-
# You start like:
|
19
|
-
#
|
20
|
-
# server = Arachni::RPC::EM::Client.new( host: 'localhost', port: 7331 )
|
21
|
-
# bench = Arachni::RPC::EM::Client::Mapper.new( server, 'bench' )
|
22
|
-
#
|
23
|
-
# And it allows you to do this:
|
24
|
-
#
|
25
|
-
# res = bench.foo( 1, 2, 3 )
|
26
|
-
#
|
27
|
-
# Instead of:
|
28
|
-
#
|
29
|
-
# res = client.call( 'bench.foo', 1, 2, 3 )
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
# The server on the other end must have an appropriate handler set, like:
|
34
|
-
#
|
35
|
-
# class Bench
|
36
|
-
# def foo( i = 0 )
|
37
|
-
# return i
|
38
|
-
# end
|
39
|
-
# end
|
40
|
-
#
|
41
|
-
# server = Arachni::RPC::EM::Server.new( host: 'localhost', port: 7331 )
|
42
|
-
# server.add_handler( 'bench', Bench.new )
|
43
|
-
#
|
44
|
-
# @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
45
|
-
#
|
46
|
-
class RemoteObjectMapper
|
47
|
-
|
48
|
-
def initialize( server, remote )
|
49
|
-
@server = server
|
50
|
-
@remote = remote
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
#
|
55
|
-
# Used to provide the illusion of locality for remote methods
|
56
|
-
#
|
57
|
-
def method_missing( sym, *args, &block )
|
58
|
-
call = "#{@remote}.#{sym.to_s}"
|
59
|
-
@server.call( call, *args, &block )
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
end
|