Improve error messages and logs
This commit is contained in:
parent
cce36ab990
commit
8e97335de4
4 changed files with 4 additions and 4 deletions
|
@ -97,7 +97,7 @@ public abstract class AbstractScimService<RMM extends RoleMapperModel, S extends
|
||||||
scimClient.delete(externalId);
|
scimClient.delete(externalId);
|
||||||
getScimResourceDao().delete(resource);
|
getScimResourceDao().delete(resource);
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
throw new ScimPropagationException("Failed to delete resource %s, scim mapping not found : " + id, e);
|
throw new ScimPropagationException("Failed to delete resource %s, scim mapping not found: ".formatted(id), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class ScimDispatcher {
|
||||||
userScimServices.add(userScimService);
|
userScimServices.add(userScimService);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warnf("[SCIM] Invalid Endpoint configuration %s : %s", scimEndpointConfigurationRaw.getId(), e.getMessage());
|
logger.warnf("[SCIM] Invalid Endpoint configuration %s: %s", scimEndpointConfigurationRaw.getId(), e.getMessage());
|
||||||
// TODO is it ok to log and try to create the other clients ?
|
// TODO is it ok to log and try to create the other clients ?
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class ScimEventListenerProvider implements EventListenerProvider {
|
||||||
ScimResourceType type = switch (rawResourceType) {
|
ScimResourceType type = switch (rawResourceType) {
|
||||||
case "users" -> ScimResourceType.USER;
|
case "users" -> ScimResourceType.USER;
|
||||||
case "groups" -> ScimResourceType.GROUP;
|
case "groups" -> ScimResourceType.GROUP;
|
||||||
default -> throw new IllegalArgumentException("Unsuported resource type : " + rawResourceType);
|
default -> throw new IllegalArgumentException("Unsuported resource type: " + rawResourceType);
|
||||||
};
|
};
|
||||||
KeycloakId id = new KeycloakId(matcher.group(2));
|
KeycloakId id = new KeycloakId(matcher.group(2));
|
||||||
handleRoleMappingEvent(event, type, id);
|
handleRoleMappingEvent(event, type, id);
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class ScimEndpointConfigurationStorageProviderFactory
|
||||||
ScimDispatcher dispatcher = new ScimDispatcher(session);
|
ScimDispatcher dispatcher = new ScimDispatcher(session);
|
||||||
for (GroupModel group : session.groups().getGroupsStream(realm)
|
for (GroupModel group : session.groups().getGroupsStream(realm)
|
||||||
.filter(x -> BooleanUtils.TRUE.equals(x.getFirstAttribute("scim-dirty"))).toList()) {
|
.filter(x -> BooleanUtils.TRUE.equals(x.getFirstAttribute("scim-dirty"))).toList()) {
|
||||||
logger.infof("[SCIM] Dirty group : %s", group.getName());
|
logger.infof("[SCIM] Dirty group: %s", group.getName());
|
||||||
dispatcher.dispatchGroupModificationToAll(client -> client.replace(group));
|
dispatcher.dispatchGroupModificationToAll(client -> client.replace(group));
|
||||||
group.removeAttribute("scim-dirty");
|
group.removeAttribute("scim-dirty");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue