From 1901d6786fc511667eb5b3c0fe9e8e9b29696efe Mon Sep 17 00:00:00 2001 From: dewniMW Date: Sun, 22 Oct 2023 19:51:01 +0530 Subject: [PATCH] Add filtering for list discovery attributes of organizations API --- .../service/OrganizationManagementService.java | 16 ++++------------ pom.xml | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/management/v1/service/OrganizationManagementService.java b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/management/v1/service/OrganizationManagementService.java index 4fa6b5298e..6b879f1dc5 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/management/v1/service/OrganizationManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/management/v1/service/OrganizationManagementService.java @@ -84,7 +84,6 @@ import static org.wso2.carbon.identity.api.server.organization.management.v1.constants.OrganizationManagementEndpointConstants.ASC_SORT_ORDER; import static org.wso2.carbon.identity.api.server.organization.management.v1.constants.OrganizationManagementEndpointConstants.DESC_SORT_ORDER; import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.ErrorMessages.ERROR_CODE_ERROR_BUILDING_PAGINATED_RESPONSE_URL; -import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.ErrorMessages.ERROR_CODE_FILTERING_NOT_IMPLEMENTED; import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.ErrorMessages.ERROR_CODE_INVALID_PAGINATION_PARAMETER_NEGATIVE_LIMIT; import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.ErrorMessages.ERROR_CODE_INVALID_SHARE_APPLICATION_EMPTY_REQUEST_BODY; import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.ErrorMessages.ERROR_CODE_INVALID_SHARE_APPLICATION_REQUEST_BODY; @@ -474,17 +473,17 @@ public Response deleteOrganizationDiscoveryAttributes(String organizationId) { /** * Returns the discovery attributes of the organizations. * - * @param filter The filter string. **Not supported at the moment.** + * @param filter The filter string. * @param offset The offset to be used with the limit parameter. **Not supported at the moment.** * @param limit The items per page. **Not supported at the moment.** * @return The discovery attributes of the organizations in the hierarchy under the root organization. */ public Response getOrganizationsDiscoveryAttributes(String filter, Integer offset, Integer limit) { - handleNotImplementedCapabilities(filter, offset, limit); + handleNotImplementedCapabilities(offset, limit); try { List organizationsDiscoveryAttributes = - getOrganizationDiscoveryManager().getOrganizationsDiscoveryAttributes(); + getOrganizationDiscoveryManager().getOrganizationsDiscoveryAttributes(filter); OrganizationsDiscoveryResponse response = new OrganizationsDiscoveryResponse(); for (OrganizationDiscovery organizationDiscovery : organizationsDiscoveryAttributes) { OrganizationDiscoveryResponse organizationDiscoveryResponse = new OrganizationDiscoveryResponse(); @@ -868,7 +867,7 @@ private List getOrgDiscoveryAttributesFromPutRequest(Orga }).collect(Collectors.toList()); } - private void handleNotImplementedCapabilities(String filter, Integer offset, Integer limit) { + private void handleNotImplementedCapabilities(Integer offset, Integer limit) { if (limit != null || offset != null) { Error error = OrganizationManagementEndpointUtil.getError( @@ -877,13 +876,6 @@ private void handleNotImplementedCapabilities(String filter, Integer offset, Int ERROR_CODE_PAGINATION_NOT_IMPLEMENTED.getDescription()); throw new OrganizationManagementEndpointException(Response.Status.NOT_IMPLEMENTED, error); } - if (filter != null) { - Error error = OrganizationManagementEndpointUtil.getError( - ERROR_CODE_FILTERING_NOT_IMPLEMENTED.getCode(), - ERROR_CODE_FILTERING_NOT_IMPLEMENTED.getMessage(), - ERROR_CODE_FILTERING_NOT_IMPLEMENTED.getDescription()); - throw new OrganizationManagementEndpointException(Response.Status.NOT_IMPLEMENTED, error); - } } private OrganizationMetadata getOrganizationMetadataResponse(Organization organization, List diff --git a/pom.xml b/pom.xml index 48e542accd..52f8779f9b 100644 --- a/pom.xml +++ b/pom.xml @@ -789,7 +789,7 @@ - 1.3.85 + 1.3.88