Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure writes to VaultConfig and SslConfig are guaranteed to be visible to other threads #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/main/java/com/bettercloud/vault/SslConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ public class SslConfig implements Serializable {
private static final String VAULT_SSL_VERIFY = "VAULT_SSL_VERIFY";
private static final String VAULT_SSL_CERT = "VAULT_SSL_CERT";

private boolean verify;
private transient SSLContext sslContext;
private transient KeyStore trustStore;
private transient KeyStore keyStore;
private String keyStorePassword;
private String pemUTF8; // exposed to unit tests
private String clientPemUTF8;
private String clientKeyPemUTF8;
private Boolean verifyObject;
private EnvironmentLoader environmentLoader;
private volatile boolean verify;
private volatile transient SSLContext sslContext;
private volatile transient KeyStore trustStore;
private volatile transient KeyStore keyStore;
private volatile String keyStorePassword;
private volatile String pemUTF8; // exposed to unit tests
private volatile String clientPemUTF8;
private volatile String clientKeyPemUTF8;
private volatile Boolean verifyObject;
private volatile EnvironmentLoader environmentLoader;

/**
* <p>The code used to load environment variables is encapsulated here, so that a mock version of that environment
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/com/bettercloud/vault/VaultConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ public class VaultConfig implements Serializable {
private static final String VAULT_OPEN_TIMEOUT = "VAULT_OPEN_TIMEOUT";
private static final String VAULT_READ_TIMEOUT = "VAULT_READ_TIMEOUT";

private Map<String, String> secretsEnginePathMap = new ConcurrentHashMap<>();
private String address;
private String token;
private SslConfig sslConfig;
private Integer openTimeout;
private Integer readTimeout;
private int prefixPathDepth = 1;
private int maxRetries;
private int retryIntervalMilliseconds;
private Integer globalEngineVersion;
private String nameSpace;
private EnvironmentLoader environmentLoader;
private volatile Map<String, String> secretsEnginePathMap = new ConcurrentHashMap<>();
private volatile String address;
private volatile String token;
private volatile SslConfig sslConfig;
private volatile Integer openTimeout;
private volatile Integer readTimeout;
private volatile int prefixPathDepth = 1;
private volatile int maxRetries;
private volatile int retryIntervalMilliseconds;
private volatile Integer globalEngineVersion;
private volatile String nameSpace;
private volatile EnvironmentLoader environmentLoader;

/**
* <p>The code used to load environment variables is encapsulated here, so that a mock version of that environment
Expand Down