explicitly define passwords list as transient to prevent it
being marshalled.
@@ -14,6 +14,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.nio.file.Path;
import java.util.List;
+import javax.xml.bind.annotation.XmlTransient;
@XmlAccessorType(XmlAccessType.FIELD)
public class KeyConfiguration extends ConfigItem {
@@ -23,7 +24,7 @@ public class KeyConfiguration extends ConfigItem {
@XmlJavaTypeAdapter(PathAdapter.class)
private Path passwordFile;
- private List<String> passwords;
+ @XmlTransient private List<String> passwords;
@Valid
@NotNull
@@ -31,15 +32,16 @@ public class KeyConfiguration extends ConfigItem {
@XmlJavaTypeAdapter(KeyDataAdapter.class)
private List<@Valid ConfigKeyPair> keyData;
- @Valid
- @XmlElement
- private AzureKeyVaultConfig azureKeyVaultConfig;
+ @Valid @XmlElement private AzureKeyVaultConfig azureKeyVaultConfig;
- @Valid
- @XmlElement
- private HashicorpKeyVaultConfig hashicorpKeyVaultConfig;
+ @Valid @XmlElement private HashicorpKeyVaultConfig hashicorpKeyVaultConfig;
- public KeyConfiguration(final Path passwordFile, final List<String> passwords, final List<ConfigKeyPair> keyData, final AzureKeyVaultConfig azureKeyVaultConfig, final HashicorpKeyVaultConfig hashicorpKeyVaultConfig) {
+ public KeyConfiguration(
+ final Path passwordFile,
+ final List<String> passwords,
+ final List<ConfigKeyPair> keyData,
+ final AzureKeyVaultConfig azureKeyVaultConfig,
+ final HashicorpKeyVaultConfig hashicorpKeyVaultConfig) {
this.passwordFile = passwordFile;
this.passwords = passwords;
this.keyData = keyData;
@@ -47,8 +49,7 @@ public class KeyConfiguration extends ConfigItem {
this.hashicorpKeyVaultConfig = hashicorpKeyVaultConfig;
}
- public KeyConfiguration() {
- }
+ public KeyConfiguration() {}
public Path getPasswordFile() {
return this.passwordFile;
@@ -89,5 +90,4 @@ public class KeyConfiguration extends ConfigItem {
public void setHashicorpKeyVaultConfig(HashicorpKeyVaultConfig hashicorpKeyVaultConfig) {
this.hashicorpKeyVaultConfig = hashicorpKeyVaultConfig;
}
-
}
