Skip to content

Commit f773964

Browse files
authored
prepare for release (#1608)
* prepare for release * regenerate fbs files with flatc version 22.12.06 * expand flatbuffer schema for WAMP with session ID in each message * remove SUBSCRIBER_RECEIVED for now
1 parent f3b8738 commit f773964

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+810
-517
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ jobs:
7171
os: [ubuntu-20.04]
7272
# os: [ubuntu-20.04, macos-latest, windows-latest]
7373

74-
# https://github.com/actions/setup-python#specifying-a-pypy-version
75-
python-version: ['3.7', '3.11', 'pypy-3.8']
74+
# python 3.11 fails with "src/twisted/test/raiser.c:198:12: fatal error: longintrepr.h: No such file or directory"
75+
# twisted doesn't yet support 3.11 formally: https://github.com/twisted/twisted/blob/trunk/pyproject.toml#L24
76+
python-version: ['3.7', '3.10', 'pypy-3.8']
7677
framework: ['asyncio', 'tw1910', 'tw221', 'twtrunk']
7778

7879
# https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/

Makefile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ test_xbr_cli:
152152
xbrnetwork get-actor
153153
xbrnetwork get-actor --market=1388ddf6-fe36-4201-b1aa-cb7e36b4cfb3
154154

155+
test_wamp_serializer:
156+
-USE_TWISTED=1 trial autobahn.wamp.test.test_wamp_serializer
157+
-USE_ASYNCIO=1 pytest autobahn/wamp/test/test_wamp_serializer.py
158+
155159
test_xbr_schema:
156160
USE_TWISTED=1 trial autobahn.xbr.test.schema
157161
USE_ASYNCIO=1 pytest autobahn/xbr/test/schema
@@ -354,6 +358,15 @@ gource:
354358
# generate (a special set of) WAMP message classes from FlatBuffers schema
355359
#
356360

361+
# To build flatc from sourcces:
362+
#
363+
# git clone https://github.com/google/flatbuffers.git
364+
# cd flatbuffers
365+
# git checkout v22.12.06
366+
# cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
367+
# make
368+
# sudo cp ./flatc /usr/local/bin/flatc
369+
357370
# input .fbs files for schema
358371
FBSFILES=./autobahn/wamp/flatbuffers/*.fbs
359372

@@ -364,14 +377,21 @@ clean_fbs:
364377
-rm -rf ./autobahn/wamp/gen/
365378

366379
build_fbs:
367-
# generate schema type library (*.bfbs files)
380+
# generate schema binary type library (*.bfbs files)
368381
$(FLATC) -o ./autobahn/wamp/gen/schema/ --binary --schema --bfbs-comments --bfbs-builtins $(FBSFILES)
369382
@find ./autobahn/wamp/gen/schema/ -name "*.bfbs" | wc -l
370383

371384
# generate schema Python bindings (*.py files)
372385
$(FLATC) -o ./autobahn/wamp/gen/ --python $(FBSFILES)
386+
@touch ./autobahn/wamp/gen/__init__.py
373387
@find ./autobahn/wamp/gen/ -name "*.py" | wc -l
374388

389+
build_fbs_cpp:
375390
# generate schema C++ bindings (*.cpp/hpp files)
376-
# $(FLATC) -o /tmp/gen/ --cpp $(FBSFILES)
377-
# @find /tmp/gen/
391+
$(FLATC) -o /tmp/gen-cpp/ --cpp $(FBSFILES)
392+
@find /tmp/gen-cpp/
393+
394+
build_fbs_rust:
395+
# generate schema Rust bindings (*.rs files)
396+
$(FLATC) -o /tmp/gen-rust/ --rust $(FBSFILES)
397+
@find /tmp/gen-rust/

autobahn/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
#
2525
###############################################################################
2626

27-
__version__ = '22.8.1.dev1'
27+
__version__ = '22.12.1'
2828

2929
__build__ = '00000000-0000000'

autobahn/wamp/flatbuffers/pubsub.fbs

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ namespace wamp.proto;
1515
// SUBSCRIBE message (message_type = 32): [SUBSCRIBE, Request|id, Options|dict, Topic|uri]
1616
table Subscribe
1717
{
18+
// The WAMP session ID on the node this session is (directly) attached to.
19+
session: uint64;
20+
1821
// The WAMP request ID of this request.
1922
request: uint64 (key);
2023

@@ -32,6 +35,9 @@ table Subscribe
3235
// SUBSCRIBED message (message_type = 33): [SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]
3336
table Subscribed
3437
{
38+
// The WAMP session ID on the node this session is (directly) attached to.
39+
session: uint64;
40+
3541
// The request ID of the original SUBSCRIBE request.
3642
request: uint64 (key);
3743

@@ -43,6 +49,9 @@ table Subscribed
4349
// UNSUBSCRIBE message (message_type = 34): [UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id]
4450
table Unsubscribe
4551
{
52+
// The WAMP session ID on the node this session is (directly) attached to.
53+
session: uint64;
54+
4655
// The WAMP request ID of this request.
4756
request: uint64 (key);
4857

@@ -54,6 +63,9 @@ table Unsubscribe
5463
// UNSUBSCRIBED message (message_type = 35): [UNSUBSCRIBED, UNSUBSCRIBE.Request|id, Details|dict]
5564
table Unsubscribed
5665
{
66+
// The WAMP session ID on the node this session is (directly) attached to.
67+
session: uint64;
68+
5769
// The request ID of the original UNSUBSCRIBE request or 0 if the router triggered the unsubscribe ("router subscription revocation signaling").
5870
request: uint64 (key);
5971

@@ -68,6 +80,9 @@ table Unsubscribed
6880
// PUBLISH message (message_type = 16): [PUBLISH, Request|id, Options|dict, Topic|uri, Payload|binary]
6981
table Publish
7082
{
83+
// The WAMP session ID on the node this session is (directly) attached to.
84+
session: uint64;
85+
7186
// The WAMP request ID of this request.
7287
request: uint64 (key);
7388

@@ -130,6 +145,9 @@ table Publish
130145
// PUBLISHED message (message_type = 17): [PUBLISHED, PUBLISH.Request|id, Publication|id]
131146
table Published
132147
{
148+
// The WAMP session ID on the node this session is (directly) attached to.
149+
session: uint64;
150+
133151
// The request ID of the original PUBLISH request.
134152
request: uint64 (key);
135153

@@ -141,6 +159,9 @@ table Published
141159
// EVENT message (message_type = 36): [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Payload|binary]
142160
table Event
143161
{
162+
// The WAMP session ID on the node this session is (directly) attached to.
163+
session: uint64;
164+
144165
// The subscription ID this event is dispatched under.
145166
subscription: uint64;
146167

@@ -194,38 +215,12 @@ table Event
194215
// EVENT_RECEIVED message (message_type = 37): [EVENT_RECEIVED, EVENT.Publication|id, Details|dict, Payload|binary]
195216
table EventReceived
196217
{
197-
// The publication ID of the event that was received, and that is acknowledged.
198-
publication: uint64;
218+
// The WAMP session ID on the node this session is (directly) attached to.
219+
session: uint64;
199220

200-
// Raw application payload: error arguments. This might be encrypted (with Payload==Payload.CRYPTOBOX), and is serialized according to enc_serializer.
201-
payload: [uint8];
202-
203-
// The encoding algorithm that was used to encode the payload.
204-
enc_algo: Payload;
205-
206-
// The payload object serializer that was used encoding the payload.
207-
enc_serializer: Serializer;
208-
209-
// When using Payload.CRYPTOBOX, the public Cryptobox key of the key pair used for encrypting the payload.
210-
enc_key: [uint8];
211-
}
212-
213-
214-
// SUBSCRIBER_RECEIVED message (message_type = 38): [SUBSCRIBER_RECEIVED, EVENT_RECEIVED.Publication|id, Details|dict, EVENT_RECEIVED.Payload|binary]
215-
table SubscriberReceived
216-
{
217221
// The publication ID of the event that was received, and that is acknowledged.
218222
publication: uint64;
219223

220-
// The WAMP session ID of the subscriber. Only filled when the subscriber is disclosed.
221-
subscriber: uint64;
222-
223-
// The WAMP authrole of the subscriber. Only filled when subscriber is disclosed.
224-
subscriber_authid: string (principal);
225-
226-
// The WAMP authrole of the subscriber. Only filled when subscriber is disclosed.
227-
subscriber_authrole: string (principal);
228-
229224
// Raw application payload: error arguments. This might be encrypted (with Payload==Payload.CRYPTOBOX), and is serialized according to enc_serializer.
230225
payload: [uint8];
231226

autobahn/wamp/flatbuffers/rpc.fbs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ namespace wamp.proto;
1515
// CALL message (message_type = 48): [CALL, Request|id, Options|dict, Procedure|uri, Payload|binary]
1616
table Call
1717
{
18+
// The WAMP session ID on the node this session is (directly) attached to.
19+
session: uint64;
20+
1821
// The WAMP request ID of this request.
1922
request: uint64 (key);
2023

@@ -59,6 +62,9 @@ table Call
5962
// CANCEL message (message_type = 49): [CANCEL, CALL.Request|id, Options|dict]
6063
table Cancel
6164
{
65+
// The WAMP session ID on the node this session is (directly) attached to.
66+
session: uint64;
67+
6268
// The request ID of the original CALL request.
6369
request: uint64 (key);
6470

@@ -73,6 +79,9 @@ table Cancel
7379
// RESULT message (message_type = 50): [RESULT, CALL.Request|id, Details|dict, Payload|binary]
7480
table Result
7581
{
82+
// The WAMP session ID on the node this session is (directly) attached to.
83+
session: uint64;
84+
7685
// The request ID of the original CALL request.
7786
request: uint64 (key);
7887

@@ -108,6 +117,9 @@ table Result
108117
// REGISTER message (message_type = 64): [REGISTER, Request|id, Options|dict, Procedure|uri]
109118
table Register
110119
{
120+
// The WAMP session ID on the node this session is (directly) attached to.
121+
session: uint64;
122+
111123
// The WAMP request ID of this request.
112124
request: uint64 (key);
113125

@@ -131,6 +143,9 @@ table Register
131143
// REGISTERED message (message_type = 65): [REGISTERED, REGISTER.Request|id, Registration|id]
132144
table Registered
133145
{
146+
// The WAMP session ID on the node this session is (directly) attached to.
147+
session: uint64;
148+
134149
// The request ID of the original ``REGISTER`` request.
135150
request: uint64 (key);
136151

@@ -142,6 +157,9 @@ table Registered
142157
// UNREGISTER message (message_type = 66): [UNREGISTER, Request|id, REGISTERED.Registration|id]
143158
table Unregister
144159
{
160+
// The WAMP session ID on the node this session is (directly) attached to.
161+
session: uint64;
162+
145163
// The request ID of the original ``REGISTER`` request.
146164
request: uint64 (key);
147165

@@ -153,6 +171,9 @@ table Unregister
153171
// UNREGISTERED message (message_type = 67): [UNREGISTERED, UNREGISTER.Request|id, Details|dict]
154172
table Unregistered
155173
{
174+
// The WAMP session ID on the node this session is (directly) attached to.
175+
session: uint64;
176+
156177
// The request ID of the original UNREGISTER request.
157178
request: uint64 (key);
158179

@@ -167,6 +188,9 @@ table Unregistered
167188
// INVOCATION message (message_type = 68): [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, Payload|binary]
168189
table Invocation
169190
{
191+
// The WAMP session ID on the node this session is (directly) attached to.
192+
session: uint64;
193+
170194
// The WAMP request ID of this request.
171195
request: uint64 (key);
172196

@@ -214,6 +238,9 @@ table Invocation
214238
// INTERRUPT message (message_type = 69): [INTERRUPT, INVOCATION.Request|id, Options|dict]
215239
table Interrupt
216240
{
241+
// The WAMP session ID on the node this session is (directly) attached to.
242+
session: uint64;
243+
217244
// The WAMP request ID of this request.
218245
request: uint64 (key);
219246

@@ -231,6 +258,9 @@ table Interrupt
231258
// YIELD message (message_type = 70): [YIELD, INVOCATION.Request|id, Options|dict, Payload|binary]
232259
table Yield
233260
{
261+
// The WAMP session ID on the node this session is (directly) attached to.
262+
session: uint64;
263+
234264
// The WAMP request ID of this request.
235265
request: uint64 (key);
236266

autobahn/wamp/flatbuffers/session.fbs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ namespace wamp.proto;
1717
// HELLO message (message_type = 1): [HELLO, Realm|uri, Details|dict]
1818
table Hello
1919
{
20+
// The WAMP session ID on the node this session is (directly) attached to.
21+
session: uint64;
22+
2023
// The WAMP session roles and client library features to announce.
2124
roles: ClientRoles (required);
2225

@@ -50,12 +53,12 @@ table Hello
5053
// WELCOME message (message_type = 2): [WELCOME, Session|id, Details|dict]
5154
table Welcome
5255
{
56+
// The WAMP session ID on the node this session is (directly) attached to.
57+
session: uint64;
58+
5359
// The WAMP roles to announce.
5460
roles: RouterRoles (required);
5561

56-
// The WAMP session ID the other peer is assigned.
57-
session: uint64;
58-
5962
// The effective realm the session is joined on.
6063
realm: string (required, uri);
6164

@@ -88,6 +91,9 @@ table Welcome
8891
// ABORT message (message_type = 3): [ABORT, Details|dict, Reason|uri]
8992
table Abort
9093
{
94+
// The WAMP session ID on the node this session is (directly) attached to.
95+
session: uint64;
96+
9197
// WAMP or application error URI for aborting reason.
9298
reason: string (required, uri);
9399

@@ -99,6 +105,9 @@ table Abort
99105
// CHALLENGE message (message_type = 4): [CHALLENGE, Method|string, Extra|dict]
100106
table Challenge
101107
{
108+
// The WAMP session ID on the node this session is (directly) attached to.
109+
session: uint64;
110+
102111
// The challenge method.
103112
method: AuthMethod;
104113

@@ -110,6 +119,9 @@ table Challenge
110119
// AUTHENTICATE message (message_type = 5): [AUTHENTICATE, Signature|string, Extra|dict]
111120
table Authenticate
112121
{
122+
// The WAMP session ID on the node this session is (directly) attached to.
123+
session: uint64;
124+
113125
// The signature for the authentication challenge.
114126
signature: string (required);
115127

@@ -121,6 +133,9 @@ table Authenticate
121133
// GOODBYE message (message_type = 6): [GOODBYE, Details|dict, Reason|uri]
122134
table Goodbye
123135
{
136+
// The WAMP session ID on the node this session is (directly) attached to.
137+
session: uint64;
138+
124139
// Optional WAMP or application error URI for closing reason.
125140
reason: string (required, uri);
126141

@@ -135,6 +150,9 @@ table Goodbye
135150
// ERROR message (message_type = 8): [ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, Payload|binary]
136151
table Error
137152
{
153+
// The WAMP session ID on the node this session is (directly) attached to.
154+
session: uint64;
155+
138156
// The WAMP message type code for the original request.
139157
request_type: MessageType;
140158

autobahn/wamp/flatbuffers/types.fbs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ enum MessageType: uint16
6060
// Publish & Subscribe (PubSub)
6161
PUBLISH = 16,
6262
PUBLISHED = 17,
63-
SUBSCRIBER_RECEIVED = 18, // NEW: for "survey mode" PubSub (receiving app level
64-
// feedback from event receivers)
6563
SUBSCRIBE = 32,
6664
SUBSCRIBED = 33,
6765
UNSUBSCRIBE = 34,
@@ -136,8 +134,11 @@ enum Serializer: uint8
136134
// Raw pass-through of app payload, uninterpreted in any way.
137135
OPAQUE = 5,
138136

139-
// Explicit use of FlatBuffers also for (statically typed) payload.
140-
FLATBUFFERS = 6
137+
// Use FlatBuffers serialized (statically typed) payload (https://google.github.io/flatbuffers/index.html).
138+
FLATBUFFERS = 6,
139+
140+
// Use FlexBuffers serialized (dynamically typed) payload (https://google.github.io/flatbuffers/flexbuffers.html).
141+
FLEXBUFFERS = 7
141142
}
142143

143144

0 commit comments

Comments
 (0)