You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by sg...@apache.org on 2024/03/01 07:53:45 UTC

(syncope) branch 3_0_X updated: [SYNCOPE-1808] fix location for group in ResourceTypes SCIMv2 service (#635)

This is an automated email from the ASF dual-hosted git repository.

sgarofalo pushed a commit to branch 3_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/3_0_X by this push:
     new bd0b9d897f [SYNCOPE-1808] fix location for group in ResourceTypes SCIMv2 service (#635)
bd0b9d897f is described below

commit bd0b9d897fc0c2ca4fbe3a4bc45e47e745a66396
Author: Samuel Garofalo <72...@users.noreply.github.com>
AuthorDate: Fri Mar 1 08:53:40 2024 +0100

    [SYNCOPE-1808] fix location for group in ResourceTypes SCIMv2 service (#635)
---
 .../main/java/org/apache/syncope/core/logic/SCIMLogic.java    | 11 +++++------
 .../syncope/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 class SCIMLogic extends AbstractLogic<EntityTO> {
     }
 
     @PreAuthorize("isAuthenticated()")
-    public static List<ResourceType> resourceTypes(final UriBuilder uriBuilder) {
+    public List<ResourceType> 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 class SCIMLogic extends AbstractLogic<EntityTO> {
     }
 
     @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 class SCIMServiceImpl extends AbstractSCIMService<SCIMResource> implement
 
     @Override
     public List<ResourceType> 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