Beispiel #1
0
 def _t_request(self) -> TRequest:  # pylint: disable=method-hidden
     _t_request = TRequest()
     _t_request.loid = TLoid()
     _t_request.session = TSession()
     if self._header:
         try:
             TSerialization.deserialize(_t_request, self._header,
                                        self._HEADER_PROTOCOL_FACTORY)
         except Exception:
             logger.debug("Invalid Edge-Request header. %s", self._header)
     return _t_request
Beispiel #2
0
    def _t_request(self):  # pylint: disable=method-hidden
        # Importing the Thrift models inline so that building them is not a
        # hard, import-time dependency for tasks like building the docs.
        from baseplate.thrift.ttypes import Loid as TLoid
        from baseplate.thrift.ttypes import Request as TRequest
        from baseplate.thrift.ttypes import Session as TSession

        _t_request = TRequest()
        _t_request.loid = TLoid()
        _t_request.session = TSession()
        if self._header:
            try:
                TSerialization.deserialize(_t_request, self._header, self._HEADER_PROTOCOL_FACTORY)
            except Exception:
                logger.debug("Invalid Edge-Request header. %s", self._header)
        return _t_request
Beispiel #3
0
 def req(self):
     return Request(
         loid=Loid(id="t2_1", created_ms=100000000),
         session=Session(id="session-id"),
         authentication_token="auth-token",
     )