Skip to content

Commit

Permalink
[BACKPORT] Remove printing the license key while starting instance wi…
Browse files Browse the repository at this point in the history
…th overriding config (#18571)

* unmask some part of license key
  • Loading branch information
hasancelik committed Apr 30, 2021
1 parent 7e390d1 commit de203ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
files="com[\\/]hazelcast[\\/]config[\\/]MapConfig"/>
<suppress checks="MethodCount" files="com[\\/]hazelcast[\\/]config[\\/]SerializationConfig"/>
<suppress checks="FileLength" files="com[\\/]hazelcast[\\/]internal[\\/]config[\\/]MemberDomConfigProcessor"/>
<suppress checks="MagicNumber" files="com[\\/]hazelcast[\\/]internal[\\/]config[\\/]override[\\/]ExternalConfigurationOverride"/>

<!-- YAML -->
<suppress checks="BooleanExpressionComplexity" files="com[\\/]hazelcast[\\/]internal[\\/]yaml[\\/]YamlUtil"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@ private <T> T overwrite(T config, ConfigConsumer<T> configProcessor, ConfigProvi
configProvider.name(),
properties.entrySet().stream()
.filter(e -> !unprocessed.containsKey(e.getKey()))
.map(e -> e.getKey() + "=" + e.getValue())
.map(e -> {
if (e.getKey().equals("hazelcast.licensekey")) {
String[] licenceKeyParts = e.getValue().split("#");
String originalKeyPart = licenceKeyParts[licenceKeyParts.length - 1];
return e.getKey() + "=" + originalKeyPart.substring(0, 5) + "*********"
+ originalKeyPart.substring(originalKeyPart.length() - 5) ;
} else {
return e.getKey() + "=" + e.getValue();
}
})
.collect(joining(","))));

if (!unprocessed.isEmpty()) {
Expand Down

0 comments on commit de203ad

Please sign in to comment.