File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
hibernate-core/src/main/java/org/hibernate Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ public final class Environment implements AvailableSettings {
144
144
try (var stream = getResourceAsStream ("/hibernate.properties" )) {
145
145
try {
146
146
GLOBAL_PROPERTIES .load (stream );
147
- LOG .propertiesLoaded ( maskOut ( GLOBAL_PROPERTIES , PASS ) );
147
+ LOG .propertiesLoaded ( maskOut ( GLOBAL_PROPERTIES ,
148
+ PASS , JAKARTA_JDBC_PASSWORD , JPA_JDBC_PASSWORD ) );
148
149
}
149
150
catch (Exception e ) {
150
151
LOG .unableToLoadProperties ();
Original file line number Diff line number Diff line change @@ -270,21 +270,39 @@ else if ( configurationValues instanceof Properties properties ) {
270
270
}
271
271
272
272
/**
273
- * replace a property by a starred version
273
+ * Replace a property by a starred version
274
274
*
275
275
* @param props properties to check
276
276
* @param key property to mask
277
277
*
278
278
* @return cloned and masked properties
279
279
*/
280
280
public static Properties maskOut (Properties props , String key ) {
281
- final Properties clone = (Properties ) props .clone ();
281
+ final var clone = (Properties ) props .clone ();
282
282
if ( clone .get ( key ) != null ) {
283
283
clone .setProperty ( key , "****" );
284
284
}
285
285
return clone ;
286
286
}
287
287
288
+ /**
289
+ * Replace properties by starred version
290
+ *
291
+ * @param props properties to check
292
+ * @param keys properties to mask
293
+ *
294
+ * @return cloned and masked properties
295
+ */
296
+ public static Properties maskOut (Properties props , String ... keys ) {
297
+ final var clone = (Properties ) props .clone ();
298
+ for ( String key : keys ) {
299
+ if ( clone .get ( key ) != null ) {
300
+ clone .setProperty ( key , "****" );
301
+ }
302
+ }
303
+ return clone ;
304
+ }
305
+
288
306
/**
289
307
* Extract a property value by name from the given properties object.
290
308
* <p>
You can’t perform that action at this time.
0 commit comments