From dd6d124978b874d19f47183405d4b2c09cf01ca6 Mon Sep 17 00:00:00 2001 From: serdimic Date: Fri, 20 Dec 2024 12:09:45 +0100 Subject: [PATCH] P4ADEV-1781 remove log of decrypted api-key --- .../service/broker/BrokerEncryptionService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/it/gov/pagopa/pu/organization/service/broker/BrokerEncryptionService.java b/src/main/java/it/gov/pagopa/pu/organization/service/broker/BrokerEncryptionService.java index 5488eff..dee16e3 100644 --- a/src/main/java/it/gov/pagopa/pu/organization/service/broker/BrokerEncryptionService.java +++ b/src/main/java/it/gov/pagopa/pu/organization/service/broker/BrokerEncryptionService.java @@ -4,7 +4,6 @@ import it.gov.pagopa.pu.organization.model.Broker; import it.gov.pagopa.pu.organization.util.AESUtils; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -37,11 +36,9 @@ private String decryptKey(byte[] encryptedKey, String type, Long brokerId){ log.debug("null or empty api-key"); return null; } - String decrypted = apiKeyDecryptMap.computeIfAbsent(encryptedKey, c -> { - log.debug("invoking AESUtils to decrypt api-key"); + return apiKeyDecryptMap.computeIfAbsent(encryptedKey, c -> { + log.debug("invoking AESUtils to decrypt api-key[{}] for broker[{}]", type, brokerId); return AESUtils.decrypt(brokerEncryptPassword,c); }); - log.debug("decrypted api-key[{}] for broker[{}]: {}", type, brokerId, StringUtils.abbreviateMiddle(decrypted, "..", 8)); - return decrypted; } }