toq 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df57199bce2860cafef61cf558ee8eea2cb94efeab9806fb5002ac78a34ef2a1
4
- data.tar.gz: 1670a993e6ca14243261c93b842922fc7e13693e0a75ad8b253a7587aa2bb872
3
+ metadata.gz: 6fa9dccb95205fadf37ce8a48a133f6e08f5c1f5d07f2377041562c3a08e39b3
4
+ data.tar.gz: d0ed2e661f09eda4815eed365c3397fa920192e8c42e8cc55109733d66229c71
5
5
  SHA512:
6
- metadata.gz: f0a17a14f25fdb789f1f392f5bad5423f37463af374c0990309bd222d94d4a695bc3c6bfacafbbef489bf3e9fadabf67a76aab65c0e203c28fd57e519096d869
7
- data.tar.gz: c505a2951bc684333949eee1add6cbd89fc7ffffa1645f7c471ca0e0889a0fb36dcdfb9b42fa7185f427f13d3c00400eec37faa742c0531105d616cfe4c09e16
6
+ metadata.gz: 795adb9468a8b873b8c9f8fe41726368eb2314abf531f8d011d6606fbe519b011ccf0ceb10e5a52682b6ed4dee6b7abd14acd6b913357a5e6f31c81c201d8ac1
7
+ data.tar.gz: 26a6fbf1afa05c8cc0d8702bdc0e40a0597ff26c235c71ca0e079b33f0686f99990d2a102927281690f49c506503d114f8306d30a6621257245f55e5acf9801c
data/CHANGELOG.md CHANGED
@@ -1 +1,5 @@
1
1
  # ChangeLog
2
+
3
+ # 0.0.3
4
+
5
+ - Don't whitelist public methods, they could have changed dynamically after server start.
data/lib/toq/client.rb CHANGED
@@ -200,9 +200,7 @@ class Client
200
200
  def set_exception( req, e )
201
201
  msg = @socket ? " for '#{@socket}'." : " for '#{@host}:#{@port}'."
202
202
 
203
- exc = (e.is_a?( Raktr::Connection::Error::SSL ) ?
204
- Exceptions::SSLPeerVerificationFailed : Exceptions::ConnectionError
205
- ).new( e.to_s + msg )
203
+ exc = Exceptions::ConnectionError.new( e.to_s + msg )
206
204
 
207
205
  exc.set_backtrace e.backtrace
208
206
  req.callback.call exc
data/lib/toq/server.rb CHANGED
@@ -133,7 +133,6 @@ class Server
133
133
  @async_methods[name] = Set.new
134
134
 
135
135
  obj.class.public_instance_methods( false ).each do |method|
136
- @methods[name] << method.to_s
137
136
  @async_methods[name] << method.to_s if async_check( obj.method( method ) )
138
137
  end
139
138
  end
@@ -190,12 +189,6 @@ class Server
190
189
  raise Exceptions::InvalidObject.new( msg )
191
190
  end
192
191
 
193
- if !public_method?( obj_name, meth_name )
194
- msg = "Trying to access non-public method '#{meth_name}'."
195
- @logger.error( 'Call' ){ msg + " [on behalf of #{peer_ip_addr}]" }
196
- raise Exceptions::InvalidMethod.new( msg )
197
- end
198
-
199
192
  # The handler needs to know if this is an async call because if it is
200
193
  # we'll have already send the response and it doesn't need to do
201
194
  # transmit anything.
@@ -267,10 +260,6 @@ class Server
267
260
  @objects[obj_name] ? true : false
268
261
  end
269
262
 
270
- def public_method?( obj_name, method )
271
- @methods[obj_name].include?( method )
272
- end
273
-
274
263
  end
275
264
 
276
265
  end
data/lib/toq/version.rb CHANGED
@@ -8,6 +8,6 @@
8
8
 
9
9
  module Toq
10
10
 
11
- VERSION = '0.0.2'
11
+ VERSION = '0.0.3'
12
12
 
13
13
  end
@@ -261,23 +261,6 @@ describe Toq::Client do
261
261
  end
262
262
  end
263
263
 
264
- context 'and requesting a non-public method' do
265
- let(:remote_method) { 'bar' }
266
-
267
- it "returns #{Toq::Exceptions::InvalidMethod}" do
268
- response = nil
269
-
270
- call do |res|
271
- response = res
272
- Raktr.stop
273
- end
274
- wait
275
-
276
- response.should be_rpc_invalid_method_error
277
- response.should be_kind_of Toq::Exceptions::InvalidMethod
278
- end
279
- end
280
-
281
264
  context 'and there is a remote exception' do
282
265
  let(:remote_method) { :exception }
283
266
 
@@ -322,19 +305,6 @@ describe Toq::Client do
322
305
  end
323
306
  end
324
307
 
325
- context 'and requesting a non-public method' do
326
- let(:remote_method) { 'bar' }
327
-
328
- it "raises #{Toq::Exceptions::InvalidMethod}" do
329
- begin
330
- call
331
- rescue => e
332
- e.rpc_invalid_method_error?.should be_true
333
- e.should be_kind_of Toq::Exceptions::InvalidMethod
334
- end
335
- end
336
- end
337
-
338
308
  context 'and there is a remote exception' do
339
309
  let(:remote_method) { :exception }
340
310
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tasos Laskos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-14 00:00:00.000000000 Z
11
+ date: 2022-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raktr