Implement AutoCloseable
This commit is contained in:
parent
e767c07a61
commit
ed703f6e53
@ -2,6 +2,7 @@
|
||||
* [feature] Initialization from environment variables using `fromEnv()` in factory (#8)
|
||||
* [feature] Automatic authentication with `buildAndAuth()`
|
||||
* [feature] Custom timeout and number of retries (#9)
|
||||
* [feature] Connector implements `AutoCloseable`
|
||||
* [fix] `SecretResponse` does not throw NPE on `get(key)` and `getData()`
|
||||
|
||||
## 0.5.0 [2017-03-18]
|
||||
|
@ -610,6 +610,13 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
return createTokenInternal(token, PATH_TOKEN + PATH_CREATE + "/" + role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
authorized = false;
|
||||
token = null;
|
||||
tokenTTL = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create token.
|
||||
* Centralized method to handle different token creation requests.
|
||||
|
@ -30,7 +30,7 @@ import java.util.*;
|
||||
* @author Stefan Kalscheuer
|
||||
* @since 0.1
|
||||
*/
|
||||
public interface VaultConnector {
|
||||
public interface VaultConnector extends AutoCloseable {
|
||||
String PATH_SECRET = "secret";
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user