# automatically generated by the FlatBuffers compiler, do not modify
# namespace: cookiestore
import flatbuffers
from flatbuffers.compat import import_numpy
# Persistent cookies, as used in WAMP-Cookie authentication by router and proxy workers.
[docs]
class Cookie(object):
@classmethod
[docs]
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Cookie()
x.Init(buf, n + offset)
return x
@classmethod
[docs]
def GetRootAsCookie(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# Cookie
[docs]
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Database ID of this cookie record.
# Cookie
[docs]
def Oid(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(
flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
)
return 0
# Cookie
[docs]
def OidAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
return 0
# Cookie
[docs]
def OidLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Cookie
[docs]
def OidIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
# Timestamp when the cookie was created. Epoch time in ns.
# Cookie
[docs]
def Created(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 0
# Cookie maximum age (lifetime of the cookie in seconds, see http://tools.ietf.org/html/rfc6265#page-20), e.g. ``604800"``.
# Cookie
[docs]
def MaxAge(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 0
# Cookie name, as set in HTTP header, e.g. ``"cbtid"``.
# Cookie
[docs]
def Name(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# Cookie value, as set in HTTP header, e.g. ``"gn2ri8fuAYQse50/L6N7jnt2"``.
# Cookie
[docs]
def Value(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# Timestamp when the cookie was authenticated (if any). Epoch time in ns.
# Cookie
[docs]
def Authenticated(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 0
# The Crossbar.io node (within the management domain) the cookie was authenticated on (if any).
# Cookie
[docs]
def AuthenticatedOnNode(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(
flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
)
return 0
# Cookie
[docs]
def AuthenticatedOnNodeAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
return 0
# Cookie
[docs]
def AuthenticatedOnNodeLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Cookie
[docs]
def AuthenticatedOnNodeIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
return o == 0
# The Crossbar.io worker (within the node) the cookie was authenticated on (if any).
# Cookie
[docs]
def AuthenticatedOnWorker(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# The client transport information for the connection the cookie was authenticated in (if any).
# Cookie
[docs]
def AuthenticatedTransportInfo(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(
flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
)
return 0
# Cookie
[docs]
def AuthenticatedTransportInfoAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
return 0
# Cookie
[docs]
def AuthenticatedTransportInfoLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Cookie
[docs]
def AuthenticatedTransportInfoIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
return o == 0
# The WAMP session ID of the original authenticating session.
# Cookie
[docs]
def AuthenticatedSession(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 0
# Timestamp when the original authenticating session was welcome by the router. Epoch time in ns.
# Cookie
[docs]
def AuthenticatedJoinedAt(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 0
# The (original) WAMP authentication method, after which the client was authenticated before setting this cookie.
# Cookie
[docs]
def AuthenticatedAuthmethod(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# The WAMP authid a cookie-authenticating session is to be assigned.
# Cookie
[docs]
def Authid(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# The WAMP authrole a cookie-authenticating session is to join under.
# Cookie
[docs]
def Authrole(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# The WAMP authmethod a cookie-authenticating session is to join under.
# Cookie
[docs]
def Authmethod(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# The WAMP realm a cookie-authenticating session is to join.
# Cookie
[docs]
def Authrealm(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# The WAMP authentication extra data to be returned to the client performing cookie-based authentication.
# Cookie
# Cookie
# Cookie
# Cookie
[docs]
def CookieStart(builder):
builder.StartObject(17)
[docs]
def Start(builder):
CookieStart(builder)
[docs]
def CookieAddOid(builder, oid):
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(oid), 0)
[docs]
def AddOid(builder, oid):
CookieAddOid(builder, oid)
[docs]
def CookieStartOidVector(builder, numElems):
return builder.StartVector(1, numElems, 1)
[docs]
def StartOidVector(builder, numElems: int) -> int:
return CookieStartOidVector(builder, numElems)
[docs]
def CookieAddCreated(builder, created):
builder.PrependUint64Slot(1, created, 0)
[docs]
def AddCreated(builder, created):
CookieAddCreated(builder, created)
[docs]
def CookieAddMaxAge(builder, maxAge):
builder.PrependUint64Slot(2, maxAge, 0)
[docs]
def AddMaxAge(builder, maxAge):
CookieAddMaxAge(builder, maxAge)
[docs]
def CookieAddName(builder, name):
builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
[docs]
def AddName(builder, name):
CookieAddName(builder, name)
[docs]
def CookieAddValue(builder, value):
builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
[docs]
def AddValue(builder, value):
CookieAddValue(builder, value)
[docs]
def CookieAddAuthenticated(builder, authenticated):
builder.PrependUint64Slot(5, authenticated, 0)
[docs]
def AddAuthenticated(builder, authenticated):
CookieAddAuthenticated(builder, authenticated)
[docs]
def CookieAddAuthenticatedOnNode(builder, authenticatedOnNode):
builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(authenticatedOnNode), 0)
[docs]
def AddAuthenticatedOnNode(builder, authenticatedOnNode):
CookieAddAuthenticatedOnNode(builder, authenticatedOnNode)
[docs]
def CookieStartAuthenticatedOnNodeVector(builder, numElems):
return builder.StartVector(1, numElems, 1)
[docs]
def StartAuthenticatedOnNodeVector(builder, numElems: int) -> int:
return CookieStartAuthenticatedOnNodeVector(builder, numElems)
[docs]
def CookieAddAuthenticatedOnWorker(builder, authenticatedOnWorker):
builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(authenticatedOnWorker), 0)
[docs]
def AddAuthenticatedOnWorker(builder, authenticatedOnWorker):
CookieAddAuthenticatedOnWorker(builder, authenticatedOnWorker)
[docs]
def CookieAddAuthenticatedTransportInfo(builder, authenticatedTransportInfo):
builder.PrependUOffsetTRelativeSlot(
8, flatbuffers.number_types.UOffsetTFlags.py_type(authenticatedTransportInfo), 0
)
[docs]
def AddAuthenticatedTransportInfo(builder, authenticatedTransportInfo):
CookieAddAuthenticatedTransportInfo(builder, authenticatedTransportInfo)
[docs]
def CookieStartAuthenticatedTransportInfoVector(builder, numElems):
return builder.StartVector(1, numElems, 1)
[docs]
def StartAuthenticatedTransportInfoVector(builder, numElems: int) -> int:
return CookieStartAuthenticatedTransportInfoVector(builder, numElems)
[docs]
def CookieAddAuthenticatedSession(builder, authenticatedSession):
builder.PrependUint64Slot(9, authenticatedSession, 0)
[docs]
def AddAuthenticatedSession(builder, authenticatedSession):
CookieAddAuthenticatedSession(builder, authenticatedSession)
[docs]
def CookieAddAuthenticatedJoinedAt(builder, authenticatedJoinedAt):
builder.PrependUint64Slot(10, authenticatedJoinedAt, 0)
[docs]
def AddAuthenticatedJoinedAt(builder, authenticatedJoinedAt):
CookieAddAuthenticatedJoinedAt(builder, authenticatedJoinedAt)
[docs]
def CookieAddAuthenticatedAuthmethod(builder, authenticatedAuthmethod):
builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(authenticatedAuthmethod), 0)
[docs]
def AddAuthenticatedAuthmethod(builder, authenticatedAuthmethod):
CookieAddAuthenticatedAuthmethod(builder, authenticatedAuthmethod)
[docs]
def CookieAddAuthid(builder, authid):
builder.PrependUOffsetTRelativeSlot(12, flatbuffers.number_types.UOffsetTFlags.py_type(authid), 0)
[docs]
def AddAuthid(builder, authid):
CookieAddAuthid(builder, authid)
[docs]
def CookieAddAuthrole(builder, authrole):
builder.PrependUOffsetTRelativeSlot(13, flatbuffers.number_types.UOffsetTFlags.py_type(authrole), 0)
[docs]
def AddAuthrole(builder, authrole):
CookieAddAuthrole(builder, authrole)
[docs]
def CookieAddAuthmethod(builder, authmethod):
builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(authmethod), 0)
[docs]
def AddAuthmethod(builder, authmethod):
CookieAddAuthmethod(builder, authmethod)
[docs]
def CookieAddAuthrealm(builder, authrealm):
builder.PrependUOffsetTRelativeSlot(15, flatbuffers.number_types.UOffsetTFlags.py_type(authrealm), 0)
[docs]
def AddAuthrealm(builder, authrealm):
CookieAddAuthrealm(builder, authrealm)
[docs]
def CookieEnd(builder):
return builder.EndObject()
[docs]
def End(builder):
return CookieEnd(builder)