Lazy init vault config.
@@ -96,15 +96,25 @@ public class KeyConfiguration extends ConfigItem {
public void setAzureKeyVaultConfig(AzureKeyVaultConfig azureKeyVaultConfig) {
this.azureKeyVaultConfig = azureKeyVaultConfig;
+ this.keyVaultConfig = KeyVaultConfigConverter.convert(azureKeyVaultConfig);
}
public void setHashicorpKeyVaultConfig(HashicorpKeyVaultConfig hashicorpKeyVaultConfig) {
this.hashicorpKeyVaultConfig = hashicorpKeyVaultConfig;
+ this.keyVaultConfig = KeyVaultConfigConverter.convert(hashicorpKeyVaultConfig);
}
public DefaultKeyVaultConfig getKeyVaultConfig() {
+ if (keyVaultConfig != null) {
return keyVaultConfig;
}
+ if (null != azureKeyVaultConfig) {
+ return KeyVaultConfigConverter.convert(azureKeyVaultConfig);
+ } else if (null != hashicorpKeyVaultConfig) {
+ return KeyVaultConfigConverter.convert(hashicorpKeyVaultConfig);
+ }
+ return null;
+ }
public void setKeyVaultConfig(DefaultKeyVaultConfig keyVaultConfig) {
this.keyVaultConfig = keyVaultConfig;
