Skip to content

Commit

Permalink
fix: bug testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-PhucNguyen5 committed Oct 10, 2023
1 parent 30c10cd commit c3fec3c
Showing 1 changed file with 11 additions and 4 deletions.
Expand Up @@ -54,7 +54,12 @@ public Boolean roleMapping(EventModel model) {
if (resourceType.equals(EResourceType.REALM_ROLE.name())) {
log.info("role id: " + resourceArr[1]);
Set<String> userPrefixKeys = new HashSet<>();
keys.forEach(key -> userPrefixKeys.add(redisProvider.getValue(key)));
keys.forEach(key -> {
String val = redisProvider.getValue(key);
if (Objects.nonNull(val)) {
userPrefixKeys.add(val);
}
});
Set<String> userKeys = new HashSet<>();
userPrefixKeys.forEach(
userPrefixKey -> userKeys.addAll(redisProvider.getKeys(userPrefixKey + "*")));
Expand All @@ -70,9 +75,11 @@ public Boolean roleMapping(EventModel model) {
private void setInValidToken(Set<String> keys) {
keys.forEach(key -> {
String val = redisProvider.getValue(key);
redisProvider.blacklistJwt(val, key);
redisProvider.remove(key);
log.info("black list: " + key);
if (Objects.nonNull(val)) {
redisProvider.blacklistJwt(val, key);
redisProvider.remove(key);
log.info("black list: " + key);
}
});
}
}

0 comments on commit c3fec3c

Please sign in to comment.