style: trim multiline indentation to 4 spaces
All checks were successful
CI / build-with-it (11, 1.2.0) (push) Successful in 56s
CI / build-with-it (17, 1.2.0) (push) Successful in 56s
CI / build-with-it (21, 1.2.0) (push) Successful in 51s
CI / build-with-it (17, 1.19.0) (push) Successful in 49s
CI / build-with-it (11, 1.19.0) (push) Successful in 51s
CI / build-with-it (true, 21, 1.19.0) (push) Successful in 57s

This commit is contained in:
Stefan Kalscheuer 2025-04-11 17:20:24 +02:00
parent d51af06e29
commit e9aeda9a55
Signed by: stefan
GPG Key ID: 3887EC2A53B55430
19 changed files with 264 additions and 263 deletions

View File

@ -86,14 +86,14 @@ public class HTTPVaultConnector implements VaultConnector {
*/ */
HTTPVaultConnector(final HTTPVaultConnectorBuilder builder) { HTTPVaultConnector(final HTTPVaultConnectorBuilder builder) {
this.request = new RequestHelper( this.request = new RequestHelper(
((builder.isWithTLS()) ? "https" : "http") + "://" + ((builder.isWithTLS()) ? "https" : "http") + "://" +
builder.getHost() + builder.getHost() +
((builder.getPort() != null) ? ":" + builder.getPort() : "") + ((builder.getPort() != null) ? ":" + builder.getPort() : "") +
builder.getPrefix(), builder.getPrefix(),
builder.getNumberOfRetries(), builder.getNumberOfRetries(),
builder.getTimeout(), builder.getTimeout(),
builder.getTlsVersion(), builder.getTlsVersion(),
builder.getTrustedCA() builder.getTrustedCA()
); );
} }
@ -150,8 +150,8 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final SealResponse unseal(final String key, final Boolean reset) throws VaultConnectorException { public final SealResponse unseal(final String key, final Boolean reset) throws VaultConnectorException {
Map<String, String> param = mapOfStrings( Map<String, String> param = mapOfStrings(
"key", key, "key", key,
"reset", reset "reset", reset
); );
return request.put(PATH_UNSEAL, param, token, SealResponse.class); return request.put(PATH_UNSEAL, param, token, SealResponse.class);
@ -161,15 +161,15 @@ public class HTTPVaultConnector implements VaultConnector {
public HealthResponse getHealth() throws VaultConnectorException { public HealthResponse getHealth() throws VaultConnectorException {
return request.get( return request.get(
PATH_HEALTH, PATH_HEALTH,
// Force status code to be 200, so we don't need to modify the request sequence. // Force status code to be 200, so we don't need to modify the request sequence.
Map.of( Map.of(
"standbycode", "200", // Default: 429. "standbycode", "200", // Default: 429.
"sealedcode", "200", // Default: 503. "sealedcode", "200", // Default: 503.
"uninitcode", "200" // Default: 501. "uninitcode", "200" // Default: 501.
), ),
token, token,
HealthResponse.class HealthResponse.class
); );
} }
@ -199,7 +199,7 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final AuthResponse authUserPass(final String username, final String password) public final AuthResponse authUserPass(final String username, final String password)
throws VaultConnectorException { throws VaultConnectorException {
final Map<String, String> payload = singletonMap("password", password); final Map<String, String> payload = singletonMap("password", password);
return queryAuth(PATH_AUTH_USERPASS + username, payload); return queryAuth(PATH_AUTH_USERPASS + username, payload);
} }
@ -207,8 +207,8 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final AuthResponse authAppRole(final String roleID, final String secretID) throws VaultConnectorException { public final AuthResponse authAppRole(final String roleID, final String secretID) throws VaultConnectorException {
final Map<String, String> payload = mapOfStrings( final Map<String, String> payload = mapOfStrings(
"role_id", roleID, "role_id", roleID,
"secret_id", secretID "secret_id", secretID
); );
return queryAuth(PATH_AUTH_APPROLE + PATH_LOGIN, payload); return queryAuth(PATH_AUTH_APPROLE + PATH_LOGIN, payload);
} }
@ -222,7 +222,7 @@ public class HTTPVaultConnector implements VaultConnector {
* @throws VaultConnectorException on errors * @throws VaultConnectorException on errors
*/ */
private AuthResponse queryAuth(final String path, final Map<String, String> payload) private AuthResponse queryAuth(final String path, final Map<String, String> payload)
throws VaultConnectorException { throws VaultConnectorException {
/* Issue request and parse response */ /* Issue request and parse response */
AuthResponse auth = request.post(path, payload, token, AuthResponse.class); AuthResponse auth = request.post(path, payload, token, AuthResponse.class);
/* verify response */ /* verify response */
@ -249,10 +249,10 @@ public class HTTPVaultConnector implements VaultConnector {
requireAuth(); requireAuth();
/* Request HTTP response and parse Secret */ /* Request HTTP response and parse Secret */
return request.get( return request.get(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, ""), String.format(PATH_AUTH_APPROLE_ROLE, roleName, ""),
emptyMap(), emptyMap(),
token, token,
AppRoleResponse.class AppRoleResponse.class
); );
} }
@ -271,10 +271,10 @@ public class HTTPVaultConnector implements VaultConnector {
requireAuth(); requireAuth();
/* Issue request, parse response and extract Role ID */ /* Issue request, parse response and extract Role ID */
return request.get( return request.get(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/role-id"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/role-id"),
emptyMap(), emptyMap(),
token, token,
RawDataResponse.class RawDataResponse.class
).getData().get("role_id").toString(); ).getData().get("role_id").toString();
} }
@ -284,9 +284,9 @@ public class HTTPVaultConnector implements VaultConnector {
/* Issue request and expect code 204 with empty response */ /* Issue request and expect code 204 with empty response */
request.postWithoutResponse( request.postWithoutResponse(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/role-id"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/role-id"),
singletonMap("role_id", roleID), singletonMap("role_id", roleID),
token token
); );
return true; return true;
@ -294,49 +294,49 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final AppRoleSecretResponse createAppRoleSecret(final String roleName, final AppRoleSecret secret) public final AppRoleSecretResponse createAppRoleSecret(final String roleName, final AppRoleSecret secret)
throws VaultConnectorException { throws VaultConnectorException {
requireAuth(); requireAuth();
if (secret.getId() != null && !secret.getId().isEmpty()) { if (secret.getId() != null && !secret.getId().isEmpty()) {
return request.post( return request.post(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/custom-secret-id"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/custom-secret-id"),
secret, secret,
token, token,
AppRoleSecretResponse.class AppRoleSecretResponse.class
); );
} else { } else {
return request.post( return request.post(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id"),
secret, token, secret, token,
AppRoleSecretResponse.class AppRoleSecretResponse.class
); );
} }
} }
@Override @Override
public final AppRoleSecretResponse lookupAppRoleSecret(final String roleName, final String secretID) public final AppRoleSecretResponse lookupAppRoleSecret(final String roleName, final String secretID)
throws VaultConnectorException { throws VaultConnectorException {
requireAuth(); requireAuth();
/* Issue request and parse secret response */ /* Issue request and parse secret response */
return request.post( return request.post(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id/lookup"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id/lookup"),
new AppRoleSecret(secretID), new AppRoleSecret(secretID),
token, token,
AppRoleSecretResponse.class AppRoleSecretResponse.class
); );
} }
@Override @Override
public final boolean destroyAppRoleSecret(final String roleName, final String secretID) public final boolean destroyAppRoleSecret(final String roleName, final String secretID)
throws VaultConnectorException { throws VaultConnectorException {
requireAuth(); requireAuth();
/* Issue request and expect code 204 with empty response */ /* Issue request and expect code 204 with empty response */
request.postWithoutResponse( request.postWithoutResponse(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id/destroy"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id/destroy"),
new AppRoleSecret(secretID), new AppRoleSecret(secretID),
token); token);
return true; return true;
} }
@ -346,10 +346,10 @@ public class HTTPVaultConnector implements VaultConnector {
requireAuth(); requireAuth();
SecretListResponse secrets = request.get( SecretListResponse secrets = request.get(
PATH_AUTH_APPROLE + "/role?list=true", PATH_AUTH_APPROLE + "/role?list=true",
emptyMap(), emptyMap(),
token, token,
SecretListResponse.class SecretListResponse.class
); );
return secrets.getKeys(); return secrets.getKeys();
@ -360,10 +360,10 @@ public class HTTPVaultConnector implements VaultConnector {
requireAuth(); requireAuth();
SecretListResponse secrets = request.get( SecretListResponse secrets = request.get(
String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id?list=true"), String.format(PATH_AUTH_APPROLE_ROLE, roleName, "/secret-id?list=true"),
emptyMap(), emptyMap(),
token, token,
SecretListResponse.class SecretListResponse.class
); );
return secrets.getKeys(); return secrets.getKeys();
@ -378,7 +378,7 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final SecretResponse readSecretVersion(final String mount, final String key, final Integer version) public final SecretResponse readSecretVersion(final String mount, final String key, final Integer version)
throws VaultConnectorException { throws VaultConnectorException {
requireAuth(); requireAuth();
/* Request HTTP response and parse secret metadata */ /* Request HTTP response and parse secret metadata */
Map<String, String> args = mapOfStrings("version", version); Map<String, String> args = mapOfStrings("version", version);
@ -388,7 +388,7 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final MetadataResponse readSecretMetadata(final String mount, final String key) public final MetadataResponse readSecretMetadata(final String mount, final String key)
throws VaultConnectorException { throws VaultConnectorException {
requireAuth(); requireAuth();
/* Request HTTP response and parse secret metadata */ /* Request HTTP response and parse secret metadata */
@ -403,8 +403,8 @@ public class HTTPVaultConnector implements VaultConnector {
requireAuth(); requireAuth();
Map<String, Object> payload = mapOf( Map<String, Object> payload = mapOf(
"max_versions", maxVersions, "max_versions", maxVersions,
"cas_required", casRequired "cas_required", casRequired
); );
write(mount + PATH_METADATA + key, payload); write(mount + PATH_METADATA + key, payload);
@ -426,13 +426,13 @@ public class HTTPVaultConnector implements VaultConnector {
/* Issue request and parse metadata response */ /* Issue request and parse metadata response */
return request.post( return request.post(
mount + PATH_DATA + key, mount + PATH_DATA + key,
Map.of( Map.of(
"data", data, "data", data,
"options", options "options", options
), ),
token, token,
SecretVersionResponse.class SecretVersionResponse.class
); );
} }
@ -447,7 +447,7 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final void write(final String key, final Map<String, Object> data, final Map<String, Object> options) public final void write(final String key, final Map<String, Object> data, final Map<String, Object> options)
throws VaultConnectorException { throws VaultConnectorException {
requireAuth(); requireAuth();
if (key == null || key.isEmpty()) { if (key == null || key.isEmpty()) {
@ -460,8 +460,8 @@ public class HTTPVaultConnector implements VaultConnector {
// If options are given, split payload in two parts. // If options are given, split payload in two parts.
if (options != null) { if (options != null) {
payload = Map.of( payload = Map.of(
"data", data, "data", data,
"options", options "options", options
); );
} }
@ -489,19 +489,19 @@ public class HTTPVaultConnector implements VaultConnector {
@Override @Override
public final void deleteSecretVersions(final String mount, final String key, final int... versions) public final void deleteSecretVersions(final String mount, final String key, final int... versions)
throws VaultConnectorException { throws VaultConnectorException {
handleSecretVersions(mount, PATH_DELETE, key, versions); handleSecretVersions(mount, PATH_DELETE, key, versions);
} }
@Override @Override
public final void undeleteSecretVersions(final String mount, final String key, final int... versions) public final void undeleteSecretVersions(final String mount, final String key, final int... versions)
throws VaultConnectorException { throws VaultConnectorException {
handleSecretVersions(mount, PATH_UNDELETE, key, versions); handleSecretVersions(mount, PATH_UNDELETE, key, versions);
} }
@Override @Override
public final void destroySecretVersions(final String mount, final String key, final int... versions) public final void destroySecretVersions(final String mount, final String key, final int... versions)
throws VaultConnectorException { throws VaultConnectorException {
handleSecretVersions(mount, PATH_DESTROY, key, versions); handleSecretVersions(mount, PATH_DESTROY, key, versions);
} }
@ -541,8 +541,8 @@ public class HTTPVaultConnector implements VaultConnector {
requireAuth(); requireAuth();
Map<String, String> payload = mapOfStrings( Map<String, String> payload = mapOfStrings(
"lease_id", leaseID, "lease_id", leaseID,
"increment", increment "increment", increment
); );
/* Issue request and parse secret response */ /* Issue request and parse secret response */
@ -599,10 +599,10 @@ public class HTTPVaultConnector implements VaultConnector {
/* Request HTTP response and parse Secret */ /* Request HTTP response and parse Secret */
return request.get( return request.get(
PATH_AUTH_TOKEN + PATH_LOOKUP, PATH_AUTH_TOKEN + PATH_LOOKUP,
singletonMap("token", token), singletonMap("token", token),
token, token,
TokenResponse.class TokenResponse.class
); );
} }

View File

@ -100,9 +100,9 @@ public final class HTTPVaultConnectorBuilder {
path = DEFAULT_PREFIX; path = DEFAULT_PREFIX;
} }
return withTLS(!("http".equalsIgnoreCase(baseURL.getScheme()))) return withTLS(!("http".equalsIgnoreCase(baseURL.getScheme())))
.withHost(baseURL.getHost()) .withHost(baseURL.getHost())
.withPort(baseURL.getPort()) .withPort(baseURL.getPort())
.withPrefix(path); .withPrefix(path);
} }
/** /**

View File

@ -191,7 +191,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.4.0 * @since 0.4.0
*/ */
default boolean createAppRole(final String roleName, final List<String> policies, final String roleID) default boolean createAppRole(final String roleName, final List<String> policies, final String roleID)
throws VaultConnectorException { throws VaultConnectorException {
return createAppRole(AppRole.builder(roleName).withTokenPolicies(policies).withId(roleID).build()); return createAppRole(AppRole.builder(roleName).withTokenPolicies(policies).withId(roleID).build());
} }
@ -257,7 +257,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.4.0 * @since 0.4.0
*/ */
default AppRoleSecretResponse createAppRoleSecret(final String roleName, final String secretID) default AppRoleSecretResponse createAppRoleSecret(final String roleName, final String secretID)
throws VaultConnectorException { throws VaultConnectorException {
return createAppRoleSecret(roleName, new AppRoleSecret(secretID)); return createAppRoleSecret(roleName, new AppRoleSecret(secretID));
} }
@ -271,7 +271,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.4.0 * @since 0.4.0
*/ */
AppRoleSecretResponse createAppRoleSecret(final String roleName, final AppRoleSecret secret) AppRoleSecretResponse createAppRoleSecret(final String roleName, final AppRoleSecret secret)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Lookup an AppRole secret. * Lookup an AppRole secret.
@ -283,7 +283,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.4.0 * @since 0.4.0
*/ */
AppRoleSecretResponse lookupAppRoleSecret(final String roleName, final String secretID) AppRoleSecretResponse lookupAppRoleSecret(final String roleName, final String secretID)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Destroy an AppRole secret. * Destroy an AppRole secret.
@ -398,7 +398,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.8 * @since 0.8
*/ */
SecretResponse readSecretVersion(final String mount, final String key, final Integer version) SecretResponse readSecretVersion(final String mount, final String key, final Integer version)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Retrieve secret metadata from Vault. * Retrieve secret metadata from Vault.
@ -476,7 +476,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.8 {@code options} parameter added * @since 0.8 {@code options} parameter added
*/ */
void write(final String key, final Map<String, Object> data, final Map<String, Object> options) void write(final String key, final Map<String, Object> data, final Map<String, Object> options)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Delete key from Vault. * Delete key from Vault.
@ -524,7 +524,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.8 * @since 0.8
*/ */
void deleteSecretVersions(final String mount, final String key, final int... versions) void deleteSecretVersions(final String mount, final String key, final int... versions)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Undelete (restore) secret versions from Vault. * Undelete (restore) secret versions from Vault.
@ -537,7 +537,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.8 * @since 0.8
*/ */
void undeleteSecretVersions(final String mount, final String key, final int... versions) void undeleteSecretVersions(final String mount, final String key, final int... versions)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Destroy secret versions from Vault. * Destroy secret versions from Vault.
@ -550,7 +550,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.8 * @since 0.8
*/ */
void destroySecretVersions(final String mount, final String key, final int... versions) void destroySecretVersions(final String mount, final String key, final int... versions)
throws VaultConnectorException; throws VaultConnectorException;
/** /**
* Revoke given lease immediately. * Revoke given lease immediately.
@ -724,8 +724,8 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Hash data via transit engine from Vault. * Hash data via transit engine from Vault.
* *
* @param algorithm Specifies the hash algorithm to use * @param algorithm Specifies the hash algorithm to use
* @param input Data to hash (Base64 encoded) * @param input Data to hash (Base64 encoded)
* @param format Specifies the output encoding (hex/base64) * @param format Specifies the output encoding (hex/base64)
* @return Transit response * @return Transit response
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
* @since 1.5.0 * @since 1.5.0
@ -813,7 +813,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @since 0.5.0 * @since 0.5.0
*/ */
default CredentialsResponse readDbCredentials(final String role, final String mount) default CredentialsResponse readDbCredentials(final String role, final String mount)
throws VaultConnectorException { throws VaultConnectorException {
return (CredentialsResponse) read(mount + "/creds/" + role); return (CredentialsResponse) read(mount + "/creds/" + role);
} }
} }

View File

@ -66,9 +66,9 @@ public final class RequestHelper implements Serializable {
this.tlsVersion = tlsVersion; this.tlsVersion = tlsVersion;
this.trustedCaCert = trustedCaCert; this.trustedCaCert = trustedCaCert;
this.jsonMapper = new ObjectMapper() this.jsonMapper = new ObjectMapper()
.registerModule(new JavaTimeModule()) .registerModule(new JavaTimeModule())
.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); .disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
} }
/** /**
@ -115,7 +115,7 @@ public final class RequestHelper implements Serializable {
* @since 0.8 * @since 0.8
*/ */
public <T> T post(final String path, final Object payload, final String token, final Class<T> target) public <T> T post(final String path, final Object payload, final String token, final Class<T> target)
throws VaultConnectorException { throws VaultConnectorException {
try { try {
String response = post(path, payload, token); String response = post(path, payload, token);
return jsonMapper.readValue(response, target); return jsonMapper.readValue(response, target);
@ -134,7 +134,7 @@ public final class RequestHelper implements Serializable {
* @since 0.8 * @since 0.8
*/ */
public void postWithoutResponse(final String path, final Object payload, final String token) public void postWithoutResponse(final String path, final Object payload, final String token)
throws VaultConnectorException { throws VaultConnectorException {
if (!post(path, payload, token).isEmpty()) { if (!post(path, payload, token).isEmpty()) {
throw new InvalidResponseException(Error.UNEXPECTED_RESPONSE); throw new InvalidResponseException(Error.UNEXPECTED_RESPONSE);
} }
@ -151,7 +151,7 @@ public final class RequestHelper implements Serializable {
* @since 0.8 Added {@code token} parameter. * @since 0.8 Added {@code token} parameter.
*/ */
public String put(final String path, final Map<String, String> payload, final String token) public String put(final String path, final Map<String, String> payload, final String token)
throws VaultConnectorException { throws VaultConnectorException {
// Initialize PUT. // Initialize PUT.
var req = HttpRequest.newBuilder(URI.create(baseURL + path)); var req = HttpRequest.newBuilder(URI.create(baseURL + path));
@ -185,7 +185,7 @@ public final class RequestHelper implements Serializable {
* @since 0.8 * @since 0.8
*/ */
public <T> T put(final String path, final Map<String, String> payload, final String token, final Class<T> target) public <T> T put(final String path, final Map<String, String> payload, final String token, final Class<T> target)
throws VaultConnectorException { throws VaultConnectorException {
try { try {
String response = put(path, payload, token); String response = put(path, payload, token);
return jsonMapper.readValue(response, target); return jsonMapper.readValue(response, target);
@ -204,7 +204,7 @@ public final class RequestHelper implements Serializable {
* @since 0.8 * @since 0.8
*/ */
public void putWithoutResponse(final String path, final Map<String, String> payload, final String token) public void putWithoutResponse(final String path, final Map<String, String> payload, final String token)
throws VaultConnectorException { throws VaultConnectorException {
if (!put(path, payload, token).isEmpty()) { if (!put(path, payload, token).isEmpty()) {
throw new InvalidResponseException(Error.UNEXPECTED_RESPONSE); throw new InvalidResponseException(Error.UNEXPECTED_RESPONSE);
} }
@ -256,15 +256,15 @@ public final class RequestHelper implements Serializable {
* @since 0.8 Added {@code token} parameter. * @since 0.8 Added {@code token} parameter.
*/ */
public String get(final String path, final Map<String, String> payload, final String token) public String get(final String path, final Map<String, String> payload, final String token)
throws VaultConnectorException { throws VaultConnectorException {
// Add parameters to URI. // Add parameters to URI.
var uriBuilder = new StringBuilder(baseURL + path); var uriBuilder = new StringBuilder(baseURL + path);
if (!payload.isEmpty()) { if (!payload.isEmpty()) {
uriBuilder.append("?").append( uriBuilder.append("?").append(
payload.entrySet().stream().map(par -> payload.entrySet().stream().map(par ->
URLEncoder.encode(par.getKey(), UTF_8) + "=" + URLEncoder.encode(par.getValue(), UTF_8) URLEncoder.encode(par.getKey(), UTF_8) + "=" + URLEncoder.encode(par.getValue(), UTF_8)
).collect(Collectors.joining("&")) ).collect(Collectors.joining("&"))
); );
} }
@ -297,7 +297,7 @@ public final class RequestHelper implements Serializable {
* @since 0.8 * @since 0.8
*/ */
public <T> T get(final String path, final Map<String, String> payload, final String token, final Class<T> target) public <T> T get(final String path, final Map<String, String> payload, final String token, final Class<T> target)
throws VaultConnectorException { throws VaultConnectorException {
try { try {
String response = get(path, payload, token); String response = get(path, payload, token);
return jsonMapper.readValue(response, target); return jsonMapper.readValue(response, target);
@ -333,8 +333,8 @@ public final class RequestHelper implements Serializable {
// Execute request. // Execute request.
try { try {
HttpResponse<InputStream> response = client.sendAsync( HttpResponse<InputStream> response = client.sendAsync(
requestBuilder.build(), requestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream() HttpResponse.BodyHandlers.ofInputStream()
).join(); ).join();
/* Check if response is valid */ /* Check if response is valid */

View File

@ -331,28 +331,28 @@ public final class AppRole implements Serializable {
} }
AppRole appRole = (AppRole) o; AppRole appRole = (AppRole) o;
return Objects.equals(name, appRole.name) && return Objects.equals(name, appRole.name) &&
Objects.equals(id, appRole.id) && Objects.equals(id, appRole.id) &&
Objects.equals(bindSecretId, appRole.bindSecretId) && Objects.equals(bindSecretId, appRole.bindSecretId) &&
Objects.equals(secretIdBoundCidrs, appRole.secretIdBoundCidrs) && Objects.equals(secretIdBoundCidrs, appRole.secretIdBoundCidrs) &&
Objects.equals(secretIdNumUses, appRole.secretIdNumUses) && Objects.equals(secretIdNumUses, appRole.secretIdNumUses) &&
Objects.equals(secretIdTtl, appRole.secretIdTtl) && Objects.equals(secretIdTtl, appRole.secretIdTtl) &&
Objects.equals(localSecretIds, appRole.localSecretIds) && Objects.equals(localSecretIds, appRole.localSecretIds) &&
Objects.equals(tokenTtl, appRole.tokenTtl) && Objects.equals(tokenTtl, appRole.tokenTtl) &&
Objects.equals(tokenMaxTtl, appRole.tokenMaxTtl) && Objects.equals(tokenMaxTtl, appRole.tokenMaxTtl) &&
Objects.equals(tokenPolicies, appRole.tokenPolicies) && Objects.equals(tokenPolicies, appRole.tokenPolicies) &&
Objects.equals(tokenBoundCidrs, appRole.tokenBoundCidrs) && Objects.equals(tokenBoundCidrs, appRole.tokenBoundCidrs) &&
Objects.equals(tokenExplicitMaxTtl, appRole.tokenExplicitMaxTtl) && Objects.equals(tokenExplicitMaxTtl, appRole.tokenExplicitMaxTtl) &&
Objects.equals(tokenNoDefaultPolicy, appRole.tokenNoDefaultPolicy) && Objects.equals(tokenNoDefaultPolicy, appRole.tokenNoDefaultPolicy) &&
Objects.equals(tokenNumUses, appRole.tokenNumUses) && Objects.equals(tokenNumUses, appRole.tokenNumUses) &&
Objects.equals(tokenPeriod, appRole.tokenPeriod) && Objects.equals(tokenPeriod, appRole.tokenPeriod) &&
Objects.equals(tokenType, appRole.tokenType); Objects.equals(tokenType, appRole.tokenType);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, id, bindSecretId, secretIdBoundCidrs, secretIdNumUses, secretIdTtl, return Objects.hash(name, id, bindSecretId, secretIdBoundCidrs, secretIdNumUses, secretIdTtl,
localSecretIds, tokenTtl, tokenMaxTtl, tokenPolicies, tokenBoundCidrs, tokenExplicitMaxTtl, localSecretIds, tokenTtl, tokenMaxTtl, tokenPolicies, tokenBoundCidrs, tokenExplicitMaxTtl,
tokenNoDefaultPolicy, tokenNumUses, tokenPeriod, tokenType); tokenNoDefaultPolicy, tokenNumUses, tokenPeriod, tokenType);
} }

View File

@ -181,19 +181,19 @@ public final class AppRoleSecret implements Serializable {
} }
AppRoleSecret that = (AppRoleSecret) o; AppRoleSecret that = (AppRoleSecret) o;
return Objects.equals(id, that.id) && return Objects.equals(id, that.id) &&
Objects.equals(accessor, that.accessor) && Objects.equals(accessor, that.accessor) &&
Objects.equals(metadata, that.metadata) && Objects.equals(metadata, that.metadata) &&
Objects.equals(cidrList, that.cidrList) && Objects.equals(cidrList, that.cidrList) &&
Objects.equals(creationTime, that.creationTime) && Objects.equals(creationTime, that.creationTime) &&
Objects.equals(expirationTime, that.expirationTime) && Objects.equals(expirationTime, that.expirationTime) &&
Objects.equals(lastUpdatedTime, that.lastUpdatedTime) && Objects.equals(lastUpdatedTime, that.lastUpdatedTime) &&
Objects.equals(numUses, that.numUses) && Objects.equals(numUses, that.numUses) &&
Objects.equals(ttl, that.ttl); Objects.equals(ttl, that.ttl);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, accessor, metadata, cidrList, creationTime, expirationTime, lastUpdatedTime, numUses, return Objects.hash(id, accessor, metadata, cidrList, creationTime, expirationTime, lastUpdatedTime, numUses,
ttl); ttl);
} }
} }

View File

@ -227,24 +227,24 @@ public final class Token implements Serializable {
} }
Token token = (Token) o; Token token = (Token) o;
return Objects.equals(id, token.id) && return Objects.equals(id, token.id) &&
Objects.equals(type, token.type) && Objects.equals(type, token.type) &&
Objects.equals(displayName, token.displayName) && Objects.equals(displayName, token.displayName) &&
Objects.equals(noParent, token.noParent) && Objects.equals(noParent, token.noParent) &&
Objects.equals(noDefaultPolicy, token.noDefaultPolicy) && Objects.equals(noDefaultPolicy, token.noDefaultPolicy) &&
Objects.equals(ttl, token.ttl) && Objects.equals(ttl, token.ttl) &&
Objects.equals(explicitMaxTtl, token.explicitMaxTtl) && Objects.equals(explicitMaxTtl, token.explicitMaxTtl) &&
Objects.equals(numUses, token.numUses) && Objects.equals(numUses, token.numUses) &&
Objects.equals(policies, token.policies) && Objects.equals(policies, token.policies) &&
Objects.equals(meta, token.meta) && Objects.equals(meta, token.meta) &&
Objects.equals(renewable, token.renewable) && Objects.equals(renewable, token.renewable) &&
Objects.equals(period, token.period) && Objects.equals(period, token.period) &&
Objects.equals(entityAlias, token.entityAlias); Objects.equals(entityAlias, token.entityAlias);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, type, displayName, noParent, noDefaultPolicy, ttl, explicitMaxTtl, numUses, policies, return Objects.hash(id, type, displayName, noParent, noDefaultPolicy, ttl, explicitMaxTtl, numUses, policies,
meta, renewable, period, entityAlias); meta, renewable, period, entityAlias);
} }
/** /**

View File

@ -245,27 +245,27 @@ public final class TokenRole implements Serializable {
} }
TokenRole tokenRole = (TokenRole) o; TokenRole tokenRole = (TokenRole) o;
return Objects.equals(name, tokenRole.name) && return Objects.equals(name, tokenRole.name) &&
Objects.equals(allowedPolicies, tokenRole.allowedPolicies) && Objects.equals(allowedPolicies, tokenRole.allowedPolicies) &&
Objects.equals(allowedPoliciesGlob, tokenRole.allowedPoliciesGlob) && Objects.equals(allowedPoliciesGlob, tokenRole.allowedPoliciesGlob) &&
Objects.equals(disallowedPolicies, tokenRole.disallowedPolicies) && Objects.equals(disallowedPolicies, tokenRole.disallowedPolicies) &&
Objects.equals(disallowedPoliciesGlob, tokenRole.disallowedPoliciesGlob) && Objects.equals(disallowedPoliciesGlob, tokenRole.disallowedPoliciesGlob) &&
Objects.equals(orphan, tokenRole.orphan) && Objects.equals(orphan, tokenRole.orphan) &&
Objects.equals(renewable, tokenRole.renewable) && Objects.equals(renewable, tokenRole.renewable) &&
Objects.equals(pathSuffix, tokenRole.pathSuffix) && Objects.equals(pathSuffix, tokenRole.pathSuffix) &&
Objects.equals(allowedEntityAliases, tokenRole.allowedEntityAliases) && Objects.equals(allowedEntityAliases, tokenRole.allowedEntityAliases) &&
Objects.equals(tokenBoundCidrs, tokenRole.tokenBoundCidrs) && Objects.equals(tokenBoundCidrs, tokenRole.tokenBoundCidrs) &&
Objects.equals(tokenExplicitMaxTtl, tokenRole.tokenExplicitMaxTtl) && Objects.equals(tokenExplicitMaxTtl, tokenRole.tokenExplicitMaxTtl) &&
Objects.equals(tokenNoDefaultPolicy, tokenRole.tokenNoDefaultPolicy) && Objects.equals(tokenNoDefaultPolicy, tokenRole.tokenNoDefaultPolicy) &&
Objects.equals(tokenNumUses, tokenRole.tokenNumUses) && Objects.equals(tokenNumUses, tokenRole.tokenNumUses) &&
Objects.equals(tokenPeriod, tokenRole.tokenPeriod) && Objects.equals(tokenPeriod, tokenRole.tokenPeriod) &&
Objects.equals(tokenType, tokenRole.tokenType); Objects.equals(tokenType, tokenRole.tokenType);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, allowedPolicies, allowedPoliciesGlob, disallowedPolicies, disallowedPoliciesGlob, return Objects.hash(name, allowedPolicies, allowedPoliciesGlob, disallowedPolicies, disallowedPoliciesGlob,
orphan, renewable, pathSuffix, allowedEntityAliases, tokenBoundCidrs, tokenExplicitMaxTtl, orphan, renewable, pathSuffix, allowedEntityAliases, tokenBoundCidrs, tokenExplicitMaxTtl,
tokenNoDefaultPolicy, tokenNumUses, tokenPeriod, tokenType); tokenNoDefaultPolicy, tokenNumUses, tokenPeriod, tokenType);
} }
/** /**

View File

@ -187,19 +187,19 @@ public final class HealthResponse implements VaultResponse {
} }
HealthResponse that = (HealthResponse) o; HealthResponse that = (HealthResponse) o;
return Objects.equals(clusterID, that.clusterID) && return Objects.equals(clusterID, that.clusterID) &&
Objects.equals(clusterName, that.clusterName) && Objects.equals(clusterName, that.clusterName) &&
Objects.equals(version, that.version) && Objects.equals(version, that.version) &&
Objects.equals(serverTimeUTC, that.serverTimeUTC) && Objects.equals(serverTimeUTC, that.serverTimeUTC) &&
Objects.equals(standby, that.standby) && Objects.equals(standby, that.standby) &&
Objects.equals(sealed, that.sealed) && Objects.equals(sealed, that.sealed) &&
Objects.equals(initialized, that.initialized) && Objects.equals(initialized, that.initialized) &&
Objects.equals(replicationPerfMode, that.replicationPerfMode) && Objects.equals(replicationPerfMode, that.replicationPerfMode) &&
Objects.equals(replicationDrMode, that.replicationDrMode) && Objects.equals(replicationDrMode, that.replicationDrMode) &&
Objects.equals(performanceStandby, that.performanceStandby) && Objects.equals(performanceStandby, that.performanceStandby) &&
Objects.equals(echoDurationMs, that.echoDurationMs) && Objects.equals(echoDurationMs, that.echoDurationMs) &&
Objects.equals(clockSkewMs, that.clockSkewMs) && Objects.equals(clockSkewMs, that.clockSkewMs) &&
Objects.equals(replicationPrimaryCanaryAgeMs, that.replicationPrimaryCanaryAgeMs) && Objects.equals(replicationPrimaryCanaryAgeMs, that.replicationPrimaryCanaryAgeMs) &&
Objects.equals(enterprise, that.enterprise); Objects.equals(enterprise, that.enterprise);
} }
@Override @Override

View File

@ -191,24 +191,24 @@ public final class SealResponse implements VaultResponse {
} }
SealResponse that = (SealResponse) o; SealResponse that = (SealResponse) o;
return sealed == that.sealed && return sealed == that.sealed &&
initialized == that.initialized && initialized == that.initialized &&
Objects.equals(type, that.type) && Objects.equals(type, that.type) &&
Objects.equals(threshold, that.threshold) && Objects.equals(threshold, that.threshold) &&
Objects.equals(numberOfShares, that.numberOfShares) && Objects.equals(numberOfShares, that.numberOfShares) &&
Objects.equals(progress, that.progress) && Objects.equals(progress, that.progress) &&
Objects.equals(version, that.version) && Objects.equals(version, that.version) &&
Objects.equals(buildDate, that.buildDate) && Objects.equals(buildDate, that.buildDate) &&
Objects.equals(nonce, that.nonce) && Objects.equals(nonce, that.nonce) &&
Objects.equals(clusterName, that.clusterName) && Objects.equals(clusterName, that.clusterName) &&
Objects.equals(clusterId, that.clusterId) && Objects.equals(clusterId, that.clusterId) &&
Objects.equals(migration, that.migration) && Objects.equals(migration, that.migration) &&
Objects.equals(recoverySeal, that.recoverySeal) && Objects.equals(recoverySeal, that.recoverySeal) &&
Objects.equals(storageType, that.storageType); Objects.equals(storageType, that.storageType);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(type, sealed, initialized, threshold, numberOfShares, progress, version, buildDate, nonce, return Objects.hash(type, sealed, initialized, threshold, numberOfShares, progress, version, buildDate, nonce,
clusterName, clusterId, migration, recoverySeal, storageType); clusterName, clusterId, migration, recoverySeal, storageType);
} }
} }

View File

@ -86,9 +86,9 @@ public abstract class SecretResponse extends VaultDataResponse {
return type.cast(rawValue); return type.cast(rawValue);
} else { } else {
var om = new ObjectMapper() var om = new ObjectMapper()
.registerModule(new JavaTimeModule()) .registerModule(new JavaTimeModule())
.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); .disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
if (rawValue instanceof String) { if (rawValue instanceof String) {
return om.readValue((String) rawValue, type); return om.readValue((String) rawValue, type);

View File

@ -16,11 +16,11 @@
package de.stklcode.jvault.connector.model.response; package de.stklcode.jvault.connector.model.response;
import com.fasterxml.jackson.annotation.JsonSetter;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonSetter;
/** /**
* Response entity for transit operations. * Response entity for transit operations.
* *

View File

@ -115,6 +115,7 @@ public abstract class VaultDataResponse implements VaultResponse {
public final String getMountType() { public final String getMountType() {
return mountType; return mountType;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) { if (this == o) {
@ -124,13 +125,13 @@ public abstract class VaultDataResponse implements VaultResponse {
} }
VaultDataResponse that = (VaultDataResponse) o; VaultDataResponse that = (VaultDataResponse) o;
return renewable == that.renewable && return renewable == that.renewable &&
Objects.equals(requestId, that.requestId) && Objects.equals(requestId, that.requestId) &&
Objects.equals(leaseId, that.leaseId) && Objects.equals(leaseId, that.leaseId) &&
Objects.equals(leaseDuration, that.leaseDuration) && Objects.equals(leaseDuration, that.leaseDuration) &&
Objects.equals(warnings, that.warnings) && Objects.equals(warnings, that.warnings) &&
Objects.equals(wrapInfo, that.wrapInfo) && Objects.equals(wrapInfo, that.wrapInfo) &&
Objects.equals(auth, that.auth) && Objects.equals(auth, that.auth) &&
Objects.equals(mountType, that.mountType); Objects.equals(mountType, that.mountType);
} }
@Override @Override

View File

@ -171,22 +171,22 @@ public final class AuthData implements Serializable {
} }
AuthData authData = (AuthData) o; AuthData authData = (AuthData) o;
return renewable == authData.renewable && return renewable == authData.renewable &&
orphan == authData.orphan && orphan == authData.orphan &&
Objects.equals(clientToken, authData.clientToken) && Objects.equals(clientToken, authData.clientToken) &&
Objects.equals(accessor, authData.accessor) && Objects.equals(accessor, authData.accessor) &&
Objects.equals(policies, authData.policies) && Objects.equals(policies, authData.policies) &&
Objects.equals(tokenPolicies, authData.tokenPolicies) && Objects.equals(tokenPolicies, authData.tokenPolicies) &&
Objects.equals(metadata, authData.metadata) && Objects.equals(metadata, authData.metadata) &&
Objects.equals(leaseDuration, authData.leaseDuration) && Objects.equals(leaseDuration, authData.leaseDuration) &&
Objects.equals(entityId, authData.entityId) && Objects.equals(entityId, authData.entityId) &&
Objects.equals(tokenType, authData.tokenType) && Objects.equals(tokenType, authData.tokenType) &&
Objects.equals(numUses, authData.numUses) && Objects.equals(numUses, authData.numUses) &&
Objects.equals(mfaRequirement, authData.mfaRequirement); Objects.equals(mfaRequirement, authData.mfaRequirement);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(clientToken, accessor, policies, tokenPolicies, metadata, leaseDuration, renewable, return Objects.hash(clientToken, accessor, policies, tokenPolicies, metadata, leaseDuration, renewable,
entityId, tokenType, orphan, numUses, mfaRequirement); entityId, tokenType, orphan, numUses, mfaRequirement);
} }
} }

View File

@ -202,19 +202,19 @@ public final class AuthMethod implements Serializable {
} }
AuthMethod that = (AuthMethod) o; AuthMethod that = (AuthMethod) o;
return local == that.local && return local == that.local &&
type == that.type && type == that.type &&
externalEntropyAccess == that.externalEntropyAccess && externalEntropyAccess == that.externalEntropyAccess &&
sealWrap == that.sealWrap && sealWrap == that.sealWrap &&
Objects.equals(rawType, that.rawType) && Objects.equals(rawType, that.rawType) &&
Objects.equals(accessor, that.accessor) && Objects.equals(accessor, that.accessor) &&
Objects.equals(deprecationStatus, that.deprecationStatus) && Objects.equals(deprecationStatus, that.deprecationStatus) &&
Objects.equals(description, that.description) && Objects.equals(description, that.description) &&
Objects.equals(config, that.config) && Objects.equals(config, that.config) &&
Objects.equals(options, that.options) && Objects.equals(options, that.options) &&
Objects.equals(pluginVersion, that.pluginVersion) && Objects.equals(pluginVersion, that.pluginVersion) &&
Objects.equals(runningPluginVersion, that.runningPluginVersion) && Objects.equals(runningPluginVersion, that.runningPluginVersion) &&
Objects.equals(runningSha256, that.runningSha256) && Objects.equals(runningSha256, that.runningSha256) &&
Objects.equals(uuid, that.uuid); Objects.equals(uuid, that.uuid);
} }
@Override @Override

View File

@ -138,14 +138,14 @@ public final class SecretMetadata implements Serializable {
} }
SecretMetadata that = (SecretMetadata) o; SecretMetadata that = (SecretMetadata) o;
return Objects.equals(createdTime, that.createdTime) && return Objects.equals(createdTime, that.createdTime) &&
Objects.equals(currentVersion, that.currentVersion) && Objects.equals(currentVersion, that.currentVersion) &&
Objects.equals(maxVersions, that.maxVersions) && Objects.equals(maxVersions, that.maxVersions) &&
Objects.equals(oldestVersion, that.oldestVersion) && Objects.equals(oldestVersion, that.oldestVersion) &&
Objects.equals(updatedTime, that.updatedTime) && Objects.equals(updatedTime, that.updatedTime) &&
Objects.equals(versions, that.versions) && Objects.equals(versions, that.versions) &&
Objects.equals(casRequired, that.casRequired) && Objects.equals(casRequired, that.casRequired) &&
Objects.equals(customMetadata, that.customMetadata) && Objects.equals(customMetadata, that.customMetadata) &&
Objects.equals(deleteVersionAfter, that.deleteVersionAfter); Objects.equals(deleteVersionAfter, that.deleteVersionAfter);
} }
@Override @Override

View File

@ -222,27 +222,27 @@ public final class TokenData implements Serializable {
} }
TokenData tokenData = (TokenData) o; TokenData tokenData = (TokenData) o;
return orphan == tokenData.orphan && return orphan == tokenData.orphan &&
renewable == tokenData.renewable && renewable == tokenData.renewable &&
Objects.equals(accessor, tokenData.accessor) && Objects.equals(accessor, tokenData.accessor) &&
Objects.equals(creationTime, tokenData.creationTime) && Objects.equals(creationTime, tokenData.creationTime) &&
Objects.equals(creationTtl, tokenData.creationTtl) && Objects.equals(creationTtl, tokenData.creationTtl) &&
Objects.equals(name, tokenData.name) && Objects.equals(name, tokenData.name) &&
Objects.equals(entityId, tokenData.entityId) && Objects.equals(entityId, tokenData.entityId) &&
Objects.equals(expireTime, tokenData.expireTime) && Objects.equals(expireTime, tokenData.expireTime) &&
Objects.equals(explicitMaxTtl, tokenData.explicitMaxTtl) && Objects.equals(explicitMaxTtl, tokenData.explicitMaxTtl) &&
Objects.equals(id, tokenData.id) && Objects.equals(id, tokenData.id) &&
Objects.equals(issueTime, tokenData.issueTime) && Objects.equals(issueTime, tokenData.issueTime) &&
Objects.equals(meta, tokenData.meta) && Objects.equals(meta, tokenData.meta) &&
Objects.equals(numUses, tokenData.numUses) && Objects.equals(numUses, tokenData.numUses) &&
Objects.equals(path, tokenData.path) && Objects.equals(path, tokenData.path) &&
Objects.equals(policies, tokenData.policies) && Objects.equals(policies, tokenData.policies) &&
Objects.equals(ttl, tokenData.ttl) && Objects.equals(ttl, tokenData.ttl) &&
Objects.equals(type, tokenData.type); Objects.equals(type, tokenData.type);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(accessor, creationTime, creationTtl, name, entityId, expireTime, explicitMaxTtl, id, return Objects.hash(accessor, creationTime, creationTtl, name, entityId, expireTime, explicitMaxTtl, id,
issueTime, meta, numUses, orphan, path, policies, renewable, ttl, type); issueTime, meta, numUses, orphan, path, policies, renewable, ttl, type);
} }
} }

View File

@ -96,10 +96,10 @@ public final class VersionMetadata implements Serializable {
} }
VersionMetadata that = (VersionMetadata) o; VersionMetadata that = (VersionMetadata) o;
return destroyed == that.destroyed && return destroyed == that.destroyed &&
Objects.equals(createdTime, that.createdTime) && Objects.equals(createdTime, that.createdTime) &&
Objects.equals(deletionTime, that.deletionTime) && Objects.equals(deletionTime, that.deletionTime) &&
Objects.equals(version, that.version) && Objects.equals(version, that.version) &&
Objects.equals(customMetadata, that.customMetadata); Objects.equals(customMetadata, that.customMetadata);
} }
@Override @Override

View File

@ -80,9 +80,9 @@ public class WrapInfo implements Serializable {
} }
WrapInfo that = (WrapInfo) o; WrapInfo that = (WrapInfo) o;
return Objects.equals(token, that.token) && return Objects.equals(token, that.token) &&
Objects.equals(ttl, that.ttl) && Objects.equals(ttl, that.ttl) &&
Objects.equals(creationTime, that.creationTime) && Objects.equals(creationTime, that.creationTime) &&
Objects.equals(creationPath, that.creationPath); Objects.equals(creationPath, that.creationPath);
} }
@Override @Override