Beispiel #1
0
 def check_connection(self, request):
     if self.check_auth_info(request.auth_info):
         return service_pb2.CheckConnectionResponse(
             status=common_pb2.Status(
                 code=common_pb2.STATUS_SUCCESS))
     return service_pb2.CheckConnectionResponse(
         status=common_pb2.Status(
             code=common_pb2.STATUS_UNAUTHORIZED))
Beispiel #2
0
 def CheckConnection(self, request, context):
     try:
         return self._server.check_connection(request, context)
     except UnauthorizedException as e:
         return service_pb2.CheckConnectionResponse(
             status=common_pb2.Status(code=common_pb2.STATUS_UNAUTHORIZED,
                                      msg=repr(e)))
     except Exception as e:
         logging.error('CheckConnection rpc server error: %s', repr(e))
         return service_pb2.CheckConnectionResponse(
             status=common_pb2.Status(code=common_pb2.STATUS_UNKNOWN_ERROR,
                                      msg=repr(e)))
Beispiel #3
0
 def check_connection(self, request, context):
     with self._app.app_context():
         _, party = self.check_auth_info(request.auth_info, context)
         logging.debug('received check_connection from %s',
                       party.domain_name)
         return service_pb2.CheckConnectionResponse(
             status=common_pb2.Status(code=common_pb2.STATUS_SUCCESS))
Beispiel #4
0
 def CheckConnection(self, request, context):
     try:
         return self._server.check_connection(request)
     except Exception as e:
         return service_pb2.CheckConnectionResponse(
             status=common_pb2.Status(
                 code=common_pb2.STATUS_UNKNOWN_ERROR,
                 msg=repr(e)))