wampproto 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +39 -0
  4. data/CHANGELOG.md +5 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/LICENSE +22 -0
  7. data/README.md +35 -0
  8. data/Rakefile +12 -0
  9. data/Steepfile +33 -0
  10. data/lib/wampproto/acceptor/authenticator.rb +14 -0
  11. data/lib/wampproto/acceptor/request.rb +58 -0
  12. data/lib/wampproto/acceptor/response.rb +19 -0
  13. data/lib/wampproto/acceptor.rb +183 -0
  14. data/lib/wampproto/auth/anonymous.rb +14 -0
  15. data/lib/wampproto/auth/base.rb +20 -0
  16. data/lib/wampproto/auth/cra.rb +84 -0
  17. data/lib/wampproto/auth/cryptosign.rb +86 -0
  18. data/lib/wampproto/auth/helpers.rb +25 -0
  19. data/lib/wampproto/auth/ticket.rb +27 -0
  20. data/lib/wampproto/auth.rb +14 -0
  21. data/lib/wampproto/broker.rb +155 -0
  22. data/lib/wampproto/dealer.rb +143 -0
  23. data/lib/wampproto/id_generator.rb +23 -0
  24. data/lib/wampproto/joiner.rb +78 -0
  25. data/lib/wampproto/message/abort.rb +32 -0
  26. data/lib/wampproto/message/authenticate.rb +25 -0
  27. data/lib/wampproto/message/base.rb +30 -0
  28. data/lib/wampproto/message/call.rb +33 -0
  29. data/lib/wampproto/message/challenge.rb +25 -0
  30. data/lib/wampproto/message/error.rb +27 -0
  31. data/lib/wampproto/message/event.rb +33 -0
  32. data/lib/wampproto/message/goodbye.rb +25 -0
  33. data/lib/wampproto/message/hello.rb +64 -0
  34. data/lib/wampproto/message/invocation.rb +33 -0
  35. data/lib/wampproto/message/publish.rb +33 -0
  36. data/lib/wampproto/message/published.rb +25 -0
  37. data/lib/wampproto/message/register.rb +26 -0
  38. data/lib/wampproto/message/registered.rb +25 -0
  39. data/lib/wampproto/message/result.rb +32 -0
  40. data/lib/wampproto/message/subscribe.rb +26 -0
  41. data/lib/wampproto/message/subscribed.rb +25 -0
  42. data/lib/wampproto/message/unregister.rb +25 -0
  43. data/lib/wampproto/message/unregistered.rb +24 -0
  44. data/lib/wampproto/message/unsubscribe.rb +25 -0
  45. data/lib/wampproto/message/unsubscribed.rb +24 -0
  46. data/lib/wampproto/message/welcome.rb +41 -0
  47. data/lib/wampproto/message/yield.rb +32 -0
  48. data/lib/wampproto/message.rb +108 -0
  49. data/lib/wampproto/message_with_recipient.rb +13 -0
  50. data/lib/wampproto/serializer/cbor.rb +18 -0
  51. data/lib/wampproto/serializer/json.rb +18 -0
  52. data/lib/wampproto/serializer/msgpack.rb +18 -0
  53. data/lib/wampproto/serializer.rb +5 -0
  54. data/lib/wampproto/session.rb +144 -0
  55. data/lib/wampproto/session_details.rb +24 -0
  56. data/lib/wampproto/validate.rb +52 -0
  57. data/lib/wampproto/version.rb +5 -0
  58. data/lib/wampproto.rb +32 -0
  59. data/sig/cbor.rbs +5 -0
  60. data/sig/ed25519/signing_key.rbs +7 -0
  61. data/sig/ed25519/verify_key.rbs +7 -0
  62. data/sig/message_pack.rbs +5 -0
  63. data/sig/wampproto/acceptor/authenticator.rbs +9 -0
  64. data/sig/wampproto/acceptor/request.rbs +46 -0
  65. data/sig/wampproto/acceptor/response.rbs +25 -0
  66. data/sig/wampproto/acceptor.rbs +86 -0
  67. data/sig/wampproto/auth/anonymous.rbs +13 -0
  68. data/sig/wampproto/auth/base.rbs +25 -0
  69. data/sig/wampproto/auth/cra.rbs +34 -0
  70. data/sig/wampproto/auth/cryptosign.rbs +38 -0
  71. data/sig/wampproto/auth/helpers.rbs +16 -0
  72. data/sig/wampproto/auth/ticket.rbs +21 -0
  73. data/sig/wampproto/broker.rbs +48 -0
  74. data/sig/wampproto/dealer.rbs +49 -0
  75. data/sig/wampproto/id_generator.rbs +17 -0
  76. data/sig/wampproto/joiner.rbs +43 -0
  77. data/sig/wampproto/message/abort.rbs +31 -0
  78. data/sig/wampproto/message/authenticate.rbs +20 -0
  79. data/sig/wampproto/message/base.rbs +14 -0
  80. data/sig/wampproto/message/call.rbs +34 -0
  81. data/sig/wampproto/message/challenge.rbs +20 -0
  82. data/sig/wampproto/message/error.rbs +28 -0
  83. data/sig/wampproto/message/event.rbs +34 -0
  84. data/sig/wampproto/message/goodbye.rbs +21 -0
  85. data/sig/wampproto/message/hello.rbs +39 -0
  86. data/sig/wampproto/message/invocation.rbs +34 -0
  87. data/sig/wampproto/message/publish.rbs +32 -0
  88. data/sig/wampproto/message/published.rbs +20 -0
  89. data/sig/wampproto/message/register.rbs +24 -0
  90. data/sig/wampproto/message/registered.rbs +20 -0
  91. data/sig/wampproto/message/result.rbs +32 -0
  92. data/sig/wampproto/message/subscribe.rbs +24 -0
  93. data/sig/wampproto/message/subscribed.rbs +20 -0
  94. data/sig/wampproto/message/unregister.rbs +20 -0
  95. data/sig/wampproto/message/unregistered.rbs +16 -0
  96. data/sig/wampproto/message/unsubscribe.rbs +20 -0
  97. data/sig/wampproto/message/unsubscribed.rbs +16 -0
  98. data/sig/wampproto/message/welcome.rbs +36 -0
  99. data/sig/wampproto/message/yield.rbs +30 -0
  100. data/sig/wampproto/message.rbs +59 -0
  101. data/sig/wampproto/message_with_recipient.rbs +15 -0
  102. data/sig/wampproto/serializer/cbor.rbs +10 -0
  103. data/sig/wampproto/serializer/json.rbs +11 -0
  104. data/sig/wampproto/serializer/msgpack.rbs +11 -0
  105. data/sig/wampproto/session.rbs +43 -0
  106. data/sig/wampproto/session_details.rbs +25 -0
  107. data/sig/wampproto/validate.rbs +18 -0
  108. data/sig/wampproto.rbs +17 -0
  109. data/wampproto.gemspec +39 -0
  110. metadata +196 -0
