Skip to content

Commit

Permalink
add Encode.forJava
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf committed Oct 8, 2024
1 parent e8bbdc4 commit 4ff246c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import it.pagopa.selfcare.product.entity.ProductRoleInfo;
import it.pagopa.selfcare.product.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.owasp.encoder.Encode;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

Expand Down Expand Up @@ -36,7 +37,7 @@ public List<Product> getProducts() {

@Override
public Map<PartyRole, ProductRoleInfo> getProductRoleMappings(String productId, String institutionType) {
log.debug(LogUtils.CONFIDENTIAL_MARKER, "getProduct productId = {}, institutionType = {}", productId, institutionType);
log.debug(LogUtils.CONFIDENTIAL_MARKER, "getProduct productId = {}, institutionType = {}", Encode.forJava(productId), Encode.forJava(institutionType));
Assert.hasText(productId, "A productId is required");
Product product = productService.getProduct(productId);
Map<PartyRole, ProductRoleInfo> result = product != null ? product.getRoleMappings(institutionType) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.product.entity.ProductRoleInfo;
import lombok.extern.slf4j.Slf4j;
import org.owasp.encoder.Encode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
Expand All @@ -26,7 +27,7 @@ class ProductServiceImpl implements ProductService {
@Override
public Map<PartyRole, ProductRoleInfo> getProductRoles(String productId, String institutionType) {
log.trace("getProductRoles start");
log.debug("getProductRoles productId = {}, institutionType = {}", productId, institutionType);
log.debug("getProductRoles productId = {}, institutionType = {}", Encode.forJava(productId), Encode.forJava(institutionType));
Assert.hasText(productId, "A Product id is required");

Map<PartyRole, ProductRoleInfo> productRoleMappings = productsConnector.getProductRoleMappings(productId, institutionType);
Expand Down

0 comments on commit 4ff246c

Please sign in to comment.