def secure_core_server(self, server_credentials): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) Core.add_CoreServiceServicer_to_server(CoreServicer(), server) server.add_secure_port("[::]:50053", server_credentials) server.start() yield server server.stop(0)
def server(self): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) Core.add_CoreServiceServicer_to_server(CoreServicer(), server) server.add_insecure_port("[::]:50051") server.start() yield server server.stop(0)
def secure_core_server(self, server_credentials): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) Core.add_CoreServiceServicer_to_server(CoreServicer(), server) port = find_free_port() server.add_secure_port(f"[::]:{port}", server_credentials) server.start() yield port server.stop(0)
def insecure_core_server_that_blocks_auth(self, server_credentials): server = grpc.server( futures.ThreadPoolExecutor(max_workers=10), interceptors=(DisallowAuthInterceptor(), ), ) Core.add_CoreServiceServicer_to_server(CoreServicer(), server) server.add_insecure_port("[::]:50057") server.start() yield server server.stop(0)
def insecure_core_server_with_auth(self, server_credentials): server = grpc.server( futures.ThreadPoolExecutor(max_workers=10), interceptors=(AllowAuthInterceptor(), ), ) Core.add_CoreServiceServicer_to_server(CoreServicer(), server) port = find_free_port() server.add_insecure_port(f"[::]:{port}") server.start() yield port server.stop(0)