|
@ -118,14 +118,19 @@ public class Vault implements VaultInterface { |
|
|
println("Type in ID or username"); |
|
|
println("Type in ID or username"); |
|
|
|
|
|
|
|
|
String str = scan.nextLine(); |
|
|
String str = scan.nextLine(); |
|
|
|
|
|
Credential credential = null; |
|
|
|
|
|
|
|
|
if(str.matches("[0-9]+")) { |
|
|
if(str.matches("[0-9]+")) { |
|
|
println("Getting credential via ID"); |
|
|
println("Getting credential via ID"); |
|
|
credentialRepository.getCredentialsViaId(Integer.parseInt(str)); |
|
|
|
|
|
|
|
|
credential = credentialRepository.getCredentialsViaId(Integer.parseInt(str)); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
println("Getting credential via name"); |
|
|
println("Getting credential via name"); |
|
|
credentialRepository.getCredentialsViaName(str); |
|
|
|
|
|
|
|
|
credential = credentialRepository.getCredentialsViaName(str); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (credential != null) { |
|
|
|
|
|
println(credential.getName() + ": " + credential.getPassword()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|