@@ -0,0 +1,34 @@
1
+ module Wampproto
2
+ module Auth
3
+ # generates wampcra authentication signature
4
+ class Cra < Base
5
+ @secret: String
6
+
7
+ attr_reader secret: String
8
+
9
+ include Helpers
10
+ extend Helpers::ClassMethods
11
+
12
+ AUTH_METHOD: "wampcra"
13
+
14
+ def initialize: (String secret, String authid, Hash[Symbol, untyped] authextra) -> void
15
+
16
+ def authenticate: (Message::Challenge challenge) -> Message::Authenticate
17
+
18
+ def self.create_challenge: (Integer session_id, String authid, String authrole, String authprovider) -> String
19
+
20
+ def self.verify_challenge: (String signature, String challenge, String secret, ?String? salt, ?::Integer keylen, ?::Integer iterations) -> bool
21
+
22
+ def self.sign_challenge: (String secret, String challenge, ?String? salt, ?::Integer keylen, ?::Integer iterations) -> String
23
+
24
+ def self.create_derive_secret: (String secret, String salt, Integer length, Integer iterations) -> untyped
25
+
26
+ private
27
+
28
+ def create_signature: (Message::Challenge challenge) -> String
29
+
30
+ def create_drived_secret: (Hash[Symbol, untyped] extra) -> untyped
31
+ end
32
+ end
33
+ end
34
+
@@ -0,0 +1,38 @@
1
+ module Wampproto
2
+ module Auth
3
+ # generates wampcra authentication signature
4
+ class Cryptosign < Base
5
+ @private_key: String
6
+
7
+ @key_pair: untyped
8
+
9
+ include Helpers
10
+ extend Helpers::ClassMethods
11
+
12
+ attr_reader private_key: String
13
+
14
+ attr_accessor channel_id: String
15
+
16
+ AUTH_METHOD: "cryptosign"
17
+
18
+ def initialize: (String private_key, String authid, ?::Hash[Symbol, untyped] authextra) -> void
19
+
20
+ def authenticate: (Wampproto::Message::Challenge challenge) -> Wampproto::Message::Authenticate
21
+
22
+ def self.create_challenge: () -> (::Integer | ::Float | ::String | nil)
23
+
24
+ def self.verify_challenge: (String signature, String msg, String public_key) -> bool
25
+
26
+ def self.sign_challenge: (String private_key, String challenge, ?String? channel_id) -> String
27
+
28
+ def self.create_signature: (String private_key, String challenge, ?String? channel_id) -> untyped
29
+
30
+ def self.handle_without_channel_binding: (String private_key, String hex_challenge) -> ::String
31
+
32
+ def self.handle_channel_binding: (String private_key, String hex_challenge, String channel_id) -> ::String
33
+
34
+ def self.xored_strings: (String channel_id, String challenge_str) -> String
35
+ end
36
+ end
37
+ end
38
+
@@ -0,0 +1,16 @@
1
+ module Wampproto
2
+ # Auth classes
3
+ module Auth
4
+ # Auth Helpers
5
+ module Helpers
6
+ def self.included: (untyped base) -> void
7
+
8
+ # class methods
9
+ module ClassMethods
10
+ def hex_to_binary: (String hex_string) -> String
11
+
12
+ def binary_to_hex: (String binary_string) -> untyped
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module Wampproto
2
+ module Auth
3
+ # generates ticket authentication signature
4
+ class Ticket < Base
5
+ @secret: String
6
+
7
+ AUTH_METHOD: "ticket"
8
+
9
+ attr_reader secret: String
10
+
11
+ def initialize: (String secret, String authid, ?::Hash[Symbol, untyped] authextra) -> void
12
+
13
+ def authenticate: (Message::Challenge challenge) -> Message::Authenticate
14
+
15
+ private
16
+
17
+ def create_signature: (untyped _challenge) -> untyped
18
+ end
19
+ end
20
+ end
21
+
@@ -0,0 +1,48 @@
1
+ module Wampproto
2
+ # Wampproto broker implementation
3
+ class Broker
4
+ @id_gen: untyped
5
+
6
+ @subscriptions_by_session: Hash[Integer, Hash[Integer, String]]
7
+
8
+ @subscriptions_by_topic: Hash[String, Hash[Integer, Array[Integer]]]
9
+
10
+ @sessions: Hash[Integer, SessionDetails]
11
+
12
+ attr_reader subscriptions_by_session: Hash[Integer, Hash[Integer, String]]
13
+
14
+ attr_reader subscriptions_by_topic: Hash[String, Hash[Integer, Array[Integer]]]
15
+
16
+ attr_reader sessions: Hash[Integer, SessionDetails]
17
+
18
+ attr_reader id_gen: IdGenerator
19
+
20
+ def initialize: (?IdGenerator id_gen) -> void
21
+
22
+ def add_session: (SessionDetails session_id) -> untyped
23
+
24
+ def remove_session: (Integer session_id) -> untyped
25
+
26
+ def subscription?: (String topic) -> (false | untyped)
27
+
28
+ def receive_message: (Integer session_id, untyped message) -> untyped
29
+
30
+ def handle_publish: (Integer session_id, Message::Publish message) -> untyped
31
+
32
+ def handle_subscribe: (Integer session_id, Message::Subscribe message) -> untyped
33
+
34
+ def handle_unsubscribe: (Integer session_id, Message::Unsubscribe message) -> untyped
35
+
36
+ private
37
+
38
+ def find_subscription_id_from: (String topic) -> Integer
39
+
40
+ def remove_topic_subscriber: (String topic, Integer subscription_id, Integer session_id) -> untyped
41
+
42
+ def add_topic_subscriber: (String topic, Integer subscription_id, Integer session_id) -> untyped
43
+
44
+ def exclude?: (untyped message, Integer session_id, Integer recipient_id) -> (false | untyped)
45
+
46
+ def event_details_for: (Integer session_id, untyped message) -> Hash[Symbol, untyped]
47
+ end
48
+ end
@@ -0,0 +1,49 @@
1
+ module Wampproto
2
+ # Wamprpoto Dealer handler
3
+ class Dealer
4
+ @registrations_by_session: Hash[Integer, Hash[Integer, String]]
5
+
6
+ @registrations_by_procedure: Hash[String, Hash[Integer, Integer]]
7
+
8
+ @sessions: Hash[Integer, SessionDetails]
9
+
10
+ @pending_calls: Hash[Integer, Hash[Integer, Integer]]
11
+
12
+ @pending_invocations: Hash[Integer, Hash[Integer, Integer]]
13
+
14
+ @id_gen: IdGenerator
15
+
16
+ attr_reader registrations_by_procedure: Hash[String, Hash[Integer, Integer]]
17
+
18
+ attr_reader registrations_by_session: Hash[Integer, Hash[Integer, String]]
19
+
20
+ attr_reader sessions: Hash[Integer, SessionDetails]
21
+
22
+ attr_reader pending_calls: Hash[Integer, Hash[Integer, Integer]]
23
+
24
+ attr_reader pending_invocations: Hash[Integer, Hash[Integer, Integer]]
25
+
26
+ attr_reader id_gen: IdGenerator
27
+
28
+ def initialize: (?IdGenerator id_gen) -> void
29
+
30
+ def add_session: (SessionDetails session_details) -> untyped
31
+
32
+ def remove_session: (Integer session_id) -> untyped
33
+
34
+ def registration?: (String procedure) -> (false | untyped)
35
+
36
+ def receive_message: (Integer session_id, untyped message) -> untyped
37
+
38
+ def handle_call: (Integer session_id, Message::Call message) -> MessageWithRecipient
39
+
40
+ def handle_yield: (Integer session_id, Message::Yield message) -> (nil | MessageWithRecipient)
41
+
42
+ def handle_register: (Integer session_id, Message::Register message) -> (nil | MessageWithRecipient)
43
+
44
+ def handle_unregister: (Integer session_id, Message::Unregister message) -> (nil | MessageWithRecipient)
45
+
46
+ def invocation_details_for: (Integer session_id, untyped message) -> Hash[Symbol, untyped]
47
+ end
48
+ end
49
+
@@ -0,0 +1,17 @@
1
+ module Wampproto
2
+ # ID Generator
3
+ class IdGenerator
4
+ self.@ids: Array[Integer]
5
+
6
+ @id: Integer
7
+
8
+ MAX_ID: Integer
9
+
10
+ def self.generate_session_id: () -> Integer
11
+
12
+ def initialize: () -> void
13
+
14
+ def next: () -> Integer
15
+ end
16
+ end
17
+
@@ -0,0 +1,43 @@
1
+ module Wampproto
2
+ CLIENT_ROLES: { caller: { features: ::Hash[untyped, untyped] }, callee: { features: ::Hash[untyped, untyped] }, publisher: { features: ::Hash[untyped, untyped] }, subscriber: { features: ::Hash[untyped, untyped] } }
3
+
4
+ # Handle Joining part of wamp protocol
5
+ class Joiner
6
+ @realm: String
7
+
8
+ type serializerTypes = (singleton(Serializer::JSON) | singleton(Serializer::Msgpack) | singleton(Serializer::Cbor))
9
+ type authenticatorsType = Auth::Anonymous | Auth::Ticket | Auth::Cra | Auth::Cryptosign
10
+
11
+ @serializer: serializerTypes
12
+
13
+ @authenticator: Auth::Base
14
+
15
+ @state: Integer
16
+
17
+ @session_details: SessionDetails
18
+
19
+ STATE_NONE: 0
20
+
21
+ STATE_HELLO_SENT: 1
22
+
23
+ STATE_AUTHENTICATE_SENT: 2
24
+
25
+ STATE_JOINED: 3
26
+
27
+ attr_reader realm: String
28
+
29
+ attr_reader serializer: serializerTypes
30
+
31
+ attr_reader authenticator: Auth::Base
32
+
33
+ attr_accessor state: Integer
34
+
35
+ def initialize: (String realm, ?serializerTypes serializer, ?authenticatorsType authenticator) -> void
36
+
37
+ def send_hello: () -> (Array[untyped] | String)
38
+
39
+ def receive: (untyped data) -> (nil | untyped)
40
+
41
+ def receive_message: (Message::Base msg) -> (Message::Authenticate | nil | Integer | String)
42
+ end
43
+ end
@@ -0,0 +1,31 @@
1
+ module Wampproto
2
+ module Message
3
+ # abort message
4
+ class Abort < Base
5
+ @details: Hash[Symbol, untyped]
6
+
7
+ @reason: String
8
+
9
+ @args: Array[untyped]
10
+
11
+ @kwargs: Hash[Symbol, untyped]
12
+
13
+ @marshal: Array[untyped]
14
+
15
+ attr_reader details: Hash[Symbol, untyped]
16
+
17
+ attr_reader reason: String
18
+
19
+ attr_reader args: Array[untyped]
20
+
21
+ attr_reader kwargs: Hash[Symbol, untyped]
22
+
23
+ def initialize: (Hash[Symbol, untyped] details, String reason, *Array[untyped] args, **Hash[Symbol, untyped] kwargs) -> void
24
+
25
+ def marshal: () -> Array[untyped]
26
+
27
+ def self.parse: (Array[untyped] wamp_message) -> Abort
28
+ end
29
+ end
30
+ end
31
+
@@ -0,0 +1,20 @@
1
+ module Wampproto
2
+ module Message
3
+ # Wamp Authenticate message
4
+ class Authenticate < Base
5
+ @signature: String
6
+
7
+ @extra: Hash[Symbol, untyped]
8
+
9
+ attr_reader signature: String
10
+
11
+ attr_reader extra: Hash[Symbol, untyped]
12
+
13
+ def initialize: (String signature, ?::Hash[Symbol, untyped] extra) -> void
14
+
15
+ def marshal: () -> ::Array[untyped]
16
+
17
+ def self.parse: (Array[untyped] wamp_message) -> Authenticate
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ module Wampproto
2
+ module Message
3
+ # Base Interface for the Message(s)
4
+ class Base
5
+ def self.parse: (Array[untyped] msg) -> Base
6
+
7
+ def self.type: () -> Integer
8
+
9
+ def marshal: () -> Array[untyped]
10
+
11
+ def type: () -> Integer
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,34 @@
1
+ module Wampproto
2
+ module Message
3
+ # wamp call message
4
+ class Call < Base
5
+ @request_id: Integer
6
+
7
+ @options: Hash[Symbol, untyped]
8
+
9
+ @procedure: String
10
+
11
+ @args: Array[untyped]
12
+
13
+ @kwargs: Hash[Symbol, untyped]
14
+
15
+ @payload: Array[untyped]
16
+
17
+ attr_reader request_id: Integer
18
+
19
+ attr_reader options: Hash[Symbol, untyped]
20
+
21
+ attr_reader procedure: String
22
+
23
+ attr_reader args: Array[untyped]
24
+
25
+ attr_reader kwargs: Hash[Symbol, untyped]
26
+
27
+ def initialize: (Integer request_id, Hash[Symbol, untyped] options, String procedure, *Array[untyped] args, **Hash[Symbol, untyped] kwargs) -> void
28
+
29
+ def marshal: () -> Array[untyped]
30
+
31
+ def self.parse: (Array[untyped] wamp_message) -> Call
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,20 @@
1
+ module Wampproto
2
+ module Message
3
+ # Wamp Challenge message
4
+ class Challenge < Base
5
+ @auth_method: String
6
+
7
+ @extra: Hash[Symbol, untyped]
8
+
9
+ attr_reader auth_method: String
10
+
11
+ attr_reader extra: Hash[Symbol, untyped]
12
+
13
+ def initialize: (String auth_method, ?::Hash[Symbol, untyped] extra) -> void
14
+
15
+ def marshal: () -> ::Array[untyped]
16
+
17
+ def self.parse: (Array[untyped] wamp_message) -> Challenge
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ module Wampproto
2
+ module Message
3
+ # abort message
4
+ class Error < Base
5
+ @message_type: Integer
6
+
7
+ @request_id: Integer
8
+
9
+ @details: Hash[Symbol, untyped]
10
+
11
+ @error: String
12
+
13
+ attr_reader message_type: Integer
14
+
15
+ attr_reader request_id: Integer
16
+
17
+ attr_reader details: Hash[Symbol, untyped]
18
+
19
+ attr_reader error: String
20
+
21
+ def initialize: (Integer message_type, Integer request_id, Hash[Symbol, untyped] details, String error) -> void
22
+
23
+ def marshal: () -> ::Array[untyped]
24
+
25
+ def self.parse: (Array[untyped] wamp_message) -> Error
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ module Wampproto
2
+ module Message
3
+ # event message
4
+ class Event < Base
5
+ @subscription_id: Integer
6
+
7
+ @publication_id: Integer
8
+
9
+ @details: Hash[Symbol, untyped]
10
+
11
+ @args: Array[untyped]
12
+
13
+ @kwargs: Hash[Symbol, untyped]
14
+
15
+ @payload: Array[untyped]
16
+
17
+ attr_reader subscription_id: Integer
18
+
19
+ attr_reader publication_id: Integer
20
+
21
+ attr_reader details: Hash[Symbol, untyped]
22
+
23
+ attr_reader args: Array[untyped]
24
+
25
+ attr_reader kwargs: Hash[Symbol, untyped]
26
+
27
+ def initialize: (Integer subscription_id, Integer publication_id, Hash[Symbol, untyped] details, *Array[untyped] args, **Hash[Symbol, untyped] kwargs) -> void
28
+
29
+ def marshal: () -> Array[untyped]
30
+
31
+ def self.parse: (Array[untyped] wamp_message) -> Event
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,21 @@
1
+ module Wampproto
2
+ module Message
3
+ # abort message
4
+ class Goodbye < Base
5
+ @details: Hash[Symbol, untyped]
6
+
7
+ @reason: String
8
+
9
+ attr_reader details: Hash[Symbol, untyped]
10
+
11
+ attr_reader reason: String
12
+
13
+ def initialize: (Hash[Symbol, untyped] details, String reason) -> void
14
+
15
+ def marshal: () -> ::Array[untyped]
16
+
17
+ def self.parse: (Array[untyped] wamp_message) -> Goodbye
18
+ end
19
+ end
20
+ end
21
+
@@ -0,0 +1,39 @@
1
+ module Wampproto
2
+ module Message
3
+ # Wamp Hello message
4
+ class Hello < Base
5
+ @realm: String
6
+
7
+ @details: Hash[Symbol, untyped]
8
+
9
+ attr_reader realm: String
10
+
11
+ attr_reader details: Hash[Symbol, untyped]
12
+
13
+ def initialize: (String realm, ?::Hash[Symbol, untyped] details) -> void
14
+
15
+ def marshal: () -> ::Array[untyped]
16
+
17
+ def parse_details: (?::Hash[Symbol, untyped] hsh) -> Hash[Symbol, untyped]
18
+
19
+ def roles: () -> Hash[Symbol, untyped]
20
+
21
+ def authid: () -> String
22
+
23
+ def authmethods: () -> Array[String]
24
+
25
+ def authextra: () -> Hash[Symbol, untyped]
26
+
27
+ def self.parse: (Array[untyped] wamp_message) -> Hello
28
+
29
+ private
30
+
31
+ def default_details: () -> { roles: Hash[Symbol, untyped] }
32
+
33
+ def default_roles: () -> Hash[Symbol, untyped]
34
+
35
+ def additional_details: () -> { agent: ::String }
36
+ end
37
+ end
38
+ end
39
+
@@ -0,0 +1,34 @@
1
+ module Wampproto
2
+ module Message
3
+ # abort message
4
+ class Invocation < Base
5
+ @request_id: Integer
6
+
7
+ @registration_id: Integer
8
+
9
+ @details: Hash[Symbol, untyped]
10
+
11
+ @args: Array[untyped]
12
+
13
+ @kwargs: Hash[Symbol, untyped]
14
+
15
+ @payload: Array[untyped]
16
+
17
+ attr_reader request_id: Integer
18
+
19
+ attr_reader registration_id: Integer
20
+
21
+ attr_reader details: Hash[Symbol, untyped]
22
+
23
+ attr_reader args: Array[untyped]
24
+
25
+ attr_reader kwargs: Hash[Symbol, untyped]
26
+
27
+ def initialize: (Integer request_id, Integer registration_id, Hash[Symbol, untyped] details, *Array[untyped] args, **Hash[Symbol, untyped] kwargs) -> void
28
+
29
+ def marshal: () -> Array[untyped]
30
+
31
+ def self.parse: (Array[untyped] wamp_message) -> Invocation
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,32 @@
1
+ module Wampproto
2
+ module Message
3
+ # publish message
4
+ class Publish < Base
5
+ @request_id: Integer
6
+
7
+ @options: Hash[Symbol, untyped]
8
+
9
+ @topic: String
10
+
11
+ @args: Array[untyped]
12
+
13
+ @kwargs: Hash[Symbol, untyped]
14
+
15
+ attr_reader request_id: Integer
16
+
17
+ attr_reader options: Hash[Symbol, untyped]
18
+
19
+ attr_reader topic: String
20
+
21
+ attr_reader args: Array[untyped]
22
+
23
+ attr_reader kwargs: Hash[Symbol, untyped]
24
+
25
+ def initialize: (Integer request_id, Hash[Symbol, untyped] options, String topic, *Array[untyped] args, **Hash[Symbol, untyped] kwargs) -> void
26
+
27
+ def marshal: () -> Array[untyped]
28
+
29
+ def self.parse: (Array[untyped] wamp_message) -> Publish
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ module Wampproto
2
+ module Message
3
+ # published message
4
+ class Published < Base
5
+ @request_id: Integer
6
+
7
+ @publication_id: Integer
8
+
9
+ attr_reader request_id: Integer
10
+
11
+ attr_reader publication_id: Integer
12
+
13
+ def initialize: (Integer request_id, Integer publication_id) -> void
14
+
15
+ def marshal: () -> ::Array[untyped]
16
+
17
+ def self.parse: (Array[untyped] wamp_message) -> Published
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ module Wampproto
2
+ module Message
3
+ # publish message
4
+ class Register < Base
5
+ @request_id: Integer
6
+
7
+ @options: Hash[Symbol, untyped]
8
+
9
+ @procedure: String
10
+
11
+ attr_reader request_id: Integer
12
+
13
+ attr_reader options: Hash[Symbol, untyped]
14
+
15
+ attr_reader procedure: String
16
+
17
+ def initialize: (Integer request_id, Hash[Symbol, untyped] options, String procedure) -> void
18
+
19
+ def marshal: () -> ::Array[untyped]
20
+
21
+ def self.parse: (Array[untyped] wamp_message) -> Register
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ module Wampproto
2
+ module Message
3
+ # publish message
4
+ class Registered < Base
5
+ @request_id: Integer
6
+
7
+ @registration_id: Integer
8
+
9
+ attr_reader request_id: Integer
10
+
11
+ attr_reader registration_id: Integer
12
+
13
+ def initialize: (Integer request_id, Integer registration_id) -> void
14
+
15
+ def marshal: () -> ::Array[untyped]
16
+
17
+ def self.parse: (Array[untyped] wamp_message) -> Registered
18
+ end
19
+ end
20
+ end