fix issue with the LP Vault impl and servers with more than one server context

This commit is contained in:
Luck
2017-11-21 16:44:20 +00:00
Unverified
parent 29eba93ee3
commit e71ef834c0
3 changed files with 74 additions and 40 deletions
@@ -303,12 +303,17 @@ public class ConfigKeys {
*/
public static final ConfigKey<Boolean> COMMANDS_ALLOW_OP = EnduringKey.wrap(BooleanKey.of("commands-allow-op", true));
/**
* If the vault server option should be used
*/
public static final ConfigKey<Boolean> USE_VAULT_SERVER = BooleanKey.of("use-vault-server", true);
/**
* The name of the server to use for Vault.
*/
public static final ConfigKey<String> VAULT_SERVER = AbstractKey.of(c -> {
// default to true for backwards compatibility
if (c.getBoolean("use-vault-server", true)) {
if (USE_VAULT_SERVER.get(c)) {
return c.getString("vault-server", "global").toLowerCase();
} else {
return SERVER.get(c);