Skip to content

Conversation

CaradonnaMa
Copy link
Collaborator

… qr generation + ecs policy added parameter

@CaradonnaMa CaradonnaMa requested review from a team as code owners August 5, 2025 07:36
private String getQuickAccessLink(NotificationRecipientInt recipient, String quickAccess) {
UrlData urlData = new UrlData();
urlData.setRecipientType(it.pagopa.pn.commons.utils.qr.models.RecipientTypeInt.valueOf(recipient.getRecipientType().name()));
log.debug("getQrCodeQuickAccessUrlAarDetail: {}", quickAccess);

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
This
potentially sensitive information
is written to a log file.
This
potentially sensitive information
is written to a log file.

Copilot Autofix

AI 20 days ago

To fix the problem, we should avoid logging the value of quickAccessToken (or quickAccess) directly. Instead, the log statement should be modified to either remove the token entirely or replace it with a generic message that does not expose sensitive data. The log line at 412 should be changed from:

log.debug("getQrCodeQuickAccessUrlAarDetail: {}", quickAccess);

to something like:

log.debug("getQrCodeQuickAccessUrlAarDetail called");

This preserves the intent of logging the method invocation for debugging purposes without leaking sensitive information. No additional imports or method changes are required.


Suggested changeset 1
src/main/java/it/pagopa/pn/deliverypushworkflow/legalfacts/LegalFactGeneratorTemplates.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/main/java/it/pagopa/pn/deliverypushworkflow/legalfacts/LegalFactGeneratorTemplates.java b/src/main/java/it/pagopa/pn/deliverypushworkflow/legalfacts/LegalFactGeneratorTemplates.java
--- a/src/main/java/it/pagopa/pn/deliverypushworkflow/legalfacts/LegalFactGeneratorTemplates.java
+++ b/src/main/java/it/pagopa/pn/deliverypushworkflow/legalfacts/LegalFactGeneratorTemplates.java
@@ -411,3 +411,3 @@
         urlData.setRecipientType(it.pagopa.pn.commons.utils.qr.models.RecipientTypeInt.valueOf(recipient.getRecipientType().name()));
-        log.debug("getQrCodeQuickAccessUrlAarDetail: {}", quickAccess);
+        log.debug("getQrCodeQuickAccessUrlAarDetail called");
         return qrUrlCodecService.encode(quickAccess, urlData);
EOF
@@ -411,3 +411,3 @@
urlData.setRecipientType(it.pagopa.pn.commons.utils.qr.models.RecipientTypeInt.valueOf(recipient.getRecipientType().name()));
log.debug("getQrCodeQuickAccessUrlAarDetail: {}", quickAccess);
log.debug("getQrCodeQuickAccessUrlAarDetail called");
return qrUrlCodecService.encode(quickAccess, urlData);
Copilot is powered by AI and may make mistakes. Always verify output.
@abertu75 abertu75 self-requested a review August 6, 2025 13:41
abertu75
abertu75 previously approved these changes Aug 6, 2025
Copy link

sonarqubecloud bot commented Aug 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants