Move field init to initializer, does not depend on constructor parameters

This commit is contained in:
Brendan Le Ny 2024-06-17 10:45:31 +02:00
parent db3de0d933
commit 676cddc0d9

View file

@ -27,15 +27,16 @@ public class ScimEventListenerProvider implements EventListenerProvider {
private final KeycloakSession session; private final KeycloakSession session;
private final Map<ResourceType, Pattern> patterns = new HashMap<>(); private final Map<ResourceType, Pattern> patterns = Map.of(
ResourceType.USER, Pattern.compile("users/(.+)"),
ResourceType.GROUP, Pattern.compile("groups/([\\w-]+)(/children)?"),
ResourceType.GROUP_MEMBERSHIP, Pattern.compile("users/(.+)/groups/(.+)"),
ResourceType.REALM_ROLE_MAPPING, Pattern.compile("^(.+)/(.+)/role-mappings")
);
public ScimEventListenerProvider(KeycloakSession session) { public ScimEventListenerProvider(KeycloakSession session) {
this.session = session; this.session = session;
dispatcher = new ScimDispatcher(session); dispatcher = new ScimDispatcher(session);
patterns.put(ResourceType.USER, Pattern.compile("users/(.+)"));
patterns.put(ResourceType.GROUP, Pattern.compile("groups/([\\w-]+)(/children)?"));
patterns.put(ResourceType.GROUP_MEMBERSHIP, Pattern.compile("users/(.+)/groups/(.+)"));
patterns.put(ResourceType.REALM_ROLE_MAPPING, Pattern.compile("^(.+)/(.+)/role-mappings"));
} }
@Override @Override