From a9fbda900b937ba460a9b496645d6efe635e9fcc Mon Sep 17 00:00:00 2001 From: Sergey Kisel Date: Fri, 13 Oct 2023 16:13:38 +0200 Subject: [PATCH] address small concerns --- .../web3signer/keystorage/gcp/GcpSecretManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/keystorage/src/main/java/tech/pegasys/web3signer/keystorage/gcp/GcpSecretManager.java b/keystorage/src/main/java/tech/pegasys/web3signer/keystorage/gcp/GcpSecretManager.java index 48d2c0a5f..431396cba 100644 --- a/keystorage/src/main/java/tech/pegasys/web3signer/keystorage/gcp/GcpSecretManager.java +++ b/keystorage/src/main/java/tech/pegasys/web3signer/keystorage/gcp/GcpSecretManager.java @@ -34,7 +34,6 @@ import com.google.protobuf.ByteString; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.NotNull; public class GcpSecretManager implements Closeable { @@ -99,20 +98,19 @@ public MappedResults mapSecrets( } private Iterable listSecrets(String projectId, Optional filter) { - ListSecretsRequest request = listSecretsRequest(projectId, filter); + final ListSecretsRequest request = listSecretsRequest(projectId, filter); return secretManagerServiceClient.listSecrets(request).iterateAll(); } - @NotNull private static ListSecretsRequest listSecretsRequest(String projectId, Optional filter) { - ListSecretsRequest.Builder builder = ListSecretsRequest.newBuilder(); + final ListSecretsRequest.Builder builder = ListSecretsRequest.newBuilder(); builder.setParent(ProjectName.of(projectId).toString()); filter.ifPresent(builder::setFilter); return builder.build(); } private Optional fetchStringSecret(String secretName) { - AccessSecretVersionResponse accessSecretVersionResponse = fetchSecret(secretName); + final AccessSecretVersionResponse accessSecretVersionResponse = fetchSecret(secretName); if (accessSecretVersionResponse.hasPayload()) { SecretPayload payload = accessSecretVersionResponse.getPayload(); ByteString payloadData = payload.getData(); @@ -123,7 +121,7 @@ private Optional fetchStringSecret(String secretName) { } private AccessSecretVersionResponse fetchSecret(String secretName) { - AccessSecretVersionRequest accessSecretVersionRequest = + final AccessSecretVersionRequest accessSecretVersionRequest = AccessSecretVersionRequest.newBuilder().setName(secretName + "/versions/latest").build(); return secretManagerServiceClient.accessSecretVersion(accessSecretVersionRequest); }