Esempio n. 1
0
 public GoogleDriveProvider(ProviderParameters model, IBlobCache blobCache)
 {
     Parameters = model;
     _blobCache = blobCache;
     _isAuthorized.OnNext(false);
     EnsureLoggedInIfTokenSaved();
 }
Esempio n. 2
0
 public YandexDiskProvider(ProviderParameters model, IAuthenticator authenticator)
 {
     Parameters     = model;
     _authenticator = authenticator;
     _isAuthorized.OnNext(false);
     EnsureLoggedInIfTokenSaved();
 }
Esempio n. 3
0
        protected override void ProcessRecord()
        {
            IVault existingVault   = null;
            var    existingProfile = VaultProfileManager.GetProfile(ProfileName);

            if (existingProfile != null)
            {
                try { existingVault = Util.VaultHelper.GetVault(ProfileName); }
                catch (Exception)
                { }
            }

            if (Remove)
            {
                if (existingProfile == null)
                {
                    return;
                }

                if (!Force && existingVault != null && existingVault.TestStorage())
                {
                    throw new InvalidOperationException("profile refers to an existing Vault;"
                                                        + " specify -Force to remove anyway");
                }
                VaultProfileManager.RemoveProfile(ProfileName);
            }
            else
            {
                if (!Force && existingProfile != null)
                {
                    throw new InvalidOperationException("existing profile found;"
                                                        + " specify -Force to overwrite");
                }

                var pp = (IReadOnlyDictionary <string, object>
                          )ProviderParameters.Convert <string, object>();
                var vp = (IReadOnlyDictionary <string, object>
                          )VaultParameters.Convert <string, object>();

                VaultProfileManager.SetProfile(ProfileName, Provider, pp, vp);
            }
        }
Esempio n. 4
0
 public GitHubProvider(ProviderParameters model)
 {
     Parameters = model;
     _isAuthenticated.OnNext(false);
     EnsureLoggedInIfTokenSaved();
 }
Esempio n. 5
0
 public XmlProvider(ProviderParameters constructorParams)
     : this((Uri)SentinelHelper.PassThroughNonNull(constructorParams).Data)
 {
 }
Esempio n. 6
0
 public VkDocsProvider(ProviderParameters model)
 {
     Parameters = model;
     _isAuthorized.OnNext(false);
     EnsureLoggedInIfTokenSaved();
 }
Esempio n. 7
0
 public SftpProvider(ProviderParameters model)
 {
     Parameters = model;
     _isAuthorized.OnNext(false);
 }
Esempio n. 8
0
 public IProvider CreateProvider(ProviderParameters parameters) => parameters.Type switch
 {
Esempio n. 9
0
 public LocalProvider(ProviderParameters model) => Parameters = model;