コード例 #1
0
ファイル: NuGetFeedBase.cs プロジェクト: CK-Build/CKli
            public bool CheckSecret(IActivityMonitor m, bool throwOnMissing)
            {
                if (_checkedSecret.HasValue)
                {
                    return(_checkedSecret.Value);
                }
                // If we are bound to a repository that has a secret, its configuration, if available, is the one to use!
                INuGetRepository repo = _baseFeed as INuGetRepository;
                bool             isBoundToProtectedRepository = repo != null && !String.IsNullOrEmpty(repo.SecretKeyName);

                if (isBoundToProtectedRepository)
                {
                    var fromRepo = !String.IsNullOrEmpty(repo.ResolveSecret(m, false));
                    if (fromRepo)
                    {
                        m.Trace($"Feed '{Name}' uses secret from repository '{repo.Name}'.");
                        _checkedSecret = true;
                        return(true);
                    }
                }
                if (Credentials != null)
                {
                    string secret;
                    if (Credentials.IsSecretKeyName == true)
                    {
                        secret         = _baseFeed.Client.SecretKeyStore.GetSecretKey(m, Credentials.PasswordOrSecretKeyName, throwOnMissing);
                        _checkedSecret = secret != null;
                        if (_checkedSecret == true)
                        {
                            m.Trace($"Feed '{Name}' uses its configured credential '{Credentials.PasswordOrSecretKeyName}'.");
                        }
                    }
                    else
                    {
                        secret         = Credentials.PasswordOrSecretKeyName;
                        _checkedSecret = true;
                        m.Trace($"Feed '{Name}' uses its configured password.");
                    }
                    if (_checkedSecret == true)
                    {
                        NuGetClient.EnsureVSSFeedEndPointCredentials(m, Url, secret);
                    }
                    else
                    {
                        m.Error($"Feed '{Name}': unable to resolve the credentials.");
                    }
                }
                else
                {
                    // There is no credential: let it be and hope it works.
                    m.Trace($"Feed '{Name}' has no available secret. It must be a public feed.");
                }
                return(_checkedSecret ?? false);
            }
コード例 #2
0
 public MvcFrameworkDependency(INuGetRepository repository, IVisualStudioIntegration visualStudioIntegration)
 {
     if (repository == null)
     {
         throw new ArgumentNullException("repository");
     }
     if (visualStudioIntegration == null)
     {
         throw new ArgumentNullException("visualStudioIntegration");
     }
     this.Repository = repository;
     this.VisualStudioIntegration = visualStudioIntegration;
 }
コード例 #3
0
        public ODataFrameworkDependency(INuGetRepository repository, IVisualStudioIntegration visualStudioIntegration)
        {
            if (repository == null)
            {
                throw new ArgumentNullException("repository");
            }

            if (visualStudioIntegration == null)
            {
                throw new ArgumentNullException("visualStudioIntegration");
            }

            Repository = repository;
            VisualStudioIntegration = visualStudioIntegration;
        }
コード例 #4
0
 public ODataFrameworkDependency(INuGetRepository repository, IVisualStudioIntegration visualStudioIntegration) : base(repository, visualStudioIntegration)
 {
 }
コード例 #5
0
 public MvcFullDependencyInstaller(CodeGenerationContext context, IVisualStudioIntegration visualStudioIntegration, INuGetRepository repository) : base(context, visualStudioIntegration)
 {
     this.Repository = repository;
 }