From 5cea1ee00c31f861e26d1dd80461d57f35461781 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 28 Jul 2021 10:01:32 -0500 Subject: [PATCH] feat: #18 refactor: remove unnecessary annotations pt. 2 --- .../ws/rs/scim2/Fido2DeviceWebService.java | 11 -------- .../ws/rs/scim2/FidoDeviceWebService.java | 15 ----------- .../oxtrust/ws/rs/scim2/GroupWebService.java | 25 +++---------------- .../oxtrust/ws/rs/scim2/ResourceTypeWS.java | 7 ------ .../oxtrust/ws/rs/scim2/SchemaWebService.java | 5 ---- .../rs/scim2/SearchResourcesWebService.java | 8 +----- .../ws/rs/scim2/ServiceProviderConfigWS.java | 4 --- 7 files changed, 4 insertions(+), 71 deletions(-) diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/Fido2DeviceWebService.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/Fido2DeviceWebService.java index 84b487b..198a074 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/Fido2DeviceWebService.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/Fido2DeviceWebService.java @@ -34,8 +34,6 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.wordnik.swagger.annotations.ApiOperation; - import org.apache.commons.lang.StringUtils; import org.gluu.oxtrust.model.exception.SCIMException; @@ -58,8 +56,6 @@ * Implementation of /Fido2Devices endpoint. Methods here are intercepted and/or decorated. * Class org.gluu.oxtrust.service.scim2.interceptor.Fido2DeviceWebServiceDecorator is used to apply pre-validations on data. * Filter org.gluu.oxtrust.ws.rs.scim2.AuthorizationProcessingFilter secures invocations - * - * @author jgomer */ @Named("scim2Fido2DeviceEndpoint") @Path("/scim/v2/Fido2Devices") @@ -79,7 +75,6 @@ public class Fido2DeviceWebService extends BaseScimWebService implements IFido2D @Produces({MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT}) @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi - @ApiOperation(value = "Create device", response = Fido2DeviceResource.class) public Response createDevice() { log.debug("Executing web service method. createDevice"); return getErrorResponse(Response.Status.NOT_IMPLEMENTED, "Not implemented; device registration only happens via the FIDO 2.0 API."); @@ -91,7 +86,6 @@ public Response createDevice() { @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Find device by id", notes = "Returns a device by id as path param", response = Fido2DeviceResource.class) public Response getF2DeviceById(@PathParam("id") String id, @QueryParam("userId") String userId, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @@ -129,7 +123,6 @@ public Response getF2DeviceById(@PathParam("id") String id, @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Update device", response = Fido2DeviceResource.class) public Response updateF2Device( Fido2DeviceResource fidoDeviceResource, @PathParam("id") String id, @@ -180,7 +173,6 @@ public Response updateF2Device( @Produces({MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT}) @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi - @ApiOperation(value = "Delete device") public Response deleteF2Device(@PathParam("id") String id) { Response response; @@ -209,7 +201,6 @@ public Response deleteF2Device(@PathParam("id") String id) { @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Search devices", notes = "Returns a list of devices", response = ListResponse.class) public Response searchF2Devices( @QueryParam("userId") String userId, @QueryParam(QUERY_PARAM_FILTER) String filter, @@ -248,7 +239,6 @@ public Response searchF2Devices( @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Search devices POST /.search", notes = "Returns a list of fido devices", response = ListResponse.class) public Response searchF2DevicesPost(SearchRequest searchRequest, @QueryParam("userId") String userId) { log.debug("Executing web service method. searchDevicesPost"); @@ -347,7 +337,6 @@ private PagedResult searchDevices(String userId, String filter @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "PATCH operation", notes = "https://tools.ietf.org/html/rfc7644#section-3.5.2", response = Fido2DeviceResource.class) public Response patchF2Device( PatchRequest request, @PathParam("id") String id, diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/FidoDeviceWebService.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/FidoDeviceWebService.java index e979502..ee4090f 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/FidoDeviceWebService.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/FidoDeviceWebService.java @@ -32,15 +32,12 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import com.wordnik.swagger.annotations.ApiOperation; - import org.apache.commons.lang.StringUtils; import org.gluu.oxtrust.model.exception.SCIMException; import org.gluu.oxtrust.model.fido.GluuCustomFidoDevice; import org.gluu.oxtrust.model.scim2.BaseScimResource; import org.gluu.oxtrust.model.scim2.ErrorScimType; -import org.gluu.oxtrust.model.scim2.ListResponse; import org.gluu.oxtrust.model.scim2.Meta; import org.gluu.oxtrust.model.scim2.SearchRequest; import org.gluu.oxtrust.model.scim2.fido.FidoDeviceResource; @@ -56,15 +53,10 @@ import org.gluu.persist.model.SortOrder; import org.gluu.search.filter.Filter; -import com.wordnik.swagger.annotations.ApiOperation; - /** * Implementation of /FidoDevices endpoint. Methods here are intercepted and/or decorated. * Class org.gluu.oxtrust.service.scim2.interceptor.FidoDeviceWebServiceDecorator is used to apply pre-validations on data. * Filter org.gluu.oxtrust.ws.rs.scim2.AuthorizationProcessingFilter secures invocations - * - * @author Val Pecaoco - * Updated by jgomer on 2017-10-09. */ @Named("scim2FidoDeviceEndpoint") @Path("/scim/v2/FidoDevices") @@ -86,7 +78,6 @@ public class FidoDeviceWebService extends BaseScimWebService implements IFidoDev @Produces({MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT}) @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi - @ApiOperation(value = "Create device", response = FidoDeviceResource.class) public Response createDevice() { log.debug("Executing web service method. createDevice"); return getErrorResponse(Response.Status.NOT_IMPLEMENTED, "Not implemented; device registration only happens via the FIDO API."); @@ -98,7 +89,6 @@ public Response createDevice() { @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Find device by id", notes = "Returns a device by id as path param", response = FidoDeviceResource.class) public Response getDeviceById(@PathParam("id") String id, @QueryParam("userId") String userId, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @@ -136,7 +126,6 @@ public Response getDeviceById(@PathParam("id") String id, @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Update device", response = FidoDeviceResource.class) public Response updateDevice( FidoDeviceResource fidoDeviceResource, @PathParam("id") String id, @@ -186,7 +175,6 @@ public Response updateDevice( @Produces({MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT}) @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi - @ApiOperation(value = "Delete device") public Response deleteDevice(@PathParam("id") String id) { Response response; @@ -215,7 +203,6 @@ public Response deleteDevice(@PathParam("id") String id) { @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Search devices", notes = "Returns a list of devices", response = ListResponse.class) public Response searchDevices( @QueryParam("userId") String userId, @QueryParam(QUERY_PARAM_FILTER) String filter, @@ -254,7 +241,6 @@ public Response searchDevices( @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Search devices POST /.search", notes = "Returns a list of fido devices", response = ListResponse.class) public Response searchDevicesPost(SearchRequest searchRequest, @QueryParam("userId") String userId) { log.debug("Executing web service method. searchDevicesPost"); @@ -390,7 +376,6 @@ private PagedResult searchDevices(String userId, String filter @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "PATCH operation", notes = "https://tools.ietf.org/html/rfc7644#section-3.5.2", response = FidoDeviceResource.class) public Response patchDevice( PatchRequest request, @PathParam("id") String id, diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/GroupWebService.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/GroupWebService.java index 18847fc..4ead203 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/GroupWebService.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/GroupWebService.java @@ -35,7 +35,6 @@ import org.gluu.oxtrust.model.exception.SCIMException; import org.gluu.oxtrust.model.scim2.BaseScimResource; import org.gluu.oxtrust.model.scim2.ErrorScimType; -import org.gluu.oxtrust.model.scim2.ListResponse; import org.gluu.oxtrust.model.scim2.SearchRequest; import org.gluu.oxtrust.model.scim2.group.GroupResource; import org.gluu.oxtrust.model.scim2.patch.PatchOperation; @@ -49,23 +48,13 @@ import org.gluu.persist.model.PagedResult; import org.gluu.persist.model.SortOrder; -import com.wordnik.swagger.annotations.Api; -import com.wordnik.swagger.annotations.ApiOperation; -import com.wordnik.swagger.annotations.ApiParam; -import com.wordnik.swagger.annotations.Authorization; - /** * Implementation of /Groups endpoint. Methods here are intercepted and/or decorated. * Class org.gluu.oxtrust.service.scim2.interceptor.GroupWebServiceDecorator is used to apply pre-validations on data. * Filter org.gluu.oxtrust.filter.AuthorizationProcessingFilter secures invocations - * - * @author Rahat Ali Date: 05.08.2015 - * Updated by jgomer on 2017-10-18 */ @Named("scim2GroupEndpoint") @Path("/scim/v2/Groups") -@Api(value = "/v2/Groups", description = "SCIM 2.0 Group Endpoint (https://tools.ietf.org/html/rfc7644#section-3.2)", - authorizations = {@Authorization(value = "Authorization", type = "uma")}) public class GroupWebService extends BaseScimWebService implements IGroupWebService { @Inject @@ -86,9 +75,8 @@ public class GroupWebService extends BaseScimWebService implements IGroupWebServ @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Create group", notes = "Create group (https://tools.ietf.org/html/rfc7644#section-3.3)", response = GroupResource.class) public Response createGroup( - @ApiParam(value = "Group", required = true) GroupResource group, + GroupResource group, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList) { @@ -113,8 +101,6 @@ public Response createGroup( @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Find group by id", notes = "Returns a group by id as path param (https://tools.ietf.org/html/rfc7644#section-3.4.2.1)", - response = GroupResource.class) public Response getGroupById( @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @@ -155,9 +141,8 @@ public Response getGroupById( @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Update group", notes = "Update group (https://tools.ietf.org/html/rfc7644#section-3.5.1)", response = GroupResource.class) public Response updateGroup( - @ApiParam(value = "Group", required = true) GroupResource group, + GroupResource group, @PathParam("id") String id, @QueryParam(QUERY_PARAM_ATTRIBUTES) String attrsList, @QueryParam(QUERY_PARAM_EXCLUDED_ATTRS) String excludedAttrsList) { @@ -186,7 +171,6 @@ public Response updateGroup( @Produces({MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT}) @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi - @ApiOperation(value = "Delete group", notes = "Delete group (https://tools.ietf.org/html/rfc7644#section-3.6)") public Response deleteGroup(@PathParam("id") String id){ Response response; @@ -209,7 +193,6 @@ public Response deleteGroup(@PathParam("id") String id){ @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Search groups", notes = "Returns a list of groups (https://tools.ietf.org/html/rfc7644#section-3.4.2.2)", response = ListResponse.class) public Response searchGroups( @QueryParam(QUERY_PARAM_FILTER) String filter, @QueryParam(QUERY_PARAM_START_INDEX) Integer startIndex, @@ -248,8 +231,7 @@ public Response searchGroups( @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "Search group POST /.search", notes = "Returns a list of groups (https://tools.ietf.org/html/rfc7644#section-3.4.3)", response = ListResponse.class) - public Response searchGroupsPost(@ApiParam(value = "SearchRequest", required = true) SearchRequest searchRequest){ + public Response searchGroupsPost(SearchRequest searchRequest){ log.debug("Executing web service method. searchGroupsPost"); @@ -275,7 +257,6 @@ public Response searchGroupsPost(@ApiParam(value = "SearchRequest", required = t @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "PATCH operation", notes = "https://tools.ietf.org/html/rfc7644#section-3.5.2", response = GroupResource.class) public Response patchGroup( PatchRequest request, @PathParam("id") String id, diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ResourceTypeWS.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ResourceTypeWS.java index 57c6843..60f0a06 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ResourceTypeWS.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ResourceTypeWS.java @@ -32,15 +32,8 @@ import org.gluu.oxtrust.service.scim2.ExtensionService; import org.gluu.oxtrust.service.scim2.interceptor.RejectFilterParam; -import com.wordnik.swagger.annotations.Api; - -/** - * @author Rahat Ali Date: 05.08.2015 - * Re-engineered by jgomer on 2017-09-25. - */ @Named("resourceTypesWs") @Path("/scim/v2/ResourceTypes") -@Api(value = "/v2/ResourceTypes", description = "SCIM 2.0 ResourceType Endpoint (https://tools.ietf.org/html/rfc7643#section-6)") public class ResourceTypeWS extends BaseScimWebService { //The following are not computed using the endpointUrl's of web services since they are required to be constant (used in @Path annotations) diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SchemaWebService.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SchemaWebService.java index f4ce62f..a95c454 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SchemaWebService.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SchemaWebService.java @@ -39,17 +39,12 @@ import org.gluu.oxtrust.service.scim2.interceptor.RejectFilterParam; import com.fasterxml.jackson.annotation.JsonProperty; -import com.wordnik.swagger.annotations.Api; /** * Web service for the /Schemas endpoint. - * - * @author Val Pecaoco - * Re-engineered by jgomer on 2017-09-27. */ @Named("scim2SchemaEndpoint") @Path("/scim/v2/Schemas") -@Api(value = "/v2/Schemas", description = "SCIM 2.0 Schema Endpoint (https://tools.ietf.org/html/rfc7643#section-4)") public class SchemaWebService extends BaseScimWebService { private Map> resourceSchemas; diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SearchResourcesWebService.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SearchResourcesWebService.java index b205a3a..aa645cd 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SearchResourcesWebService.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/SearchResourcesWebService.java @@ -37,13 +37,8 @@ import org.gluu.oxtrust.service.scim2.serialization.ListResponseJsonSerializer; import org.gluu.util.Pair; -import com.wordnik.swagger.annotations.ApiOperation; -import com.wordnik.swagger.annotations.ApiParam; - /** * Implementation of the /.search endpoint for the root URL of the service - * - * Created by jgomer on 2017-10-25. */ @Named @Path("/scim/v2/.search") @@ -73,8 +68,7 @@ public class SearchResourcesWebService extends BaseScimWebService { @HeaderParam("Accept") @DefaultValue(MEDIA_TYPE_SCIM_JSON) @ProtectedApi @RefAdjusted - @ApiOperation(value = "General search POST /.search", notes = "Returns a list of resources (https://tools.ietf.org/html/rfc7644#section-3.4.3)", response = ListResponse.class) - public Response search(@ApiParam(value = "SearchRequest", required = true) SearchRequest searchRequest) { + public Response search(SearchRequest searchRequest) { SearchRequest searchReq = new SearchRequest(); Response response = prepareSearchRequest(searchRequest.getSchemas(), searchRequest.getFilter(), null, searchRequest.getSortBy(), diff --git a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ServiceProviderConfigWS.java b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ServiceProviderConfigWS.java index d5463de..e79cd77 100644 --- a/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ServiceProviderConfigWS.java +++ b/scim-rest/src/main/java/org/gluu/oxtrust/ws/rs/scim2/ServiceProviderConfigWS.java @@ -20,10 +20,6 @@ import org.gluu.oxtrust.model.scim2.util.ScimResourceUtil; import org.gluu.oxtrust.service.scim2.interceptor.RejectFilterParam; -/** - * @author Rahat Ali Date: 05.08.2015 - * Updated by jgomer2001 on 2017-09-23 - */ @Named("serviceProviderConfig") @Path("/scim/v2/ServiceProviderConfig") public class ServiceProviderConfigWS extends BaseScimWebService {