Skip to content

Commit

Permalink
experimental support for transaction_hash; decimals in serialization …
Browse files Browse the repository at this point in the history
…part 2 (#1519)

* allow float parsing as decimal
* add transaction_hash for wamp
  • Loading branch information
oberstet committed Feb 12, 2022
1 parent ac4c142 commit 5716575
Show file tree
Hide file tree
Showing 65 changed files with 2,606 additions and 510 deletions.
6 changes: 6 additions & 0 deletions autobahn/wamp/flatbuffers/pubsub.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ table Publish
// If true, request the broker retain this event.
retain: bool;

// Application provided transaction hash for router-side throttle/deduplicate.
transaction_hash: string;

// When this message is forwarded in router-to-router traffic, the route of the message in tuples of (session, authid, authrole) beginning with the publisher session followed by a series of router-link sessions.
forward_for: [Principal];
}
Expand Down Expand Up @@ -177,6 +180,9 @@ table Event
// Whether the message was retained by the broker on the topic, rather than just published.
retained: bool;

// Application provided transaction hash for router-side throttle/deduplicate.
transaction_hash: string;

// Hint to request acknowledgement of the reception of this Event by a subscriber.
acknowledge: bool;

Expand Down
6 changes: 6 additions & 0 deletions autobahn/wamp/flatbuffers/rpc.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ table Call
// When set, indicates that the caller wants to receive progressive call results.
receive_progress: bool;

// Application provided transaction hash for router-side throttle/deduplicate.
transaction_hash: string;

// Caller WAMP session ID (optional).
caller: uint64;

Expand Down Expand Up @@ -191,6 +194,9 @@ table Invocation
// Indicates if the callee should produce progressive results.
receive_progress: bool;

// Application provided transaction hash for router-side throttle/deduplicate.
transaction_hash: string;

// The WAMP session ID of the caller. Only filled if caller is disclosed.
caller: uint64;

Expand Down
12 changes: 7 additions & 5 deletions autobahn/wamp/flatbuffers/types.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ struct Principal
// WAMP session ID.
session: uint64;

// WAMP session authentication ID.
authid: string (principal);

// WAMP session authentication role.
authrole: string (principal);
// FIXME: error: structs may contain only scalar or struct fields
//
// // WAMP session authentication ID.
// authid: string (principal);
//
// // WAMP session authentication role.
// authrole: string (principal);
}


