in dbeam-core/src/main/java/com/spotify/dbeam/options/PasswordReader.java [41:55]
Optional<String> readPassword(final DBeamPipelineOptions options) throws IOException {
FileSystems.setDefaultPipelineOptions(options);
if (options.getPasswordFileKmsEncrypted() != null) {
LOGGER.info("Decrypting password using KMS...");
return Optional.of(
kmsDecrypter
.decrypt(BeamHelper.readFromFile(options.getPasswordFileKmsEncrypted()))
.trim());
} else if (options.getPasswordFile() != null) {
LOGGER.info("Reading password from file: {}", options.getPasswordFile());
return Optional.of(BeamHelper.readFromFile(options.getPasswordFile()));
} else {
return Optional.ofNullable(options.getPassword());
}
}