Skip to content

Commit

Permalink
Added decoding for passphrase of a server.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbusche committed Apr 27, 2022
1 parent 5e6f7be commit d5aec26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/org/github/jelmerk/maven/settings/Decoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class Decoder {
private static final int MISSING_OR_INVALID_ARGUMENTS_EXIT_CODE = 1;

public static void main(String... args) throws Exception {

Options options = createOptions();

CommandLineParser parser = new PosixParser();
Expand Down Expand Up @@ -106,13 +105,21 @@ private static void printPasswords(File settingsFile, File securityFile)

for (Server server : servers) {
String encodedServerPassword = server.getPassword();
String encodedServerPassphrase = server.getPassphrase();
String plainTextServerPassword = decodePassword(encodedServerPassword, plainTextMasterPassword);
String plainTextServerPassphrase = decodePassword(encodedServerPassphrase, plainTextMasterPassword);

System.out.println("-------------------------------------------------------------------------");
System.out.printf("Credentials for server %s are :%n", server.getId());
System.out.printf("Username : %s%n", server.getUsername());
System.out.printf("Password : %s%n", plainTextServerPassword);
if (plainTextServerPassword != null) {
System.out.printf("Password : %s%n", plainTextServerPassword);
}
if (plainTextServerPassphrase != null) {
System.out.printf("Passphrase : %s%n", plainTextServerPassphrase);
}
}

}

}

0 comments on commit d5aec26

Please sign in to comment.