Skip to content

Commit

Permalink
prepare for release (#1608)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
oberstet authored Dec 18, 2022
1 parent f3b8738 commit f773964
Show file tree
Hide file tree
Showing 48 changed files with 810 additions and 517 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ jobs:
os: [ubuntu-20.04]
# os: [ubuntu-20.04, macos-latest, windows-latest]

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

# https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
Expand Down
26 changes: 23 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ test_xbr_cli:
xbrnetwork get-actor
xbrnetwork get-actor --market=1388ddf6-fe36-4201-b1aa-cb7e36b4cfb3

test_wamp_serializer:
-USE_TWISTED=1 trial autobahn.wamp.test.test_wamp_serializer
-USE_ASYNCIO=1 pytest autobahn/wamp/test/test_wamp_serializer.py

test_xbr_schema:
USE_TWISTED=1 trial autobahn.xbr.test.schema
USE_ASYNCIO=1 pytest autobahn/xbr/test/schema
Expand Down Expand Up @@ -354,6 +358,15 @@ gource:
# generate (a special set of) WAMP message classes from FlatBuffers schema
#

# To build flatc from sourcces:
#
# git clone https://github.com/google/flatbuffers.git
# cd flatbuffers
# git checkout v22.12.06
# cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
# make
# sudo cp ./flatc /usr/local/bin/flatc

# input .fbs files for schema
FBSFILES=./autobahn/wamp/flatbuffers/*.fbs

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

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

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

build_fbs_cpp:
# generate schema C++ bindings (*.cpp/hpp files)
# $(FLATC) -o /tmp/gen/ --cpp $(FBSFILES)
# @find /tmp/gen/
$(FLATC) -o /tmp/gen-cpp/ --cpp $(FBSFILES)
@find /tmp/gen-cpp/

build_fbs_rust:
# generate schema Rust bindings (*.rs files)
$(FLATC) -o /tmp/gen-rust/ --rust $(FBSFILES)
@find /tmp/gen-rust/
2 changes: 1 addition & 1 deletion autobahn/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#
###############################################################################

__version__ = '22.8.1.dev1'
__version__ = '22.12.1'

__build__ = '00000000-0000000'
51 changes: 23 additions & 28 deletions autobahn/wamp/flatbuffers/pubsub.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ namespace wamp.proto;
// SUBSCRIBE message (message_type = 32): [SUBSCRIBE, Request|id, Options|dict, Topic|uri]
table Subscribe
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand All @@ -32,6 +35,9 @@ table Subscribe
// SUBSCRIBED message (message_type = 33): [SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]
table Subscribed
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original SUBSCRIBE request.
request: uint64 (key);

Expand All @@ -43,6 +49,9 @@ table Subscribed
// UNSUBSCRIBE message (message_type = 34): [UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id]
table Unsubscribe
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand All @@ -54,6 +63,9 @@ table Unsubscribe
// UNSUBSCRIBED message (message_type = 35): [UNSUBSCRIBED, UNSUBSCRIBE.Request|id, Details|dict]
table Unsubscribed
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original UNSUBSCRIBE request or 0 if the router triggered the unsubscribe ("router subscription revocation signaling").
request: uint64 (key);

Expand All @@ -68,6 +80,9 @@ table Unsubscribed
// PUBLISH message (message_type = 16): [PUBLISH, Request|id, Options|dict, Topic|uri, Payload|binary]
table Publish
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand Down Expand Up @@ -130,6 +145,9 @@ table Publish
// PUBLISHED message (message_type = 17): [PUBLISHED, PUBLISH.Request|id, Publication|id]
table Published
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original PUBLISH request.
request: uint64 (key);

Expand All @@ -141,6 +159,9 @@ table Published
// EVENT message (message_type = 36): [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Payload|binary]
table Event
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The subscription ID this event is dispatched under.
subscription: uint64;

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

// Raw application payload: error arguments. This might be encrypted (with Payload==Payload.CRYPTOBOX), and is serialized according to enc_serializer.
payload: [uint8];

// The encoding algorithm that was used to encode the payload.
enc_algo: Payload;

// The payload object serializer that was used encoding the payload.
enc_serializer: Serializer;

// When using Payload.CRYPTOBOX, the public Cryptobox key of the key pair used for encrypting the payload.
enc_key: [uint8];
}


// SUBSCRIBER_RECEIVED message (message_type = 38): [SUBSCRIBER_RECEIVED, EVENT_RECEIVED.Publication|id, Details|dict, EVENT_RECEIVED.Payload|binary]
table SubscriberReceived
{
// The publication ID of the event that was received, and that is acknowledged.
publication: uint64;

// The WAMP session ID of the subscriber. Only filled when the subscriber is disclosed.
subscriber: uint64;

// The WAMP authrole of the subscriber. Only filled when subscriber is disclosed.
subscriber_authid: string (principal);

// The WAMP authrole of the subscriber. Only filled when subscriber is disclosed.
subscriber_authrole: string (principal);

// Raw application payload: error arguments. This might be encrypted (with Payload==Payload.CRYPTOBOX), and is serialized according to enc_serializer.
payload: [uint8];

Expand Down
30 changes: 30 additions & 0 deletions autobahn/wamp/flatbuffers/rpc.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ namespace wamp.proto;
// CALL message (message_type = 48): [CALL, Request|id, Options|dict, Procedure|uri, Payload|binary]
table Call
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand Down Expand Up @@ -59,6 +62,9 @@ table Call
// CANCEL message (message_type = 49): [CANCEL, CALL.Request|id, Options|dict]
table Cancel
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original CALL request.
request: uint64 (key);

Expand All @@ -73,6 +79,9 @@ table Cancel
// RESULT message (message_type = 50): [RESULT, CALL.Request|id, Details|dict, Payload|binary]
table Result
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original CALL request.
request: uint64 (key);

Expand Down Expand Up @@ -108,6 +117,9 @@ table Result
// REGISTER message (message_type = 64): [REGISTER, Request|id, Options|dict, Procedure|uri]
table Register
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand All @@ -131,6 +143,9 @@ table Register
// REGISTERED message (message_type = 65): [REGISTERED, REGISTER.Request|id, Registration|id]
table Registered
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original ``REGISTER`` request.
request: uint64 (key);

Expand All @@ -142,6 +157,9 @@ table Registered
// UNREGISTER message (message_type = 66): [UNREGISTER, Request|id, REGISTERED.Registration|id]
table Unregister
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original ``REGISTER`` request.
request: uint64 (key);

Expand All @@ -153,6 +171,9 @@ table Unregister
// UNREGISTERED message (message_type = 67): [UNREGISTERED, UNREGISTER.Request|id, Details|dict]
table Unregistered
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The request ID of the original UNREGISTER request.
request: uint64 (key);

Expand All @@ -167,6 +188,9 @@ table Unregistered
// INVOCATION message (message_type = 68): [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, Payload|binary]
table Invocation
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand Down Expand Up @@ -214,6 +238,9 @@ table Invocation
// INTERRUPT message (message_type = 69): [INTERRUPT, INVOCATION.Request|id, Options|dict]
table Interrupt
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand All @@ -231,6 +258,9 @@ table Interrupt
// YIELD message (message_type = 70): [YIELD, INVOCATION.Request|id, Options|dict, Payload|binary]
table Yield
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP request ID of this request.
request: uint64 (key);

Expand Down
24 changes: 21 additions & 3 deletions autobahn/wamp/flatbuffers/session.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace wamp.proto;
// HELLO message (message_type = 1): [HELLO, Realm|uri, Details|dict]
table Hello
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP session roles and client library features to announce.
roles: ClientRoles (required);

Expand Down Expand Up @@ -50,12 +53,12 @@ table Hello
// WELCOME message (message_type = 2): [WELCOME, Session|id, Details|dict]
table Welcome
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP roles to announce.
roles: RouterRoles (required);

// The WAMP session ID the other peer is assigned.
session: uint64;

// The effective realm the session is joined on.
realm: string (required, uri);

Expand Down Expand Up @@ -88,6 +91,9 @@ table Welcome
// ABORT message (message_type = 3): [ABORT, Details|dict, Reason|uri]
table Abort
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// WAMP or application error URI for aborting reason.
reason: string (required, uri);

Expand All @@ -99,6 +105,9 @@ table Abort
// CHALLENGE message (message_type = 4): [CHALLENGE, Method|string, Extra|dict]
table Challenge
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The challenge method.
method: AuthMethod;

Expand All @@ -110,6 +119,9 @@ table Challenge
// AUTHENTICATE message (message_type = 5): [AUTHENTICATE, Signature|string, Extra|dict]
table Authenticate
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The signature for the authentication challenge.
signature: string (required);

Expand All @@ -121,6 +133,9 @@ table Authenticate
// GOODBYE message (message_type = 6): [GOODBYE, Details|dict, Reason|uri]
table Goodbye
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// Optional WAMP or application error URI for closing reason.
reason: string (required, uri);

Expand All @@ -135,6 +150,9 @@ table Goodbye
// ERROR message (message_type = 8): [ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, Payload|binary]
table Error
{
// The WAMP session ID on the node this session is (directly) attached to.
session: uint64;

// The WAMP message type code for the original request.
request_type: MessageType;

Expand Down
9 changes: 5 additions & 4 deletions autobahn/wamp/flatbuffers/types.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ enum MessageType: uint16
// Publish & Subscribe (PubSub)
PUBLISH = 16,
PUBLISHED = 17,
SUBSCRIBER_RECEIVED = 18, // NEW: for "survey mode" PubSub (receiving app level
// feedback from event receivers)
SUBSCRIBE = 32,
SUBSCRIBED = 33,
UNSUBSCRIBE = 34,
Expand Down Expand Up @@ -136,8 +134,11 @@ enum Serializer: uint8
// Raw pass-through of app payload, uninterpreted in any way.
OPAQUE = 5,

// Explicit use of FlatBuffers also for (statically typed) payload.
FLATBUFFERS = 6
// Use FlatBuffers serialized (statically typed) payload (https://google.github.io/flatbuffers/index.html).
FLATBUFFERS = 6,

// Use FlexBuffers serialized (dynamically typed) payload (https://google.github.io/flatbuffers/flexbuffers.html).
FLEXBUFFERS = 7
}


Expand Down
Loading

0 comments on commit f773964

Please sign in to comment.