|
|
@ -14,6 +14,9 @@ public class Vault implements VaultInterface { |
|
|
|
public boolean credentialM; |
|
|
|
public String userName; |
|
|
|
public String password; |
|
|
|
public int newID; |
|
|
|
public String newString; |
|
|
|
public boolean decision; |
|
|
|
InputStream inputS = System.in; |
|
|
|
OutputStream outputS = System.out; |
|
|
|
private CredentialRepository credentialRepository = new CredentialRepository(); |
|
|
@ -69,7 +72,7 @@ public class Vault implements VaultInterface { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setPWLength(String pwLength){ |
|
|
|
public void setPWLength(String pwLength) { |
|
|
|
try { |
|
|
|
PWLength = Integer.parseInt(pwLength); |
|
|
|
} catch (NumberFormatException e) { |
|
|
@ -84,7 +87,7 @@ public class Vault implements VaultInterface { |
|
|
|
credentialRepository.createNewCredential(userName, password); |
|
|
|
} |
|
|
|
|
|
|
|
public void showCredential(String str){ |
|
|
|
public void showCredential(String str) { |
|
|
|
|
|
|
|
if(str.matches("[0-9]+")) { |
|
|
|
println("Getting credential via ID"); |
|
|
@ -96,6 +99,7 @@ public class Vault implements VaultInterface { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void getAsJson(){ |
|
|
|
|
|
|
|
} |
|
|
@ -174,7 +178,19 @@ public class Vault implements VaultInterface { |
|
|
|
showCredential(str); |
|
|
|
|
|
|
|
} else if (input.equals("l")) { |
|
|
|
println("Type username or ID to select credential:"); |
|
|
|
println("Type ID to select credential:"); |
|
|
|
newID = Integer.parseInt(scan.nextLine()); |
|
|
|
println("-change username: u\n-change password: p"); |
|
|
|
input = scan.nextLine(); |
|
|
|
|
|
|
|
if (input.equals("u")) { |
|
|
|
decision = true; |
|
|
|
}else{ |
|
|
|
decision = false; |
|
|
|
} |
|
|
|
println("Type new:"); |
|
|
|
newString = scan.nextLine(); |
|
|
|
//editCredential(newID, newString, decision); |
|
|
|
} |
|
|
|
} |
|
|
|
} |