Source code for cfxdb.cookiestore._cookie

##############################################################################
#
#                        Crossbar.io Database
#     Copyright (c) typedef int GmbH. Licensed under MIT.
#
##############################################################################

import pprint
import uuid
from typing import Any, Dict, Optional

import cbor2
import numpy as np
from zlmdb import MapStringUuid, MapUuidFlatBuffers, flatbuffers, table

from cfxdb.gen.cookiestore import Cookie as CookieGen


[docs] class _CookieGen(CookieGen.Cookie): @classmethod
[docs] def GetRootAsCookie(cls, buf, offset=0): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = _CookieGen() x.Init(buf, n + offset) return x
[docs] def OidAsBytes(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: _off = self._tab.Vector(o) _len = self._tab.VectorLen(o) return memoryview(self._tab.Bytes)[_off : _off + _len] return None
[docs] def AuthenticatedOnNodeAsBytes(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) if o != 0: _off = self._tab.Vector(o) _len = self._tab.VectorLen(o) return memoryview(self._tab.Bytes)[_off : _off + _len] return None
[docs] def AuthenticatedTransportInfoAsBytes(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20)) if o != 0: _off = self._tab.Vector(o) _len = self._tab.VectorLen(o) return memoryview(self._tab.Bytes)[_off : _off + _len] return None
[docs] def AuthExtraAsBytes(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36)) if o != 0: _off = self._tab.Vector(o) _len = self._tab.VectorLen(o) return memoryview(self._tab.Bytes)[_off : _off + _len] return None
@table("62f8c8c9-c50b-4686-bafe-38b221c64a0c", build=Cookie.build, cast=Cookie.cast)
[docs] class Cookies(MapUuidFlatBuffers): """ Persisted cookies table. Map :class:`zlmdb.MapUuidFlatBuffers` from ``cookie_oid`` to :class:`cfxdb.cookiestore.Cookie` """
@table("65e1d8c1-fa8b-459d-ae43-cb320d28cc97")
[docs] class IndexCookiesByValue(MapStringUuid): """ Index: cookie_value -> cookie_oid """