Exemple #1
0
        public new string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("av.db.host: " + AvDbHost);
            sb.AppendLine("av.db.sid: " + AvDbHost);
            sb.AppendLine("av.db.username: "******"av.db.password: "******"av.db.port: " + AvDbHost);

            if (!string.IsNullOrWhiteSpace(AvJetspeedDbName))
            {
                sb.AppendLine("av.jetspeed.db.sid: " + AvJetspeedDbName);
            }
            if (!string.IsNullOrWhiteSpace(AvJetspeedUser))
            {
                sb.AppendLine("av.jetspeed.db.username: "******"av.jetspeed.db.password: "******"av.jetspeed.db.port: " + AvDbHost);
            }
            return(sb.ToString());
        }
Exemple #2
0
        public async Task CloneRepo(string repoUrl, string workingDirectory, string targetDirectory, Action <int, int> statusReporter, Action <string, bool> spinnerAction)
        {
            var co   = new CloneOptions();
            var prog = new CheckoutProgressHandler((path, completed, total) => OnProgressChanged(path, completed, total, statusReporter, spinnerAction));

            co.OnCheckoutProgress  = prog;
            co.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials {
                Username = cache.Settings["git_username"], Password = SecureUtils.Unprotect(cache.Settings["git_password"])
            };
            string password = SecureUtils.Unprotect(cache.Settings["git_password"]);

            spinnerAction($"Downloading from {repoUrl}", true);
            string dir = await Task.Run(() => Repository.Clone(repoUrl, workingDirectory + "\\" + targetDirectory, co));

            Debug.WriteLine(DateTime.Now.ToString() + " - Cloned to " + dir);
        }
Exemple #3
0
        protected bool Authenticate()
        {
            bool isAuthenticated = false;

            lock (ClientSocket)
            {
                if (ClientSocket.Connected)
                {
                    RequestPacket  reqPacket  = NewRequest(RequestPacketType.AUTH, SecureUtils.GetSecureStringValue(_password));
                    ResponsePacket respPacket = SendRequest(reqPacket);

                    if (respPacket.PacketId != -1)
                    {
                        isAuthenticated = true;
                    }
                }
                else
                {
                    throw new ApplicationException("You must be connected before you can authenticate!");
                }
            }
            return(isAuthenticated);
        }
Exemple #4
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(SecureUtils.Unprotect(value.ToString()));
 }
 private async void saveButton_Click(object sender, RoutedEventArgs e)
 {
     cache.Settings["git_password"] = SecureUtils.Protect(passwordTextBox.Password);
     await Task.Run(() => settingsService.WriteSettingsToFile());
 }
Exemple #6
0
 public string GetJetspeedDatabasePassword()
 {
     return(SecureUtils.SecureStringToString(avJetspeedDbPassword));
 }
Exemple #7
0
 public string GetAvDatabasePassword()
 {
     return(SecureUtils.SecureStringToString(avDbPassword));
 }