From 69cd4d83470faa2615b6128f416ea4f3a601f21e Mon Sep 17 00:00:00 2001 From: Nitin Vavdiya Date: Fri, 14 Jul 2023 12:45:13 +0530 Subject: [PATCH] fix: veracode log issue --- .../managedidentitywallets/service/WalletService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletService.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletService.java index 8a59b231b..d073c781e 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletService.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletService.java @@ -31,6 +31,7 @@ import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.text.StringEscapeUtils; import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemWriter; import org.eclipse.tractusx.managedidentitywallets.config.MIWSettings; @@ -233,7 +234,7 @@ private Wallet createWallet(CreateWalletRequest request, boolean authority) { }); didDocument.put("@context", mutableContext); didDocument = DidDocument.fromJson(didDocument.toJson()); - log.debug("did document created for bpn ->{}", request.getBpn()); + log.debug("did document created for bpn ->{}", StringEscapeUtils.escapeJava(request.getBpn())); //Save wallet Wallet wallet = create(Wallet.builder() @@ -253,7 +254,7 @@ private Wallet createWallet(CreateWalletRequest request, boolean authority) { .privateKey(encryptionUtils.encrypt(getPrivateKeyString(keyPair.getPrivateKey().asByte()))) .publicKey(encryptionUtils.encrypt(getPublicKeyString(keyPair.getPublicKey().asByte()))) .build()); - log.debug("Wallet created for bpn ->{}", request.getBpn()); + log.debug("Wallet created for bpn ->{}", StringEscapeUtils.escapeJava(request.getBpn())); Wallet issuerWallet = walletRepository.getByBpn(miwSettings.authorityWalletBpn()); @@ -275,9 +276,9 @@ public void createAuthorityWallet() { .bpn(miwSettings.authorityWalletBpn()) .build(); createWallet(request, true); - log.info("Authority wallet created with bpn {}", miwSettings.authorityWalletBpn()); + log.info("Authority wallet created with bpn {}", StringEscapeUtils.escapeJava(miwSettings.authorityWalletBpn())); } else { - log.info("Authority wallet exists with bpn {}", miwSettings.authorityWalletBpn()); + log.info("Authority wallet exists with bpn {}", StringEscapeUtils.escapeJava(miwSettings.authorityWalletBpn())); } }