Expand Down
Binary file modified autobahn/wamp/gen/schema/auth.bfbs
Binary file not shown.
Binary file modified autobahn/wamp/gen/schema/pubsub.bfbs
Binary file not shown.
Binary file modified autobahn/wamp/gen/schema/roles.bfbs
Binary file not shown.
Binary file modified autobahn/wamp/gen/schema/rpc.bfbs
Binary file not shown.
Binary file modified autobahn/wamp/gen/schema/session.bfbs
Binary file not shown.
Binary file modified autobahn/wamp/gen/schema/types.bfbs
Binary file not shown.
Binary file modified autobahn/wamp/gen/schema/wamp.bfbs
Binary file not shown.
28 changes: 23 additions & 5 deletions autobahn/wamp/gen/wamp/Map.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
# namespace: wamp

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Map(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsMap(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Map()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsMap(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# Map
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
Expand All @@ -32,7 +38,19 @@ def Value(self):
return self._tab.String(o + self._tab.Pos)
return None

def MapStart(builder): builder.StartObject(2)
def MapAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0)
def MapAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
def MapEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(2)
def MapStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def AddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0)
def MapAddKey(builder, key):
"""This method is deprecated. Please switch to AddKey."""
return AddKey(builder, key)
def AddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
def MapAddValue(builder, value):
"""This method is deprecated. Please switch to AddValue."""
return AddValue(builder, value)
def End(builder): return builder.EndObject()
def MapEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)
18 changes: 15 additions & 3 deletions autobahn/wamp/gen/wamp/Void.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@
# namespace: wamp

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Void(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsVoid(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Void()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsVoid(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# Void
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)

def VoidStart(builder): builder.StartObject(0)
def VoidEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(0)
def VoidStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def End(builder): return builder.EndObject()
def VoidEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)
28 changes: 23 additions & 5 deletions autobahn/wamp/gen/wamp/proto/Abort.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Abort(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsAbort(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Abort()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsAbort(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# Abort
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
Expand All @@ -32,7 +38,19 @@ def Message(self):
return self._tab.String(o + self._tab.Pos)
return None

def AbortStart(builder): builder.StartObject(2)
def AbortAddReason(builder, reason): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(reason), 0)
def AbortAddMessage(builder, message): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0)
def AbortEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(2)
def AbortStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def AddReason(builder, reason): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(reason), 0)
def AbortAddReason(builder, reason):
"""This method is deprecated. Please switch to AddReason."""
return AddReason(builder, reason)
def AddMessage(builder, message): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0)
def AbortAddMessage(builder, message):
"""This method is deprecated. Please switch to AddMessage."""
return AddMessage(builder, message)
def End(builder): return builder.EndObject()
def AbortEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)
38 changes: 31 additions & 7 deletions autobahn/wamp/gen/wamp/proto/AuthCraChallenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class AuthCraChallenge(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsAuthCraChallenge(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = AuthCraChallenge()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsAuthCraChallenge(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# AuthCraChallenge
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
Expand Down Expand Up @@ -46,9 +52,27 @@ def Keylen(self):
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 32

def AuthCraChallengeStart(builder): builder.StartObject(4)
def AuthCraChallengeAddChallenge(builder, challenge): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(challenge), 0)
def AuthCraChallengeAddSalt(builder, salt): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(salt), 0)
def AuthCraChallengeAddIterations(builder, iterations): builder.PrependUint32Slot(2, iterations, 1000)
def AuthCraChallengeAddKeylen(builder, keylen): builder.PrependUint8Slot(3, keylen, 32)
def AuthCraChallengeEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(4)
def AuthCraChallengeStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def AddChallenge(builder, challenge): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(challenge), 0)
def AuthCraChallengeAddChallenge(builder, challenge):
"""This method is deprecated. Please switch to AddChallenge."""
return AddChallenge(builder, challenge)
def AddSalt(builder, salt): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(salt), 0)
def AuthCraChallengeAddSalt(builder, salt):
"""This method is deprecated. Please switch to AddSalt."""
return AddSalt(builder, salt)
def AddIterations(builder, iterations): builder.PrependUint32Slot(2, iterations, 1000)
def AuthCraChallengeAddIterations(builder, iterations):
"""This method is deprecated. Please switch to AddIterations."""
return AddIterations(builder, iterations)
def AddKeylen(builder, keylen): builder.PrependUint8Slot(3, keylen, 32)
def AuthCraChallengeAddKeylen(builder, keylen):
"""This method is deprecated. Please switch to AddKeylen."""
return AddKeylen(builder, keylen)
def End(builder): return builder.EndObject()
def AuthCraChallengeEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)
18 changes: 15 additions & 3 deletions autobahn/wamp/gen/wamp/proto/AuthCraRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@
# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class AuthCraRequest(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsAuthCraRequest(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = AuthCraRequest()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsAuthCraRequest(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# AuthCraRequest
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)

def AuthCraRequestStart(builder): builder.StartObject(0)
def AuthCraRequestEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(0)
def AuthCraRequestStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def End(builder): return builder.EndObject()
def AuthCraRequestEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)
18 changes: 15 additions & 3 deletions autobahn/wamp/gen/wamp/proto/AuthCraWelcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@
# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class AuthCraWelcome(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsAuthCraWelcome(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = AuthCraWelcome()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsAuthCraWelcome(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# AuthCraWelcome
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)

def AuthCraWelcomeStart(builder): builder.StartObject(0)
def AuthCraWelcomeEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(0)
def AuthCraWelcomeStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def End(builder): return builder.EndObject()
def AuthCraWelcomeEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)
23 changes: 19 additions & 4 deletions autobahn/wamp/gen/wamp/proto/AuthCryptosignChallenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
# namespace: proto

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class AuthCryptosignChallenge(object):
__slots__ = ['_tab']

@classmethod
def GetRootAsAuthCryptosignChallenge(cls, buf, offset):
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = AuthCryptosignChallenge()
x.Init(buf, n + offset)
return x

@classmethod
def GetRootAsAuthCryptosignChallenge(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# AuthCryptosignChallenge
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
Expand All @@ -25,6 +31,15 @@ def ChannelBinding(self):
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0

def AuthCryptosignChallengeStart(builder): builder.StartObject(1)
def AuthCryptosignChallengeAddChannelBinding(builder, channelBinding): builder.PrependUint8Slot(0, channelBinding, 0)
def AuthCryptosignChallengeEnd(builder): return builder.EndObject()
def Start(builder): builder.StartObject(1)
def AuthCryptosignChallengeStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def AddChannelBinding(builder, channelBinding): builder.PrependUint8Slot(0, channelBinding, 0)
def AuthCryptosignChallengeAddChannelBinding(builder, channelBinding):
"""This method is deprecated. Please switch to AddChannelBinding."""
return AddChannelBinding(builder, channelBinding)
def End(builder): return builder.EndObject()
def AuthCryptosignChallengeEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)

0 comments on commit 5716575

Please sign in to comment.