|
@ -14,6 +14,9 @@ public class Vault implements VaultInterface { |
|
|
public boolean credentialM; |
|
|
public boolean credentialM; |
|
|
public String userName; |
|
|
public String userName; |
|
|
public String password; |
|
|
public String password; |
|
|
|
|
|
public int newID; |
|
|
|
|
|
public String newString; |
|
|
|
|
|
public boolean decision; |
|
|
InputStream inputS = System.in; |
|
|
InputStream inputS = System.in; |
|
|
OutputStream outputS = System.out; |
|
|
OutputStream outputS = System.out; |
|
|
private CredentialRepository credentialRepository = new CredentialRepository(); |
|
|
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 { |
|
|
try { |
|
|
PWLength = Integer.parseInt(pwLength); |
|
|
PWLength = Integer.parseInt(pwLength); |
|
|
} catch (NumberFormatException e) { |
|
|
} catch (NumberFormatException e) { |
|
@ -84,7 +87,7 @@ public class Vault implements VaultInterface { |
|
|
credentialRepository.createNewCredential(userName, password); |
|
|
credentialRepository.createNewCredential(userName, password); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void showCredential(String str){ |
|
|
|
|
|
|
|
|
public void showCredential(String str) { |
|
|
|
|
|
|
|
|
if(str.matches("[0-9]+")) { |
|
|
if(str.matches("[0-9]+")) { |
|
|
println("Getting credential via ID"); |
|
|
println("Getting credential via ID"); |
|
@ -96,6 +99,7 @@ public class Vault implements VaultInterface { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void getAsJson(){ |
|
|
public void getAsJson(){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -174,7 +178,19 @@ public class Vault implements VaultInterface { |
|
|
showCredential(str); |
|
|
showCredential(str); |
|
|
|
|
|
|
|
|
} else if (input.equals("l")) { |
|
|
} 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); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |