public async Task <ServerVersion> GetServerVersion() { var client = new Information.InformationClient(ConnectionManager.ServicesChannel); var version = await client.GetServerVersionAsync(Empty.Instance); return(new ServerVersion(version.ApiServerVersion.Major, version.ApiServerVersion.Minor, version.ApiServerVersion.Name)); }
public async Task <bool> VerifyServer(ServerEndpoint serverEndpoint, HttpClient httpClient, CancellationToken stoppingToken) { var channel = GrpcChannel.ForAddress(serverEndpoint.Uri, new GrpcChannelOptions { DisposeHttpClient = false, HttpClient = httpClient }); var client = new Information.InformationClient(channel); try { var version = await client.GetServerVersionAsync(Services.Empty.Instance); } catch { _logger.LogDebug($"Server couldn't be reached"); return(false); } _logger.LogDebug($"Contacted server"); // todo: query server for identity credentials return(serverEndpoint.IdentityPolicy.IsValid(