From e5944969737047d80be1c768043a7e9d1baef0fa Mon Sep 17 00:00:00 2001 From: sgarofalo Date: Thu, 29 Feb 2024 17:15:18 +0100 Subject: [PATCH] [SYNCOPE-1808] fix location for group in ResourceTypes SCIMv2 service --- .../java/org/apache/syncope/core/logic/SCIMLogic.java | 11 +++++------ .../ext/scimv2/cxf/service/SCIMServiceImpl.java | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ext/scimv2/logic/src/main/java/org/apache/syncope/core/logic/SCIMLogic.java b/ext/scimv2/logic/src/main/java/org/apache/syncope/core/logic/SCIMLogic.java index 8fe9a9c00b..ca9aea562f 100644 --- a/ext/scimv2/logic/src/main/java/org/apache/syncope/core/logic/SCIMLogic.java +++ b/ext/scimv2/logic/src/main/java/org/apache/syncope/core/logic/SCIMLogic.java @@ -132,18 +132,17 @@ public ServiceProviderConfig serviceProviderConfig(final UriBuilder uriBuilder) } @PreAuthorize("isAuthenticated()") - public static List resourceTypes(final UriBuilder uriBuilder) { + public List resourceTypes(final UriBuilder uriBuilder) { synchronized (MONITOR) { + String uri = uriBuilder.build().toASCIIString(); if (USER == null) { USER = new ResourceType("User", "User", "/Users", "User Account", Resource.User.schema(), - new Meta(Resource.ResourceType, - null, null, null, uriBuilder.path("User").build().toASCIIString())); + new Meta(Resource.ResourceType, null, null, null, uri + "User")); USER.getSchemaExtensions().add(new SchemaExtension(Resource.EnterpriseUser.schema(), true)); } if (GROUP == null) { GROUP = new ResourceType("Group", "Group", "/Groups", "Group", Resource.Group.schema(), - new Meta(Resource.ResourceType, - null, null, null, uriBuilder.path("Group").build().toASCIIString())); + new Meta(Resource.ResourceType, null, null, null, uri + "Group")); } } @@ -151,7 +150,7 @@ public static List resourceTypes(final UriBuilder uriBuilder) { } @PreAuthorize("isAuthenticated()") - public static ResourceType resourceType(final UriBuilder uriBuilder, final String type) { + public ResourceType resourceType(final UriBuilder uriBuilder, final String type) { if (Resource.User.name().equals(type)) { resourceTypes(uriBuilder); return USER; diff --git a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/SCIMServiceImpl.java b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/SCIMServiceImpl.java index 07f16b000a..693c09cfc1 100644 --- a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/SCIMServiceImpl.java +++ b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/SCIMServiceImpl.java @@ -56,12 +56,12 @@ public ServiceProviderConfig serviceProviderConfig() { @Override public List resourceTypes() { - return SCIMLogic.resourceTypes(uriInfo.getAbsolutePathBuilder()); + return scimLogic.resourceTypes(uriInfo.getAbsolutePathBuilder()); } @Override public ResourceType resourceType(final String type) { - return SCIMLogic.resourceType(uriInfo.getAbsolutePathBuilder(), type); + return scimLogic.resourceType(uriInfo.getAbsolutePathBuilder(), type); } @Override