Skip to content

Commit

Permalink
P4ADEV-1781 remove log of decrypted api-key
Browse files Browse the repository at this point in the history
  • Loading branch information
serdimic committed Dec 20, 2024
1 parent 038ce88 commit dd6d124
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
}

0 comments on commit dd6d124

Please sign in to comment.