You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Construct a Vault driver instance with the provided config settings.
64
66
*
65
-
* @param vaultConfig Configuration settings for Vault interaction (e.g. server address, token, etc)
66
-
* If the VaultConfig Engine version path map is not supplied in the config, default to global KV
67
-
* engine version 2.
67
+
* @param vaultConfig Configuration settings for Vault interaction (e.g. server address, token,
68
+
* etc) If the VaultConfig Engine version path map is not supplied in the config, default to
69
+
* global KV engine version 2.
68
70
*/
69
71
publicVault(finalVaultConfigvaultConfig) {
70
72
this.vaultConfig = vaultConfig;
71
73
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
72
-
logger.info(String.format("The NameSpace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
74
+
logger.info(String.format(
75
+
"The NameSpace %s has been bound to this Vault instance. Please keep this in mind when running operations.",
76
+
this.vaultConfig.getNameSpace()));
73
77
}
74
-
if (this.vaultConfig.getSecretsEnginePathMap().isEmpty() && this.vaultConfig.getGlobalEngineVersion() == null) {
75
-
logger.info("Constructing a Vault instance with no provided Engine version, defaulting to version 2.");
78
+
if (this.vaultConfig.getSecretsEnginePathMap().isEmpty()
thrownewIllegalArgumentException("The Engine version must be '1' or '2', the version supplied was: '"
89
-
+ engineVersion + "'.");
97
+
thrownewIllegalArgumentException(
98
+
"The Engine version must be '1' or '2', the version supplied was: '"
99
+
+ engineVersion + "'.");
90
100
}
91
101
vaultConfig.setEngineVersion(engineVersion);
92
102
this.vaultConfig = vaultConfig;
93
103
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
94
-
logger.info(String.format("The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
104
+
logger.info(String.format(
105
+
"The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.",
106
+
this.vaultConfig.getNameSpace()));
95
107
}
96
108
}
97
109
98
110
/**
99
111
* Construct a Vault driver instance with the provided config settings.
100
112
*
101
-
* @param vaultConfig Configuration settings for Vault interaction (e.g. server address, token, etc)
102
-
* If the Secrets engine version path map is not provided, or does not contain the
103
-
* requested secret, fall back to the global version supplied.
104
-
* @param useSecretsEnginePathMap Whether to use a provided KV Engine version map from the Vault config, or generate one.
105
-
* If a secrets KV Engine version map is not supplied, use Vault APIs to determine the
106
-
* KV Engine version for each secret. This call requires admin rights.
107
-
* @param globalFallbackVersion The Integer version of the KV Engine to use as a global fallback.
108
-
*
109
-
* @throws VaultException If any error occurs
113
+
* @param vaultConfig Configuration settings for Vault interaction (e.g. server address, token,
114
+
* etc) If the Secrets engine version path map is not provided, or does not contain the
115
+
* requested secret, fall back to the global version supplied.
116
+
* @param useSecretsEnginePathMap Whether to use a provided KV Engine version map from the Vault
117
+
* config, or generate one. If a secrets KV Engine version map is not supplied, use Vault APIs
118
+
* to determine the KV Engine version for each secret. This call requires admin rights.
119
+
* @param globalFallbackVersion The Integer version of the KV Engine to use as a global
if (this.vaultConfig.getNameSpace() != null && !this.vaultConfig.getNameSpace().isEmpty()) {
115
-
logger.info(String.format("The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.", this.vaultConfig.getNameSpace()));
128
+
logger.info(String.format(
129
+
"The Namespace %s has been bound to this Vault instance. Please keep this in mind when running operations.",
0 commit comments