rsmp 0.14.0 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -3
- data/lib/rsmp/cli.rb +2 -2
- data/lib/rsmp/message.rb +2 -2
- data/lib/rsmp/proxy.rb +4 -4
- data/lib/rsmp/site.rb +1 -1
- data/lib/rsmp/site_proxy.rb +3 -3
- data/lib/rsmp/supervisor.rb +2 -2
- data/lib/rsmp/supervisor_proxy.rb +1 -1
- data/lib/rsmp/version.rb +1 -1
- data/rsmp.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c07e65e3ac7d42b90156c102853bcc8032fff95f11f6022ee14e3357244e6d3
|
4
|
+
data.tar.gz: '0999a7324481ab082047399b959d62afea347952eca6ec3f589292ba90eb62d1'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8de8c0d2a6e43612d78a9546d2de3d7da8130a6901f5d84d7d9b5ba1336bef99960bd4b27e1cb345dd5fe3ec2e5e15f1622f241ab66501adac18b23987a00350
|
7
|
+
data.tar.gz: 37324e18e9440e1727dbf7313dbc8bdd9c02c2ad256f09fab416ec49dda90b808f56270f332365ece5b15ab50c1b638d7583d1e5b8b73915d91bba38c3c32d02
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rsmp (0.14.
|
4
|
+
rsmp (0.14.3)
|
5
5
|
async (~> 1.30.3)
|
6
6
|
async-io (~> 1.33.0)
|
7
7
|
colorize (~> 0.8.1)
|
8
|
-
|
8
|
+
rsmp_schema (~> 0.2.0)
|
9
9
|
thor (~> 1.2.1)
|
10
10
|
|
11
11
|
GEM
|
@@ -80,8 +80,9 @@ GEM
|
|
80
80
|
nio4r (2.5.8)
|
81
81
|
rake (13.0.6)
|
82
82
|
regexp_parser (2.5.0)
|
83
|
-
|
83
|
+
rsmp_schema (0.2.0)
|
84
84
|
json_schemer (~> 0.2.21)
|
85
|
+
thor (~> 1.2.1)
|
85
86
|
rspec (3.10.0)
|
86
87
|
rspec-core (~> 3.10.0)
|
87
88
|
rspec-expectations (~> 3.10.0)
|
data/lib/rsmp/cli.rb
CHANGED
@@ -74,9 +74,9 @@ module RSMP
|
|
74
74
|
end
|
75
75
|
rescue Interrupt
|
76
76
|
# cntr-c
|
77
|
-
rescue RSMP::
|
77
|
+
rescue RSMP::Schema::UnknownSchemaTypeError => e
|
78
78
|
puts "Cannot start site: #{e}"
|
79
|
-
rescue RSMP::
|
79
|
+
rescue RSMP::Schema::UnknownSchemaVersionError => e
|
80
80
|
puts "Cannot start site: #{e}"
|
81
81
|
rescue Psych::SyntaxError => e
|
82
82
|
puts "Cannot read config file #{e}"
|
data/lib/rsmp/message.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rsmp_schema'
|
2
2
|
|
3
3
|
# rsmp messages
|
4
4
|
module RSMP
|
@@ -146,7 +146,7 @@ module RSMP
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def validate schemas
|
149
|
-
errors = RSMP::
|
149
|
+
errors = RSMP::Schema.validate attributes, schemas
|
150
150
|
if errors
|
151
151
|
error_string = errors.map {|item| item.reject {|e| e=='' } }.compact.join(', ').strip
|
152
152
|
raise SchemaError.new error_string
|
data/lib/rsmp/proxy.rb
CHANGED
@@ -230,7 +230,7 @@ module RSMP
|
|
230
230
|
begin
|
231
231
|
now = Clock.now
|
232
232
|
timer(now)
|
233
|
-
rescue RSMP::
|
233
|
+
rescue RSMP::Schema::Error => e
|
234
234
|
log "Timer: Schema error: #{e}", level: :warning
|
235
235
|
rescue EOFError => e
|
236
236
|
log "Timer: Connection closed: #{e}", level: :warning
|
@@ -319,7 +319,7 @@ module RSMP
|
|
319
319
|
# TODO
|
320
320
|
# what schema should we use to validate the intial Version and MessageAck messages?
|
321
321
|
schemas = { core: '3.1.5' }
|
322
|
-
schemas[sxl] = RSMP::
|
322
|
+
schemas[sxl] = RSMP::Schema.sanitize_version(sxl_version) if sxl && sxl_version
|
323
323
|
schemas
|
324
324
|
end
|
325
325
|
|
@@ -335,7 +335,7 @@ module RSMP
|
|
335
335
|
log_send message, reason
|
336
336
|
rescue EOFError, IOError
|
337
337
|
buffer_message message
|
338
|
-
rescue SchemaError, RSMP::
|
338
|
+
rescue SchemaError, RSMP::Schema::Error => e
|
339
339
|
str = "Could not send #{message.type} because schema validation failed: #{e.message}"
|
340
340
|
log str, message: message, level: :error
|
341
341
|
notify_error e.exception("#{str} #{message.json}")
|
@@ -398,7 +398,7 @@ module RSMP
|
|
398
398
|
log str, message: Malformed.new(attributes), level: :warning
|
399
399
|
# cannot send NotAcknowledged for a malformed message since we can't read it, just ignore it
|
400
400
|
nil
|
401
|
-
rescue SchemaError, RSMP::
|
401
|
+
rescue SchemaError, RSMP::Schema::Error => e
|
402
402
|
reason = "schema errors: #{e.message}"
|
403
403
|
str = "Received invalid #{message.type}, #{reason}"
|
404
404
|
log str, message: message, level: :warning
|
data/lib/rsmp/site.rb
CHANGED
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -47,7 +47,7 @@ module RSMP
|
|
47
47
|
|
48
48
|
def handshake_complete
|
49
49
|
super
|
50
|
-
sanitized_sxl_version = RSMP::
|
50
|
+
sanitized_sxl_version = RSMP::Schema.sanitize_version(@site_sxl_version)
|
51
51
|
log "Connection to site #{@site_id} established, using core #{@rsmp_version}, #{@sxl} #{sanitized_sxl_version}", level: :log
|
52
52
|
start_watchdog
|
53
53
|
end
|
@@ -314,12 +314,12 @@ module RSMP
|
|
314
314
|
# comes from the Version message send by the site
|
315
315
|
type = 'tlc'
|
316
316
|
version = message.attribute 'SXL'
|
317
|
-
RSMP::
|
317
|
+
RSMP::Schema::find_schema! type, version, lenient: true
|
318
318
|
|
319
319
|
# store sxl version requested by site
|
320
320
|
# TODO should check agaist site settings
|
321
321
|
@site_sxl_version = message.attribute 'SXL'
|
322
|
-
rescue RSMP::
|
322
|
+
rescue RSMP::Schema::UnknownSchemaError => e
|
323
323
|
dont_acknowledge message, "Rejected #{message.type} message,", "#{e}"
|
324
324
|
end
|
325
325
|
|
data/lib/rsmp/supervisor.rb
CHANGED
@@ -52,8 +52,8 @@ module RSMP
|
|
52
52
|
unless sxl
|
53
53
|
raise RSMP::ConfigurationError.new("Configuration error for site '#{site_id}': No SXL specified")
|
54
54
|
end
|
55
|
-
RSMP::
|
56
|
-
rescue RSMP::
|
55
|
+
RSMP::Schema.find_schemas! sxl if sxl
|
56
|
+
rescue RSMP::Schema::UnknownSchemaError => e
|
57
57
|
raise RSMP::ConfigurationError.new("Configuration error for site '#{site_id}': #{e}")
|
58
58
|
end
|
59
59
|
end
|
@@ -82,7 +82,7 @@ module RSMP
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def handshake_complete
|
85
|
-
sanitized_sxl_version = RSMP::
|
85
|
+
sanitized_sxl_version = RSMP::Schema.sanitize_version(sxl_version)
|
86
86
|
log "Connection to supervisor established, using core #{@rsmp_version}, #{sxl} #{sanitized_sxl_version}", level: :info
|
87
87
|
start_watchdog
|
88
88
|
if @site_settings['send_after_connect']
|
data/lib/rsmp/version.rb
CHANGED
data/rsmp.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "async-io", "~> 1.33.0"
|
35
35
|
spec.add_dependency "colorize", "~> 0.8.1"
|
36
36
|
spec.add_dependency "thor", "~> 1.2.1"
|
37
|
-
spec.add_dependency "
|
37
|
+
spec.add_dependency "rsmp_schema", "~> 0.2.0"
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", "~> 2.3.7"
|
40
40
|
spec.add_development_dependency "rake", "~> 13.0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -67,19 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.2.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rsmp_schema
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.2.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|