Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dokumentation #91

Merged
merged 25 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
TestResults/
coverage/

# NCrunch
_NCrunch_*
Expand Down Expand Up @@ -363,4 +365,4 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
2 changes: 1 addition & 1 deletion PWManager.CLI/Abstractions/PromptHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static string InputNewPassword() {

public static string? TryPasswordInput() {
var password = ConsoleInteraction.Password(UIstrings.ENTER_PASSWORD);
while (string.IsNullOrWhiteSpace(password) || password.Length < 8) {
while (string.IsNullOrWhiteSpace(password) || password.Length < 4) {
Console.WriteLine(UIstrings.PASSWORD_TOO_SHORT);
password = ConsoleInteraction.Password(UIstrings.ENTER_PASSWORD);
}
Expand Down
30 changes: 16 additions & 14 deletions PWManager.CLI/Controllers/LoginController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,26 @@ public LoginController(ILoginService loginService) {
public ExitCondition Handle(string[] args) {
(var username, var path) = ParseArgs(args);

if (!ConfigFileHandler.DefaultFileExists()) {
if (string.IsNullOrWhiteSpace(username)) {
username = AskForInput(UIstrings.ENTER_USERNAME);
}
if (ConfigFileHandler.DefaultFileExists()) {
var lastUser = ConfigFileHandler.ReadDefaultFile().Split('\n');

if (lastUser.Length == 2) {
if (String.IsNullOrWhiteSpace(username)) {
username = lastUser[0];
}

if (string.IsNullOrWhiteSpace(path)) {
path = AskForInput(UIstrings.ENTER_PATH);
if (String.IsNullOrWhiteSpace(path)) {
path = lastUser[1];
}
}
}

if (string.IsNullOrWhiteSpace(username)) {
username = AskForInput(UIstrings.ENTER_USERNAME);
}
else {
var lastUser = ConfigFileHandler.ReadDefaultFile();
if (String.IsNullOrWhiteSpace(username)) {
username = lastUser.Split('\n')[0];
}

if (String.IsNullOrWhiteSpace(path)) {
path = lastUser.Split('\n')[1];
}
if (string.IsNullOrWhiteSpace(path)) {
path = AskForInput(UIstrings.ENTER_PATH);
}

var succ = PromptHelper.InputPassword((p) => _loginService.Login(username, p, path));
Expand Down
2 changes: 1 addition & 1 deletion PWManager.CLI/UIstrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal static class UIstrings {

// Prompt Helper
public const string EMPTY_INPUT = "Your input was empty! Try again!";
public const string PASSWORD_TOO_SHORT = "Your password was too short. Please use a password with at least 8 characters!";
public const string PASSWORD_TOO_SHORT = "Your password was too short. Please use a password with at least 4 characters!";

public static string ValueCannotBeLessThan(int val) => $"Value cannot be less than {val}";

Expand Down
2 changes: 1 addition & 1 deletion PWManager.Data/System/Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private static string Run (string filename, string arguments){
}
};
process.Start();
string result = process.StandardOutput.ReadToEnd();
string result = string.Empty;
process.WaitForExit();
return result;
}
Expand Down
Binary file added docs/Bewertung/Dokumentationsabgabe.odt
Binary file not shown.
Binary file added docs/Bewertung/Dokumentationsabgabe.pdf
Binary file not shown.
Loading
Loading