Skip to content

Commit 032e7f1

Browse files
Merge pull request #64 from BetterCloud/tls-client-auth
Bumps version to 3.0.0 (release). Fixes Javadoc issues.
2 parents a0e546f + 81aeabb commit 032e7f1

File tree

6 files changed

+78
-64
lines changed

6 files changed

+78
-64
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The driver is available from Maven Central, for all modern Java build systems.
3030
Gradle:
3131
```
3232
dependencies {
33-
compile('com.bettercloud:vault-java-driver:2.0.0')
33+
compile('com.bettercloud:vault-java-driver:3.0.0')
3434
}
3535
```
3636

@@ -39,7 +39,7 @@ Maven:
3939
<dependency>
4040
<groupId>com.bettercloud</groupId>
4141
<artifactId>vault-java-driver</artifactId>
42-
<version>2.0.0</version>
42+
<version>3.0.0</version>
4343
</dependency>
4444
```
4545

@@ -219,7 +219,7 @@ Note that changes to the major version (i.e. the first number) represent possibl
219219
may require modifications in your code to migrate. Changes to the minor version (i.e. the second number)
220220
should represent non-breaking changes. The third number represents any very minor bugfix patches.
221221

222-
* **3.0.0 (IN DEVELOPMENT)**: This is a breaking-change release, with several updates.
222+
* **3.0.0**: This is a breaking-change release, with several updates.
223223
* **API changes**:
224224
* Adds support for writing arbitrary objects to Vault, instead of just strings (i.e. the
225225
`com.bettercloud.vault.api.Logical.write(...)` method now accepts a `Map<String. Object>` rather than a

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'signing'
44

55
group 'com.bettercloud'
66
archivesBaseName = 'vault-java-driver'
7-
version '3.0.0-SNAPSHOT'
7+
version '3.0.0'
88
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
99

1010
compileJava {
@@ -74,15 +74,15 @@ sourceSets {
7474
}
7575

7676
task unitTest(type: Test) {
77-
testClassesDir = sourceSets.unitTests.output.classesDir
77+
testClassesDirs = sourceSets.unitTests.output.classesDirs
7878
classpath = sourceSets.unitTests.runtimeClasspath
7979
testLogging {
8080
events "passed", "skipped", "failed"
8181
}
8282
}
8383

8484
task integrationTest(type: Test) {
85-
testClassesDir = sourceSets.integrationTests.output.classesDir
85+
testClassesDirs= sourceSets.integrationTests.output.classesDirs
8686
classpath = sourceSets.integrationTests.runtimeClasspath
8787
testLogging {
8888
events "passed", "skipped", "failed"

src/main/java/com/bettercloud/vault/SslConfig.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* <p>A container for SSL-related configuration options, meant to be stored within a {@link VaultConfig} instance.</p>
3838
*
3939
* <p>Construct instances of this class using a builder pattern, calling setter methods for each value and then
40-
* terminating with a call to {@link this#build()}:</p>
40+
* terminating with a call to build().</p>
4141
*/
4242
public class SslConfig implements Serializable {
4343

@@ -67,7 +67,7 @@ public class SslConfig implements Serializable {
6767
* <code>protected</code> access level).</p>
6868
*
6969
* @param environmentLoader An environment variable loader implementation (presumably a mock)
70-
* @return This object, with environmentLoader populated, ready for additional builder-pattern method calls or else finalization with the {@link this#build()} method
70+
* @return This object, with environmentLoader populated, ready for additional builder-pattern method calls or else finalization with the build() method
7171
*/
7272
protected SslConfig environmentLoader(final EnvironmentLoader environmentLoader) {
7373
this.environmentLoader = environmentLoader;
@@ -101,7 +101,7 @@ public SslConfig verify(final Boolean verify) {
101101
* If you are not using certificate based client auth, then this field may remain un-set.</p>
102102
*
103103
* <p>Note that you cannot mix-and-match JKS based config with PEM based config. If any of the keyStore or
104-
* trustStore setters are used, then the {@link this#build()} method will complete ignore any PEM data that was
104+
* trustStore setters are used, then the build() method will complete ignore any PEM data that was
105105
* set.</p>
106106
*
107107
* @param keyStore A keystore, containing a client certificate registered with Vault's TLS Certificate auth backend
@@ -120,13 +120,13 @@ public SslConfig keyStore(final KeyStore keyStore, final String password) {
120120
* keystore from a JKS file on the filesystem.</p>
121121
*
122122
* <p>Note that you cannot mix-and-match JKS based config with PEM based config. If any of the keyStore or
123-
* trustStore setters are used, then the {@link this#build()} method will complete ignore any PEM data that was
123+
* trustStore setters are used, then the build() method will complete ignore any PEM data that was
124124
* set.</p>
125125
*
126126
* @param keyStoreFile A JKS keystore file, containing a client certificate registered with Vault's TLS Certificate auth backend
127127
* @param password The password needed to access the keystore (can be <code>null</code>)
128128
* @return This object, with keyStore and keyStorePassword populated, ready for additional builder-pattern method calls or else finalization with the build() method
129-
* @throws VaultException
129+
* @throws VaultException If any error occurs while loading the keystore
130130
*/
131131
public SslConfig keyStoreFile(final File keyStoreFile, final String password) throws VaultException {
132132
try (final InputStream inputStream = new FileInputStream(keyStoreFile)) {
@@ -145,13 +145,13 @@ public SslConfig keyStoreFile(final File keyStoreFile, final String password) th
145145
* JAR/WAR/EAR file).</p>
146146
*
147147
* <p>Note that you cannot mix-and-match JKS based config with PEM based config. If any of the keyStore or
148-
* trustStore setters are used, then the {@link this#build()} method will complete ignore any PEM data that was
148+
* trustStore setters are used, then the build() method will complete ignore any PEM data that was
149149
* set.</p>
150150
*
151151
* @param classpathResource A JKS keystore file, containing a client certificate registered with Vault's TLS Certificate auth backend
152152
* @param password The password needed to access the keystore (can be <code>null</code>)
153153
* @return This object, with keyStore and keyStorePassword populated, ready for additional builder-pattern method calls or else finalization with the build() method
154-
* @throws VaultException
154+
* @throws VaultException If any error occurs while loading the keystore
155155
*/
156156
public SslConfig keyStoreResource(final String classpathResource, final String password) throws VaultException {
157157
try (final InputStream inputStream = this.getClass().getResourceAsStream(classpathResource)) {
@@ -168,8 +168,7 @@ public SslConfig keyStoreResource(final String classpathResource, final String p
168168
* from the server using this cert.</p>
169169
*
170170
* <p>Note that you cannot mix-and-match JKS based config with PEM based config. If any of the keyStore or
171-
* trustStore setters are used, then the {@link this#build()} method will complete ignore any PEM data that was
172-
* set.</p>
171+
* trustStore setters are used, then the build() method will complete ignore any PEM data that was set.</p>
173172
*
174173
* @param trustStore A truststore, containing the Vault server's X509 certificate
175174
* @return This object, with trustStore populated, ready for additional builder-pattern method calls or else finalization with the build() method
@@ -184,11 +183,11 @@ public SslConfig trustStore(final KeyStore trustStore) {
184183
* from the server using this cert. This method load the truststore from a JKS file on the filesystem.</p>
185184
*
186185
* <p>Note that you cannot mix-and-match JKS based config with PEM based config. If any of the keyStore or
187-
* trustStore setters are used, then the {@link this#build()} method will complete ignore any PEM data that was
188-
* set.</p>
186+
* trustStore setters are used, then the build() method will complete ignore any PEM data that was set.</p>
189187
*
190188
* @param trustStoreFile A JKS truststore file, containing the Vault server's X509 certificate
191189
* @return This object, with trustStore populated, ready for additional builder-pattern method calls or else finalization with the build() method
190+
* @throws VaultException If any error occurs while loading the truststore
192191
*/
193192
public SslConfig trustStoreFile(final File trustStoreFile) throws VaultException {
194193
try (final InputStream inputStream = new FileInputStream(trustStoreFile)) {
@@ -205,11 +204,11 @@ public SslConfig trustStoreFile(final File trustStoreFile) throws VaultException
205204
* the JKS file into your library or application's JAR/WAR/EAR file).</p>
206205
*
207206
* <p>Note that you cannot mix-and-match JKS based config with PEM based config. If any of the keyStore or
208-
* trustStore setters are used, then the {@link this#build()} method will complete ignore any PEM data that was
209-
* set.</p>
207+
* trustStore setters are used, then the build() method will complete ignore any PEM data that was set.</p>
210208
*
211209
* @param classpathResource A JKS truststore file, containing the Vault server's X509 certificate
212210
* @return This object, with trustStore populated, ready for additional builder-pattern method calls or else finalization with the build() method
211+
* @throws VaultException If any error occurs while loading the truststore
213212
*/
214213
public SslConfig trustStoreResource(final String classpathResource) throws VaultException {
215214
try (final InputStream inputStream = this.getClass().getResourceAsStream(classpathResource)) {
@@ -320,7 +319,7 @@ public SslConfig pemResource(final String classpathResource) throws VaultExcepti
320319

321320
/**
322321
* <p>An X.509 client certificate, for use with Vault's TLS Certificate auth backend. This string should meet
323-
* the same formatting requirements as {@link this#pemUTF8(String)}.</p>
322+
* the same formatting requirements as pemUTF8(String).</p>
324323
*
325324
* @param clientPemUTF8 An X.509 client certificate, in unencrypted PEM format with UTF-8 encoding.
326325
* @return This object, with clientPemUTF8 populated, ready for additional builder-pattern method calls or else finalization with the build() method
@@ -334,8 +333,7 @@ public SslConfig clientPemUTF8(final String clientPemUTF8) {
334333

335334
/**
336335
* <p>An X.509 client certificate, for use with Vault's TLS Certificate auth backend. This method accepts the
337-
* path of a file containing the certificate data. This file should meet the same requirements as
338-
* {@link this#pemFile(File)}.</p>
336+
* path of a file containing the certificate data. This file should meet the same requirements as pemFile(File).</p>
339337
*
340338
* @param clientPemFile The path of a file containing an X.509 certificate, in unencrypted PEM format with UTF-8 encoding.
341339
* @return This object, with clientPemUTF8 populated, ready for additional builder-pattern method calls or else finalization with the build() method
@@ -355,8 +353,7 @@ public SslConfig clientPemFile(final File clientPemFile) throws VaultException {
355353
/**
356354
* <p>An X.509 certificate, for use with Vault's TLS Certificate auth backend. This method accepts the path of
357355
* a classpath resource containing the certificate data (e.g. you've bundled the cert into your library or
358-
* application's JAR/WAR/EAR file). This resource's contents should meet the same requirements as
359-
* {@link this#pemResource(String)}.</p>
356+
* application's JAR/WAR/EAR file). This resource's contents should meet the same requirements as pemResource(String).</p>
360357
*
361358
* @param classpathResource The path of a classpath resource containing an X.509 certificate, in unencrypted PEM format with UTF-8 encoding.
362359
* @return This object, with clientPemUTF8 populated, ready for additional builder-pattern method calls or else finalization with the build() method
@@ -401,6 +398,7 @@ public SslConfig clientKeyPemUTF8(final String clientKeyPemUTF8) {
401398
*
402399
* @param clientKeyPemFile The path of a file containing an RSA private key, in unencrypted PEM format with UTF-8 encoding.
403400
* @return This object, with clientKeyPemUTF8 populated, ready for additional builder-pattern method calls or else finalization with the build() method
401+
* @throws VaultException If any error occurs while loading and parsing the PEM file
404402
*/
405403
public SslConfig clientKeyPemFile(final File clientKeyPemFile) throws VaultException {
406404
try (final InputStream input = new FileInputStream(clientKeyPemFile)){
@@ -423,6 +421,7 @@ public SslConfig clientKeyPemFile(final File clientKeyPemFile) throws VaultExcep
423421
*
424422
* @param classpathResource The path of a classpath resource containing an RSA private key, in unencrypted PEM format with UTF-8 encoding.
425423
* @return This object, with clientKeyPemUTF8 populated, ready for additional builder-pattern method calls or else finalization with the build() method
424+
* @throws VaultException If any error occurs while loading and parsing the PEM file
426425
*/
427426
public SslConfig clientKeyPemResource(final String classpathResource) throws VaultException {
428427
try (final InputStream input = this.getClass().getResourceAsStream(classpathResource)){
@@ -634,13 +633,13 @@ private static String inputStreamToUTF8(final InputStream input) throws IOExcept
634633
* <p>Therefore, that member field is declared <code>transient</code>. This means that if an SslConfig object is
635634
* serialized, its member field will be <code>null</code> after deserialization. Fortunately, the Java
636635
* deserialization process provides this lifecycle hook, which is used here to re-populate the
637-
* {@link this#sslContext} member field.</p>
636+
* sslContext member field.</p>
638637
*
639638
* @see Serializable
640639
*
641-
* @param in
642-
* @throws IOException
643-
* @throws ClassNotFoundException
640+
* @param in The object being deserialized
641+
* @throws IOException If an error occurs during deserialization (part of the default Java process)
642+
* @throws ClassNotFoundException If an error occurs during deserialization (part of the default Java process)
644643
*/
645644
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {//NOPMD
646645
try {

src/main/java/com/bettercloud/vault/VaultConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* <p>A container for the configuration settings needed to initialize a <code>Vault</code> driver instance.</p>
99
*
1010
* <p>Construct instances of this class using a builder pattern, calling setter methods for each value and then
11-
* terminating with a call to {@link this#build()}:</p>
11+
* terminating with a call to build():</p>
1212
*
1313
* <blockquote>
1414
* <pre>{@code
@@ -49,7 +49,7 @@ public class VaultConfig implements Serializable {
4949
* <code>protected</code> access level).</p>
5050
*
5151
* @param environmentLoader An environment variable loader implementation (presumably a mock)
52-
* @return This object, with environmentLoader populated, ready for additional builder-pattern method calls or else finalization with the {@link this#build()} method
52+
* @return This object, with environmentLoader populated, ready for additional builder-pattern method calls or else finalization with the build() method
5353
*/
5454
protected VaultConfig environmentLoader(final EnvironmentLoader environmentLoader) {
5555
this.environmentLoader = environmentLoader;

0 commit comments

Comments
 (0)