Skip to content

Conversation

brunos-bq
Copy link
Contributor

@brunos-bq brunos-bq commented Nov 6, 2023

Summary

fix: using masked properties for logging

Additional Reviewers

@sergiyv-improving

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -96,7 +96,8 @@ public static void setPropertyOnTarget(
} else {
writeMethod.invoke(target, propValue);
}
LOGGER.finest(() -> String.format("Set property '%s' with value: %s", propName, propValue));
Object loggedProperty = propValue.equals(PropertyDefinition.PASSWORD.name) ? "***" : propValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd extract a code that check if the property contains a secret into a separate function and use it everywhere here in PropertyUtils

@@ -127,6 +134,10 @@ public static void setPropertyOnTarget(
return copy;
}

public static boolean isSecretProperty(final Object propertyKey) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private?

@hsuamz hsuamz marked this pull request as ready for review November 6, 2023 21:05
@brunos-bq brunos-bq merged commit 80577ed into aws:main Nov 6, 2023
@brunos-bq brunos-bq deleted the logFix branch November 16, 2023 09:50
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