diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/pom.xml b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/pom.xml index 73205068..7ca63281 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/pom.xml @@ -1,4 +1,21 @@ + diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/PushDeviceManagerServiceDataHolder.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/PushDeviceManagerServiceDataHolder.java index 1c0c1a9f..7f2cdc79 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/PushDeviceManagerServiceDataHolder.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/PushDeviceManagerServiceDataHolder.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.api.user.push.common; import org.wso2.carbon.identity.notification.push.device.handler.DeviceHandlerService; diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/factory/PushDeviceManagerOSGIServiceFactory.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/factory/PushDeviceManagerOSGIServiceFactory.java index 87585566..3663292a 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/factory/PushDeviceManagerOSGIServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.api.user.push.common/src/main/java/org/wso2/carbon/identity/api/user/push/common/factory/PushDeviceManagerOSGIServiceFactory.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.api.user.push.common.factory; import org.springframework.beans.factory.config.AbstractFactoryBean; diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/pom.xml b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/pom.xml index 573db023..3995de3d 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/pom.xml @@ -1,4 +1,21 @@ + diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApi.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApi.java index 3fabe9ef..951adb12 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApi.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -27,7 +27,6 @@ import org.wso2.carbon.identity.rest.api.user.push.v1.model.DeviceDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.Error; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationRequestDTO; -import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationResponseDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RemoveRequestDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.DevicesApiService; @@ -108,9 +107,9 @@ public Response getDevices() { @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "Register mobile devices to receive push notifications.", notes = "This API is used to register a push notification device into the Identity Server. This API will be invoked from the mobile device. ", response = RegistrationResponseDTO.class, tags={ "mobile", }) + @ApiOperation(value = "Register mobile devices to receive push notifications.", notes = "This API is used to register a push notification device into the Identity Server. This API will be invoked from the mobile device. ", response = Void.class, tags={ "mobile", }) @ApiResponses(value = { - @ApiResponse(code = 201, message = "Registered a new device", response = RegistrationResponseDTO.class), + @ApiResponse(code = 201, message = "Registered a new device", response = Void.class), @ApiResponse(code = 400, message = "Invalid input in the request.", response = Error.class), @ApiResponse(code = 401, message = "Authentication information is missing or invalid.", response = Void.class), @ApiResponse(code = 403, message = "Access forbidden.", response = Void.class), diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApiService.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApiService.java index ecc6b271..b2930cc8 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApiService.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DevicesApiService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -27,7 +27,6 @@ import org.wso2.carbon.identity.rest.api.user.push.v1.model.DeviceDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.Error; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationRequestDTO; -import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationResponseDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RemoveRequestDTO; import javax.ws.rs.core.Response; diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApi.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApi.java index 8c9edf51..9f6e1bf1 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApi.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApiService.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApiService.java index 24993e8c..ce401a89 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApiService.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/DiscoveryDataApiService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DevicesApiServiceFactory.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DevicesApiServiceFactory.java index 4e98d562..24c08857 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DevicesApiServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DevicesApiServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DiscoveryDataApiServiceFactory.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DiscoveryDataApiServiceFactory.java index fd9df4bf..38ea07c2 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DiscoveryDataApiServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/factories/DiscoveryDataApiServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/model/DiscoveryDataDTO.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/model/DiscoveryDataDTO.java index d9852f20..cf5920be 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/model/DiscoveryDataDTO.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/push/v1/model/DiscoveryDataDTO.java @@ -39,10 +39,8 @@ public class DiscoveryDataDTO { private String username; private String host; private String tenantDomain; - private String tenantPath; private String organizationId; private String organizationName; - private String organizationPath; private String challenge; /** @@ -121,25 +119,6 @@ public void setTenantDomain(String tenantDomain) { this.tenantDomain = tenantDomain; } - /** - * Tenanted path - **/ - public DiscoveryDataDTO tenantPath(String tenantPath) { - - this.tenantPath = tenantPath; - return this; - } - - @ApiModelProperty(example = "/t/carbon.super", value = "Tenanted path") - @JsonProperty("tenantPath") - @Valid - public String getTenantPath() { - return tenantPath; - } - public void setTenantPath(String tenantPath) { - this.tenantPath = tenantPath; - } - /** * Organization ID **/ @@ -178,25 +157,6 @@ public void setOrganizationName(String organizationName) { this.organizationName = organizationName; } - /** - * Organization path - **/ - public DiscoveryDataDTO organizationPath(String organizationPath) { - - this.organizationPath = organizationPath; - return this; - } - - @ApiModelProperty(example = "/o/sampleOrg", value = "Organization path") - @JsonProperty("organizationPath") - @Valid - public String getOrganizationPath() { - return organizationPath; - } - public void setOrganizationPath(String organizationPath) { - this.organizationPath = organizationPath; - } - /** * Challenge **/ @@ -232,16 +192,14 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.username, discoveryDataDTO.username) && Objects.equals(this.host, discoveryDataDTO.host) && Objects.equals(this.tenantDomain, discoveryDataDTO.tenantDomain) && - Objects.equals(this.tenantPath, discoveryDataDTO.tenantPath) && Objects.equals(this.organizationId, discoveryDataDTO.organizationId) && Objects.equals(this.organizationName, discoveryDataDTO.organizationName) && - Objects.equals(this.organizationPath, discoveryDataDTO.organizationPath) && Objects.equals(this.challenge, discoveryDataDTO.challenge); } @Override public int hashCode() { - return Objects.hash(deviceId, username, host, tenantDomain, tenantPath, organizationId, organizationName, organizationPath, challenge); + return Objects.hash(deviceId, username, host, tenantDomain, organizationId, organizationName, challenge); } @Override @@ -254,10 +212,8 @@ public String toString() { sb.append(" username: ").append(toIndentedString(username)).append("\n"); sb.append(" host: ").append(toIndentedString(host)).append("\n"); sb.append(" tenantDomain: ").append(toIndentedString(tenantDomain)).append("\n"); - sb.append(" tenantPath: ").append(toIndentedString(tenantPath)).append("\n"); sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); sb.append(" organizationName: ").append(toIndentedString(organizationName)).append("\n"); - sb.append(" organizationPath: ").append(toIndentedString(organizationPath)).append("\n"); sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/core/PushDeviceManagementService.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/core/PushDeviceManagementService.java index cc252edc..7e0de09d 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/core/PushDeviceManagementService.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/core/PushDeviceManagementService.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.rest.api.user.push.v1.core; import com.google.gson.Gson; @@ -16,11 +34,11 @@ import org.wso2.carbon.identity.rest.api.user.push.v1.model.DeviceDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.DiscoveryDataDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationRequestDTO; -import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationResponseDTO; import java.util.ArrayList; import java.util.List; +import static org.wso2.carbon.identity.notification.push.device.handler.constant.PushDeviceHandlerConstants.ErrorMessages.ERROR_CODE_DEVICE_NOT_FOUND_FOR_USER_ID; import static org.wso2.carbon.identity.rest.api.user.push.v1.util.Util.handlePushDeviceHandlerException; /** @@ -74,18 +92,20 @@ public DeviceDTO getDevice(String deviceId) { */ public List getDeviceByUserId() { + List deviceDTOList = new ArrayList<>(); try { User user = ContextLoader.getUserFromContext(); String tenantDomain = user.getTenantDomain(); String userId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId(); Device device = PushDeviceManagerServiceDataHolder.getDeviceHandlerService().getDeviceByUserId(userId, tenantDomain); - List deviceDTOList = new ArrayList<>(); deviceDTOList.add(buildDeviceDTO(device)); - return deviceDTOList; } catch (PushDeviceHandlerException e) { - throw handlePushDeviceHandlerException(e); + if (!ERROR_CODE_DEVICE_NOT_FOUND_FOR_USER_ID.getCode().equals(e.getErrorCode())) { + throw handlePushDeviceHandlerException(e); + } } + return deviceDTOList; } /** @@ -121,18 +141,14 @@ public void removeDeviceFromMobile(String deviceId, String token) { * Register a device. * * @param registrationRequestDTO Registration request DTO. - * @return Registration response DTO. */ - public RegistrationResponseDTO registerDevice(RegistrationRequestDTO registrationRequestDTO) { + public void registerDevice(RegistrationRequestDTO registrationRequestDTO) { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); RegistrationRequest request = buildRegistrationRequest(registrationRequestDTO); try { - Device device = PushDeviceManagerServiceDataHolder.getDeviceHandlerService() + PushDeviceManagerServiceDataHolder.getDeviceHandlerService() .registerDevice(request, tenantDomain); - RegistrationResponseDTO responseDTO = new RegistrationResponseDTO(); - responseDTO.setDeviceId(device.getDeviceId()); - return responseDTO; } catch (PushDeviceHandlerException e) { throw handlePushDeviceHandlerException(e); } @@ -151,11 +167,9 @@ private DiscoveryDataDTO buildDiscoveryDataDTO(RegistrationDiscoveryData data) { discoveryDataDTO.setUsername(data.getUsername()); discoveryDataDTO.setHost(data.getHost()); discoveryDataDTO.setTenantDomain(data.getTenantDomain()); - discoveryDataDTO.setTenantPath(data.getTenantPath()); if (StringUtils.isNotBlank(data.getOrganizationId())) { discoveryDataDTO.setOrganizationId(data.getOrganizationId()); discoveryDataDTO.setOrganizationName(data.getOrganizationName()); - discoveryDataDTO.setOrganizationPath(data.getOrganizationPath()); } discoveryDataDTO.setChallenge(data.getChallenge()); return discoveryDataDTO; diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/exception/PushDeviceManagementException.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/exception/PushDeviceManagementException.java index a8ab6140..54948577 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/exception/PushDeviceManagementException.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/exception/PushDeviceManagementException.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.rest.api.user.push.v1.exception; import javax.ws.rs.WebApplicationException; diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DevicesApiServiceImpl.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DevicesApiServiceImpl.java index 6c0ddcae..630b38e6 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DevicesApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DevicesApiServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -23,7 +23,6 @@ import org.wso2.carbon.identity.rest.api.user.push.v1.core.PushDeviceManagementService; import org.wso2.carbon.identity.rest.api.user.push.v1.model.DeviceDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationRequestDTO; -import org.wso2.carbon.identity.rest.api.user.push.v1.model.RegistrationResponseDTO; import org.wso2.carbon.identity.rest.api.user.push.v1.model.RemoveRequestDTO; import java.util.List; @@ -62,8 +61,8 @@ public Response getDevices() { @Override public Response registerDevice(RegistrationRequestDTO registrationRequestDTO) { - RegistrationResponseDTO responseDTO = pushDeviceManagementService.registerDevice(registrationRequestDTO); - return Response.ok().entity(responseDTO).build(); + pushDeviceManagementService.registerDevice(registrationRequestDTO); + return Response.created(null).build(); } @Override diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DiscoveryDataApiServiceImpl.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DiscoveryDataApiServiceImpl.java index 7d9fb338..7747408c 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DiscoveryDataApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/impl/DiscoveryDataApiServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/util/Util.java b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/util/Util.java index 872532bd..ee63e347 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/util/Util.java +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/push/v1/util/Util.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.rest.api.user.push.v1.util; import org.apache.commons.logging.Log; diff --git a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/resources/push.yaml b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/resources/push.yaml index 2ef3b469..8447e95c 100644 --- a/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/resources/push.yaml +++ b/components/org.wso2.carbon.identity.api.user.push/org.wso2.carbon.identity.rest.api.user.push.v1/src/main/resources/push.yaml @@ -67,10 +67,6 @@ paths: responses: '201': description: Registered a new device - content: - application/json: - schema: - $ref: '#/components/schemas/RegistrationResponseDTO' '400': $ref: '#/components/responses/BadRequest' '401': @@ -223,10 +219,6 @@ components: description: Tenant domain type: string example: carbon.super - tenantPath: - description: Tenanted path - type: string - example: /t/carbon.super organizationId: description: Organization ID type: string @@ -235,10 +227,6 @@ components: description: Organization name type: string example: sampleOrg - organizationPath: - description: Organization path - type: string - example: /o/sampleOrg challenge: description: Challenge type: string diff --git a/components/org.wso2.carbon.identity.api.user.push/pom.xml b/components/org.wso2.carbon.identity.api.user.push/pom.xml index 1034f303..edaf316d 100644 --- a/components/org.wso2.carbon.identity.api.user.push/pom.xml +++ b/components/org.wso2.carbon.identity.api.user.push/pom.xml @@ -1,4 +1,21 @@ +