Skip to content

Commit

Permalink
Fix the case-sensitive issue when partially updating encryption rules. (
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhucong authored May 18, 2024
1 parent 3c51575 commit 8dc5b6c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ public void updateConfiguration(final EncryptRuleConfiguration toBeUpdatedRuleCo

@Override
public boolean partialUpdate(final EncryptRuleConfiguration toBeUpdatedRuleConfig) {
Collection<String> toBeAddedTableNames = toBeUpdatedRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).collect(Collectors.toList());
toBeAddedTableNames.removeAll(tables.keySet());
Collection<String> toBeAddedTableNames = toBeUpdatedRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).filter(each -> !tables.containsKey(each.toLowerCase()))
.collect(Collectors.toList());
if (!toBeAddedTableNames.isEmpty()) {
toBeAddedTableNames.forEach(each -> addTableRule(each, toBeUpdatedRuleConfig));
attributes.set(new RuleAttributes(new EncryptTableMapperRuleAttribute(tables.keySet())));
Expand Down

0 comments on commit 8dc5b6c

Please sign in to comment.