Exemple #1
0
        public async Task <List <string> > GetDatabaseNames(MajorVersion buildMajorVersion, Reference <bool> authorized, Reference <bool> isLegacyOAuthToken = null)
        {
            authorized.Value = true;
            if (buildMajorVersion == MajorVersion.Unknown)
            {
                return(new List <string>());
            }

            try
            {
                return(buildMajorVersion == MajorVersion.V4
                    ? await Importer.GetDatabasesToMigrate(_serverUrl, _httpClient, _serverStore.ServerShutdown)
                    : await AbstractLegacyMigrator.GetResourcesToMigrate(_serverUrl, _httpClient, false, _apiKey, _enableBasicAuthenticationOverUnsecuredHttp, _skipServerCertificateValidation, isLegacyOAuthToken, _serverStore.ServerShutdown));
            }
            catch (Exception e) when(e is UnauthorizedAccessException || e is AuthorizationException)
            {
                authorized.Value = false;
                return(new List <string>());
            }
        }
Exemple #2
0
        public async Task <List <string> > GetDatabaseNames(MajorVersion builMajorVersion, Reference <bool> authorized)
        {
            authorized.Value = true;
            if (builMajorVersion == MajorVersion.Unknown)
            {
                return(new List <string>());
            }

            try
            {
                return(builMajorVersion == MajorVersion.V4
                    ? await Importer.GetDatabasesToMigrate(_serverUrl, _httpClient, _serverStore.ServerShutdown)
                    : await AbstractLegacyMigrator.GetResourcesToMigrate(_serverUrl, _httpClient, false, _serverStore.ServerShutdown));
            }
            catch (UnauthorizedAccessException)
            {
                authorized.Value = false;
                return(new List <string>());
            }
        }