Esempio n. 1
0
        static IPackageRepository InjectAuthentication(IPackageRepository remote, RemoteRepositoryEndpoint config)
        {
            if (config.Username == null)
            {
                return(remote);
            }
            var auth = remote.Feature <ISupportAuthentication>();

            if (auth == null)
            {
                return(remote);
            }

            return(new PreAuthenticatedRepository(remote, auth, new NetworkCredential(config.Username, config.Password)));
        }
Esempio n. 2
0
        RemoteEndpointData BuildEndpointData(RemoteRepositoryEndpoint value, string type)
        {
            var repo = Repo(value.Token);

            return(new RemoteEndpointData(repo.Name, type, repo.Type, value.Token, value.Username, value.Password));
        }