diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/pom.xml b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/pom.xml deleted file mode 100644 index 41d577cba..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/pom.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.challenge - 1.3.25-SNAPSHOT - ../pom.xml - - 4.0.0 - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.challenge.common - jar - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.plugin.version} - - 1.8 - 1.8 - - - - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - provided - - - org.apache.cxf - cxf-rt-rs-service-description - provided - - - org.springframework - spring-web - provided - - - javax.ws.rs - javax.ws.rs-api - provided - - - io.swagger - swagger-jaxrs - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-annotations - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - javax.ws.rs - jsr311-api - - - com.google.guava - guava - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - provided - - - org.wso2.carbon.identity.governance - org.wso2.carbon.identity.recovery - provided - - - javax.ws.rs - jsr311-api - - - - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.common - provided - ${project.version} - - - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/ChallengeQuestionServiceHolder.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/ChallengeQuestionServiceHolder.java deleted file mode 100644 index 43c904c08..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/ChallengeQuestionServiceHolder.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - *                                                                          - * Licensed 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.challenge.common; - -import org.wso2.carbon.identity.recovery.ChallengeQuestionManager; -import org.wso2.carbon.user.core.service.RealmService; - -/** - * Service holder class for user challenge services. - */ -public class ChallengeQuestionServiceHolder { - - private static ChallengeQuestionManager challengeQuestionManager; - - private static RealmService realmService; - - /** - * Get ChallengeQuestionManager osgi service. - * @return ChallengeQuestionManager - */ - public static ChallengeQuestionManager getChallengeQuestionManager() { - return challengeQuestionManager; - } - - public static void setChallengeQuestionManager(ChallengeQuestionManager challengeQuestionManager) { - ChallengeQuestionServiceHolder.challengeQuestionManager = challengeQuestionManager; - } - - public static RealmService getRealmService() { - - return realmService; - } - - public static void setRealmService(RealmService realmService) { - - ChallengeQuestionServiceHolder.realmService = realmService; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/Constant.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/Constant.java deleted file mode 100644 index c5df7f0b7..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/Constant.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.common; - -/** - * Contains all the user challenge management related constants - */ -public class Constant { - - public static final String CHALLENGE_QUESTION_PREFIX = "CQM-"; - public static final String USER_CHALLENGE_ANSWERS_PATH_COMPONENT = "/%s/challenge-answers"; - public static final String V1_API_PATH_COMPONENT = "/v1"; - public static final String ME_CONTEXT = "me"; - - /** - * Enum for user challenge management related errors in the format of - * Error Code - code to identify the error - * Error Message - What went wrong - * Error Description - Why it went wrong - */ - public enum ErrorMessage { - - ERROR_CODE_ERROR_RETRIEVING_CHALLENGES_FOR_USER("10002", - "Unable to retrieve challenges for the user.", - "Server encountered an error while retrieving challenges for user."), - ERROR_CODE_ERROR_RETRIEVING_CHALLENGE_ANSWERS_OF_USER("10003", - "Unable to retrieve the user challenge answers.", - "Server encountered an error while retrieving challenge answers of user."), - ERROR_CODE_ERROR_RETRIEVING_CHALLENGE_ANSWER_OF_USER("10004", - "Unable to retrieve the user challenge answer.", - "Server encountered an error while retrieving challenge answer of user."), - ERROR_CODE_ERROR_SETTING_CHALLENGE_ANSWERS_OF_USER("10005", - "Unable to set user challenge answers.", - "Server encountered an error while setting answers to the user challenges."), - ERROR_CODE_ERROR_UPDATING_CHALLENGE_ANSWERS_OF_USER("10006", - "Unable to update user challenge answers.", - "Server encountered an error while updating the answers to the user challenges."), - ERROR_CODE_ERROR_DELETING_CHALLENGE_ANSWERS_OF_USER("10007", - "Unable to remove user challenge answers.", - "Server encountered an error while removing answers of the user challenges."), - ERROR_CODE_ERROR_SETTING_CHALLENGE_ANSWER_OF_USER("10008", - "Unable to update user challenge answer.", - "Server encountered an error while updating the answer of the user challenge."), - ERROR_CODE_ERROR_UPDATING_CHALLENGE_ANSWER_OF_USER("10009", - "Unable to update user challenge answer.", - "Server encountered an error while updating the answer of the user challenge."), - ERROR_CODE_ERROR_DELETING_CHALLENGE_ANSWER_OF_USER("10010", - "Unable to remove user challenge answer.", - "Server encountered an error while removing answer of the user challenge."), - ERROR_CHALLENGE_ANSWER_MISSING("10011", - "Invalid request.", - "Challenge question is missing in the user challenge answer request."), - ERROR_CODE_USER_ALREADY_ANSWERED_CHALLENGES("10012", - "Challenge questions are already answered.", - "User has already answered some challenges. Hence, Unable to add new Answers."), - ERROR_CODE_USER_HAS_NOT_ANSWERED_CHALLENGES("10013", - "Challenge Answers Not set.", "User has not" + - " answered any challenges. Hence, Unable to process."), - ERROR_CODE_USER_ALREADY_ANSWERED_CHALLENGE("10014", - "Challenge Answer Already set.", "User has already " + - "answered this challenge. Hence, Unable to as a new challenge answer."), - ERROR_CODE_USER_HAS_NOT_ANSWERED_CHALLENGE("10015", - "Challenge Answer Not set.", "User has not " + - "answered this challenge. Hence, Unable to process."), - ERROR_CODE_INVALID_ANSWER_FORMAT("10016", - "Invalid answer format", - "Invalid answer format in the given answer for the challenge question '%s'."), - ERROR_CODE_NOT_UNIQUE_ANSWER("10017", - "The given challenge question answer is not unique", - "The given answer for the challenge question, '%s' has been used more than once."); - - private final String code; - private final String message; - private final String description; - - ErrorMessage(String code, String message, String description) { - this.code = code; - this.message = message; - this.description = description; - } - - public String getCode() { - return CHALLENGE_QUESTION_PREFIX + code; - } - - public String getMessage() { - return message; - } - - public String getDescription() { - return description; - } - - @Override - public String toString() { - return code + " | " + message; - } - - } - -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/factory/OSGIServiceFactory.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/factory/OSGIServiceFactory.java deleted file mode 100644 index 1c5141228..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/factory/OSGIServiceFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - *                                                                          - * Licensed 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.challenge.common.factory; - -import org.springframework.beans.factory.config.AbstractFactoryBean; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.identity.recovery.ChallengeQuestionManager; - -/** - * Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to - * instantiate the ChallengeQuestionManager type of object inside the container. - */ -public class OSGIServiceFactory extends AbstractFactoryBean { - - private ChallengeQuestionManager challengeQuestionManager; - - @Override - public Class getObjectType() { - return Object.class; - } - - @Override - protected ChallengeQuestionManager createInstance() throws Exception { - - if (this.challengeQuestionManager == null) { - ChallengeQuestionManager challengeQuestionManager = (ChallengeQuestionManager) PrivilegedCarbonContext. - getThreadLocalCarbonContext().getOSGiService(ChallengeQuestionManager.class, null); - if (challengeQuestionManager != null) { - this.challengeQuestionManager = challengeQuestionManager; - } else { - throw new Exception("Unable to retrieve ChallengeQuestionManager service."); - } - } - return this.challengeQuestionManager; - } - -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/factory/RealmServiceOSGIServiceFactory.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/factory/RealmServiceOSGIServiceFactory.java deleted file mode 100644 index f6fbc5923..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.api.user.challenge.common/src/main/java/org/wso2/carbon/identity/api/user/challenge/common/factory/RealmServiceOSGIServiceFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.common.factory; - -import org.springframework.beans.factory.config.AbstractFactoryBean; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.user.core.service.RealmService; - -/** - * Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to - * instantiate the RealmService type of object inside the container. - */ -public class RealmServiceOSGIServiceFactory extends AbstractFactoryBean { - - private RealmService realmService; - - @Override - public Class getObjectType() { - - return Object.class; - } - - @Override - protected RealmService createInstance() throws Exception { - - if (this.realmService == null) { - RealmService realmService - = (RealmService) PrivilegedCarbonContext.getThreadLocalCarbonContext() - .getOSGiService(RealmService.class, null); - if (realmService != null) { - this.realmService = realmService; - } else { - throw new Exception("Unable to retrieve RealmService."); - } - } - return this.realmService; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/pom.xml b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/pom.xml deleted file mode 100644 index 6b6305822..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/pom.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.challenge - ../pom.xml - 1.3.25-SNAPSHOT - - 4.0.0 - org.wso2.carbon.identity.rest.api.user.challenge.v1 - jar - WSO2 Identity Server - User Challenges Rest API - WSO2 Identity Server - User Challenges Rest API - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.plugin.version} - - 1.8 - 1.8 - - - - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - - - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - provided - - - org.apache.cxf - cxf-rt-rs-service-description - provided - - - org.springframework - spring-web - provided - - - javax.ws.rs - javax.ws.rs-api - provided - - - io.swagger - swagger-jaxrs - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-annotations - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - javax.ws.rs - jsr311-api - - - com.google.guava - guava - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - provided - - - org.wso2.carbon.identity.governance - org.wso2.carbon.identity.recovery - provided - - - javax.ws.rs - jsr311-api - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - provided - - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.challenge.common - provided - ${project.version} - - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.common - provided - ${project.version} - - - - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/ApiException.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/ApiException.java deleted file mode 100644 index 36b5cd076..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/ApiException.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.wso2.carbon.identity.rest.api.user.challenge.v1; -//comment -public class ApiException extends Exception{ - private int code; - public ApiException (int code, String msg) { - super(msg); - this.code = code; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/ApiResponseMessage.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/ApiResponseMessage.java deleted file mode 100644 index aa08b5c5b..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/ApiResponseMessage.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.wso2.carbon.identity.rest.api.user.challenge.v1; - -import javax.xml.bind.annotation.XmlTransient; - -@javax.xml.bind.annotation.XmlRootElement -public class ApiResponseMessage { - public static final int ERROR = 1; - public static final int WARNING = 2; - public static final int INFO = 3; - public static final int OK = 4; - public static final int TOO_BUSY = 5; - - int code; - String type; - String message; - - public ApiResponseMessage(){} - - public ApiResponseMessage(int code, String message){ - this.code = code; - switch(code){ - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - @XmlTransient - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/MeApi.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/MeApi.java deleted file mode 100644 index a68e1ca81..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/MeApi.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1; - -import org.springframework.beans.factory.annotation.Autowired; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.*; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.MeApiService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.factories.MeApiServiceFactory; - -import io.swagger.annotations.ApiParam; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ErrorDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import java.util.List; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerResponseDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeSetDTO; - -import java.util.List; - -import java.io.InputStream; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; - -import javax.ws.rs.core.Response; -import javax.ws.rs.*; - -@Path("/me") - - -@io.swagger.annotations.Api(value = "/me", description = "the me API") -public class MeApi { - - @Autowired - private MeApiService delegate; - - @POST - @Path("/challenge-answers/{challenge-set-id}") - - - @io.swagger.annotations.ApiOperation(value = "Answers a specific new challenge.", notes = "Provide an **answer** to **a specific challenge** in the system for loggedin user. The user can at most select one question from a challenge set of interest.\n\nPermission required:\n * /permission/admin/login\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 201, message = "Item Created"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 409, message = "Element Already Exists"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response addChallengeAnswerOfLoggedInUser(@ApiParam(value = "Challenge Question Set ID",required=true ) @PathParam("challenge-set-id") String challengeSetId, - @ApiParam(value = "The answer to the challenge along with the question." ) UserChallengeAnswerDTO challengeAnswer) - { - return delegate.addChallengeAnswerOfLoggedInUser(challengeSetId,challengeAnswer); - } - @POST - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Answer to a collection of new challenges.", notes = "Provide answer(s) to one or more candidate challenge question set(s) available in the system for the authenticated user. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **set(s)**.\n\nPermission required:\n * /permission/admin/login\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 201, message = "Item Created"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 409, message = "Element Already Exists"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response addChallengeAnswersForLoggedInUser(@ApiParam(value = "One or more challenge(s) with the answer." ) List challengeAnswer) - { - return delegate.addChallengeAnswersForLoggedInUser(challengeAnswer); - } - @DELETE - @Path("/challenge-answers/{challenge-set-id}") - - - @io.swagger.annotations.ApiOperation(value = "Remove a challenge question answer.", notes = "Removes existing answer provided by the authenticated user to a specific challenge.\n\nPermission required:\n * /permission/admin/login\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 204, message = "No Content"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response deleteChallengeAnswerOfLoggedInUser(@ApiParam(value = "Challenge Question Set ID",required=true ) @PathParam("challenge-set-id") String challengeSetId) - { - return delegate.deleteChallengeAnswerOfLoggedInUser(challengeSetId); - } - @DELETE - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Remove challenge question answers.", notes = "Removes all the existing challenge answers of the authenticated user.\n\nPermission required:\n * /permission/admin/login\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 204, message = "No Content"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response deleteChallengeAnswersOfLoggedInUser() - { - return delegate.deleteChallengeAnswersOfLoggedInUser(); - } - @GET - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Get user's answered challenges.", notes = "Get previously answered challenge(s) in the system by the authenticated user.\n\n Permission required:\n * /permission/admin/login\n", response = UserChallengeAnswerResponseDTO.class, responseContainer = "List") - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Array of Challenge(s) that are already answered by the authenticated user."), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response getAnsweredChallengesOfLoggedInUser() - { - return delegate.getAnsweredChallengesOfLoggedInUser(); - } - @GET - @Path("/challenges") - - - @io.swagger.annotations.ApiOperation(value = "Retrieve challenges available for the authenticated user.", notes = "Retrieves the available challenges in the system for the authenticated user. In the response challenge questions are grouped as **challenge set**s.\n\nPermission required:\n * /permission/admin/login\n", response = ChallengeSetDTO.class, responseContainer = "List") - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "All the available challenges in the system that can be answered by the user."), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response getChallengesForLoggedInUser(@ApiParam(value = "Maximum number of records to return. _*This filtering is not yet supported._") @QueryParam("limit") Integer limit, - @ApiParam(value = "Number of records to skip for pagination. _*This filtering is not yet supported._") @QueryParam("offset") Integer offset) - { - return delegate.getChallengesForLoggedInUser(limit,offset); - } - @PUT - @Path("/challenge-answers/{challenge-set-id}") - - - @io.swagger.annotations.ApiOperation(value = "Update challenge answer of an already answered challenge.", notes = "Update challenge answer in a specific challenge for authenticated user.\n\nPermission required:\n * /permission/admin/login\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "OK"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response updateChallengeAnswerOfLoggedInUser(@ApiParam(value = "Challenge Question Set ID",required=true ) @PathParam("challenge-set-id") String challengeSetId, - @ApiParam(value = "The challenge answer with the challenge-question." ) UserChallengeAnswerDTO challengeAnswer) - { - return delegate.updateChallengeAnswerOfLoggedInUser(challengeSetId,challengeAnswer); - } - @PUT - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Answer new challenge question combination over existing answers.", notes = "Overrides the *already answered challenges* in the system with a set of *new challenge question answers* for logged In user. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **sets**.\n\nPermission required:\n * /permission/admin/login\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "OK"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response updateChallengeAnswersOfLoggedInUser(@ApiParam(value = "Set of challenges with answer." ) List challengeAnswers) - { - return delegate.updateChallengeAnswersOfLoggedInUser(challengeAnswers); - } -} - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/MeApiService.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/MeApiService.java deleted file mode 100644 index d0f5f9a8b..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/MeApiService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.*; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.*; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ErrorDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import java.util.List; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerResponseDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeSetDTO; - -import java.util.List; - -import java.io.InputStream; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import javax.ws.rs.core.Response; - -public abstract class MeApiService { - public abstract Response addChallengeAnswerOfLoggedInUser(String challengeSetId,UserChallengeAnswerDTO challengeAnswer); - public abstract Response addChallengeAnswersForLoggedInUser(List challengeAnswer); - public abstract Response deleteChallengeAnswerOfLoggedInUser(String challengeSetId); - public abstract Response deleteChallengeAnswersOfLoggedInUser(); - public abstract Response getAnsweredChallengesOfLoggedInUser(); - public abstract Response getChallengesForLoggedInUser(Integer limit,Integer offset); - public abstract Response updateChallengeAnswerOfLoggedInUser(String challengeSetId,UserChallengeAnswerDTO challengeAnswer); - public abstract Response updateChallengeAnswersOfLoggedInUser(List challengeAnswers); -} - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/UserIdApi.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/UserIdApi.java deleted file mode 100644 index 97924edc1..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/UserIdApi.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1; - -import org.springframework.beans.factory.annotation.Autowired; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.*; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.UserIdApiService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.factories.UserIdApiServiceFactory; - -import io.swagger.annotations.ApiParam; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ErrorDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import java.util.List; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerResponseDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeSetDTO; - -import java.util.List; - -import java.io.InputStream; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; - -import javax.ws.rs.core.Response; -import javax.ws.rs.*; - -@Path("/{user-id}") - - -@io.swagger.annotations.Api(value = "/{user-id}", description = "the {user-id} API") -public class UserIdApi { - - @Autowired - private UserIdApiService delegate; - - @POST - @Path("/challenge-answers/{challenge-set-id}") - - - @io.swagger.annotations.ApiOperation(value = "Answers a specific new challenge.", notes = "Provide an **answer** to **a specific challenge** in the system for the user identified by user-id. The user can at most select one question from a challenge set of interest.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 201, message = "Item Created"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 409, message = "Element Already Exists"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response addChallengeAnswerOfAUser(@ApiParam(value = "Challenge Question Set ID",required=true ) @PathParam("challenge-set-id") String challengeSetId, - @ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId, - @ApiParam(value = "The answer to the challenge along with the question." ) UserChallengeAnswerDTO challengeAnswer) - { - return delegate.addChallengeAnswerOfAUser(challengeSetId,userId,challengeAnswer); - } - @POST - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Answer to a collection of new challenges.", notes = "Provide answer(s) to one or more candidate challenge question set(s) available in the system for the user identified by user-id. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **set(s)**.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 201, message = "Item Created"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 409, message = "Element Already Exists"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response addChallengeAnswersOfAUser(@ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId, - @ApiParam(value = "One or more challenge(s) with the answer." ) List challengeAnswer) - { - return delegate.addChallengeAnswersOfAUser(userId,challengeAnswer); - } - @DELETE - @Path("/challenge-answers/{challenge-set-id}") - - - @io.swagger.annotations.ApiOperation(value = "Remove a challenge question answer.", notes = "Removes existing answer provided by the user(identified by user-id) to a specific challenge.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 204, message = "No Content"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response deleteChallengeAnswerOfAUser(@ApiParam(value = "Challenge Question Set ID",required=true ) @PathParam("challenge-set-id") String challengeSetId, - @ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId) - { - return delegate.deleteChallengeAnswerOfAUser(challengeSetId,userId); - } - @DELETE - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Remove challenge question answers.", notes = "Removes all the existing challenge answers of the user identified by user-id.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 204, message = "No Content"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response deleteChallengeAnswersOfAUser(@ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId) - { - return delegate.deleteChallengeAnswersOfAUser(userId); - } - @GET - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Get user's answered challenges.", notes = "Get previously answered challenge(s) in the system by the user idenrified by user-id.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = UserChallengeAnswerResponseDTO.class, responseContainer = "List") - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Array of Challenge(s) that are already answered by the authenticated user."), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response getAnsweredChallengesOfAUser(@ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId) - { - return delegate.getAnsweredChallengesOfAUser(userId); - } - @GET - @Path("/challenges") - - - @io.swagger.annotations.ApiOperation(value = "Retrieve challenges available for a user identified by the user-id.", notes = "Retrieves the available challenges in the system for the specified user. In the response challenge questions are grouped as **challenge set**s.\n\nPermission required:\n * /permission/admin/manage/identity\n", response = ChallengeSetDTO.class, responseContainer = "List") - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "All the available challenges in the system that can be answered by the user.\n"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response getChallengesForAUser(@ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId, - @ApiParam(value = "Maximum number of records to return. _*This filtering is not yet supported._") @QueryParam("limit") Integer limit, - @ApiParam(value = "Number of records to skip for pagination. _*This filtering is not yet supported._") @QueryParam("offset") Integer offset) - { - return delegate.getChallengesForAUser(userId,limit,offset); - } - @PUT - @Path("/challenge-answers/{challenge-set-id}") - - - @io.swagger.annotations.ApiOperation(value = "Update challenge answer of an already answered challenge.", notes = "Update challenge answer in a specific challenge for authenticated user.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "OK"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response updateChallengeAnswerOfAUser(@ApiParam(value = "Challenge Question Set ID",required=true ) @PathParam("challenge-set-id") String challengeSetId, - @ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId, - @ApiParam(value = "The challenge answer with the challenge-question." ) UserChallengeAnswerDTO challengeAnswer) - { - return delegate.updateChallengeAnswerOfAUser(challengeSetId,userId,challengeAnswer); - } - @PUT - @Path("/challenge-answers") - - - @io.swagger.annotations.ApiOperation(value = "Answer new challenge question combination over existing answers.", notes = "Overrides the *already answered challenges* in the system with a set of *new challenge question answers* for the user identified by user-id. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **sets**.\n\n Permission required:\n * /permission/admin/manage/identity\n", response = void.class) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "OK"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid input request"), - - @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized"), - - @io.swagger.annotations.ApiResponse(code = 403, message = "Resource Forbidden"), - - @io.swagger.annotations.ApiResponse(code = 404, message = "The specified resource is not found"), - - @io.swagger.annotations.ApiResponse(code = 500, message = "Internal Server Error") }) - - public Response updateChallengeAnswersOfAUser(@ApiParam(value = "Uniquely identifiable user ID",required=true ) @PathParam("user-id") String userId, - @ApiParam(value = "Set of challenges with answer." ) List challengeAnswers) - { - return delegate.updateChallengeAnswersOfAUser(userId,challengeAnswers); - } -} - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/UserIdApiService.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/UserIdApiService.java deleted file mode 100644 index c35484f8c..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/UserIdApiService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.*; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.*; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ErrorDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import java.util.List; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerResponseDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeSetDTO; - -import java.util.List; - -import java.io.InputStream; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; - -import javax.ws.rs.core.Response; - -public abstract class UserIdApiService { - public abstract Response addChallengeAnswerOfAUser(String challengeSetId,String userId,UserChallengeAnswerDTO challengeAnswer); - public abstract Response addChallengeAnswersOfAUser(String userId,List challengeAnswer); - public abstract Response deleteChallengeAnswerOfAUser(String challengeSetId,String userId); - public abstract Response deleteChallengeAnswersOfAUser(String userId); - public abstract Response getAnsweredChallengesOfAUser(String userId); - public abstract Response getChallengesForAUser(String userId,Integer limit,Integer offset); - public abstract Response updateChallengeAnswerOfAUser(String challengeSetId,String userId,UserChallengeAnswerDTO challengeAnswer); - public abstract Response updateChallengeAnswersOfAUser(String userId,List challengeAnswers); -} - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeAnswerDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeAnswerDTO.java deleted file mode 100644 index 307ca0865..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeAnswerDTO.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.dto; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeQuestionDTO; - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - - - - - -@ApiModel(description = "") -public class ChallengeAnswerDTO { - - - - private String questionSetId = null; - - - private ChallengeQuestionDTO challengeQuestion = null; - - @NotNull - private String answer = null; - - - /** - * A unique ID to identify the challenge set. - **/ - @ApiModelProperty(value = "A unique ID to identify the challenge set.") - @JsonProperty("questionSetId") - public String getQuestionSetId() { - return questionSetId; - } - public void setQuestionSetId(String questionSetId) { - this.questionSetId = questionSetId; - } - - - /** - * A challenge question that is selected to answer from the set. - **/ - @ApiModelProperty(value = "A challenge question that is selected to answer from the set.") - @JsonProperty("challengeQuestion") - public ChallengeQuestionDTO getChallengeQuestion() { - return challengeQuestion; - } - public void setChallengeQuestion(ChallengeQuestionDTO challengeQuestion) { - this.challengeQuestion = challengeQuestion; - } - - - /** - * Answer to the challenge question. - **/ - @ApiModelProperty(required = true, value = "Answer to the challenge question.") - @JsonProperty("answer") - public String getAnswer() { - return answer; - } - public void setAnswer(String answer) { - this.answer = answer; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChallengeAnswerDTO {\n"); - - sb.append(" questionSetId: ").append(questionSetId).append("\n"); - sb.append(" challengeQuestion: ").append(challengeQuestion).append("\n"); - sb.append(" answer: ").append(answer).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeQuestionDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeQuestionDTO.java deleted file mode 100644 index dd75d9d68..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeQuestionDTO.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.dto; - - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - - - - - -@ApiModel(description = "") -public class ChallengeQuestionDTO { - - - - private String locale = null; - - @NotNull - private String question = null; - - - private String questionId = null; - - - /** - * The locale of the question. - **/ - @ApiModelProperty(value = "The locale of the question.") - @JsonProperty("locale") - public String getLocale() { - return locale; - } - public void setLocale(String locale) { - this.locale = locale; - } - - - /** - * Challenge question display value. - **/ - @ApiModelProperty(required = true, value = "Challenge question display value.") - @JsonProperty("question") - public String getQuestion() { - return question; - } - public void setQuestion(String question) { - this.question = question; - } - - - /** - * A unique ID for the challenge quesion within the set. - **/ - @ApiModelProperty(value = "A unique ID for the challenge quesion within the set.") - @JsonProperty("questionId") - public String getQuestionId() { - return questionId; - } - public void setQuestionId(String questionId) { - this.questionId = questionId; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChallengeQuestionDTO {\n"); - - sb.append(" locale: ").append(locale).append("\n"); - sb.append(" question: ").append(question).append("\n"); - sb.append(" questionId: ").append(questionId).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeQuestionPatchDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeQuestionPatchDTO.java deleted file mode 100644 index 4f8023be7..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeQuestionPatchDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.wso2.carbon.identity.rest.api.user.challenge.v1.dto; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeQuestionDTO; - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; - - - - - -@ApiModel(description = "") -public class ChallengeQuestionPatchDTO { - - - @NotNull - private ChallengeQuestionDTO challengeQuestion = null; - - @NotNull - private String operation = null; - - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("challengeQuestion") - public ChallengeQuestionDTO getChallengeQuestion() { - return challengeQuestion; - } - public void setChallengeQuestion(ChallengeQuestionDTO challengeQuestion) { - this.challengeQuestion = challengeQuestion; - } - - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("operation") - public String getOperation() { - return operation; - } - public void setOperation(String operation) { - this.operation = operation; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChallengeQuestionPatchDTO {\n"); - - sb.append(" challengeQuestion: ").append(challengeQuestion).append("\n"); - sb.append(" operation: ").append(operation).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeSetDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeSetDTO.java deleted file mode 100644 index 370d95ead..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ChallengeSetDTO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.dto; - -import java.util.ArrayList; -import java.util.List; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeQuestionDTO; - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - - - - - -@ApiModel(description = "") -public class ChallengeSetDTO { - - - - private String questionSetId = null; - - @NotNull - private List questions = new ArrayList(); - - - /** - * A unique ID for the challenge set. - **/ - @ApiModelProperty(value = "A unique ID for the challenge set.") - @JsonProperty("questionSetId") - public String getQuestionSetId() { - return questionSetId; - } - public void setQuestionSetId(String questionSetId) { - this.questionSetId = questionSetId; - } - - - /** - * Challenge questions for the set. - **/ - @ApiModelProperty(required = true, value = "Challenge questions for the set.") - @JsonProperty("questions") - public List getQuestions() { - return questions; - } - public void setQuestions(List questions) { - this.questions = questions; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChallengeSetDTO {\n"); - - sb.append(" questionSetId: ").append(questionSetId).append("\n"); - sb.append(" questions: ").append(questions).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ErrorDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ErrorDTO.java deleted file mode 100644 index f11173e40..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/ErrorDTO.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.dto; - - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - - - - - -@ApiModel(description = "") -public class ErrorDTO { - - - @NotNull - private String code = null; - - @NotNull - private String message = null; - - - private String description = null; - - - private String traceId = null; - - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("code") - public String getCode() { - return code; - } - public void setCode(String code) { - this.code = code; - } - - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("message") - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("description") - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("traceId") - public String getTraceId() { - return traceId; - } - public void setTraceId(String traceId) { - this.traceId = traceId; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorDTO {\n"); - - sb.append(" code: ").append(code).append("\n"); - sb.append(" message: ").append(message).append("\n"); - sb.append(" description: ").append(description).append("\n"); - sb.append(" traceId: ").append(traceId).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/UserChallengeAnswerDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/UserChallengeAnswerDTO.java deleted file mode 100644 index 874ec0578..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/UserChallengeAnswerDTO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.dto; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeQuestionDTO; - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - - - - - -@ApiModel(description = "") -public class UserChallengeAnswerDTO { - - - - private ChallengeQuestionDTO challengeQuestion = null; - - @NotNull - private String answer = null; - - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("challengeQuestion") - public ChallengeQuestionDTO getChallengeQuestion() { - return challengeQuestion; - } - public void setChallengeQuestion(ChallengeQuestionDTO challengeQuestion) { - this.challengeQuestion = challengeQuestion; - } - - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("answer") - public String getAnswer() { - return answer; - } - public void setAnswer(String answer) { - this.answer = answer; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserChallengeAnswerDTO {\n"); - - sb.append(" challengeQuestion: ").append(challengeQuestion).append("\n"); - sb.append(" answer: ").append(answer).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/UserChallengeAnswerResponseDTO.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/UserChallengeAnswerResponseDTO.java deleted file mode 100644 index 525f98d64..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/dto/UserChallengeAnswerResponseDTO.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.dto; - - -import io.swagger.annotations.*; -import com.fasterxml.jackson.annotation.*; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - - - - - -@ApiModel(description = "") -public class UserChallengeAnswerResponseDTO { - - - @NotNull - private String questionSetId = null; - - @NotNull - private String question = null; - - @NotNull - private String answer = null; - - - /** - * A unique ID to identify the challenge set. - **/ - @ApiModelProperty(required = true, value = "A unique ID to identify the challenge set.") - @JsonProperty("questionSetId") - public String getQuestionSetId() { - return questionSetId; - } - public void setQuestionSetId(String questionSetId) { - this.questionSetId = questionSetId; - } - - - /** - * Challenge question display value. - **/ - @ApiModelProperty(required = true, value = "Challenge question display value.") - @JsonProperty("question") - public String getQuestion() { - return question; - } - public void setQuestion(String question) { - this.question = question; - } - - - /** - * A hashed value of the challenge answer. - **/ - @ApiModelProperty(required = true, value = "A hashed value of the challenge answer.") - @JsonProperty("answer") - public String getAnswer() { - return answer; - } - public void setAnswer(String answer) { - this.answer = answer; - } - - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserChallengeAnswerResponseDTO {\n"); - - sb.append(" questionSetId: ").append(questionSetId).append("\n"); - sb.append(" question: ").append(question).append("\n"); - sb.append(" answer: ").append(answer).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/factories/MeApiServiceFactory.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/factories/MeApiServiceFactory.java deleted file mode 100644 index e67d15022..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/factories/MeApiServiceFactory.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.wso2.carbon.identity.rest.api.user.challenge.v1.factories; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.MeApiService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.impl.MeApiServiceImpl; - -public class MeApiServiceFactory { - - private final static MeApiService service = new MeApiServiceImpl(); - - public static MeApiService getMeApi() - { - return service; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/factories/UserIdApiServiceFactory.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/factories/UserIdApiServiceFactory.java deleted file mode 100644 index 04ea58355..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/gen/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/factories/UserIdApiServiceFactory.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.wso2.carbon.identity.rest.api.user.challenge.v1.factories; - -import org.wso2.carbon.identity.rest.api.user.challenge.v1.UserIdApiService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.impl.UserIdApiServiceImpl; - -public class UserIdApiServiceFactory { - - private final static UserIdApiService service = new UserIdApiServiceImpl(); - - public static UserIdApiService getUserIdApi() - { - return service; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/UserChallengeService.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/UserChallengeService.java deleted file mode 100644 index 003936bcc..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/UserChallengeService.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.core; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.identity.api.user.challenge.common.ChallengeQuestionServiceHolder; -import org.wso2.carbon.identity.api.user.challenge.common.Constant; -import org.wso2.carbon.identity.api.user.common.Constants; -import org.wso2.carbon.identity.api.user.common.error.APIError; -import org.wso2.carbon.identity.api.user.common.error.ErrorResponse; -import org.wso2.carbon.identity.application.common.model.User; -import org.wso2.carbon.identity.core.util.IdentityTenantUtil; -import org.wso2.carbon.identity.recovery.IdentityRecoveryClientException; -import org.wso2.carbon.identity.recovery.IdentityRecoveryException; -import org.wso2.carbon.identity.recovery.model.ChallengeQuestion; -import org.wso2.carbon.identity.recovery.model.UserChallengeAnswer; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.core.functions.ChallengeQuestionToExternal; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.core.functions.UserChallengeAnswerToExternal; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeQuestionDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeSetDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerResponseDTO; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import javax.ws.rs.core.Response; - -import static java.util.stream.Collectors.groupingBy; - -/** - * Call internal osgi services to perform user challenge related operations - */ -public class UserChallengeService { - - private static final Log log = LogFactory.getLog(UserChallengeService.class); - public static final String WSO2_CLAIM_DIALECT = "http://wso2.org/claims/"; - - /** - * Get challenges available for a specific user to answer - * - * @param user user - * @param offset limit - * @param limit offset - * @return list of available Challenges - */ - public List getChallengesForUser(User user, Integer offset, Integer limit) { - - try { - return buildChallengesDTO(ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .getAllChallengeQuestionsForUser(IdentityTenantUtil.resolveTenantDomain(), user), offset, limit); - } catch (IdentityRecoveryException e) { - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_CHALLENGES_FOR_USER); - } - - } - - /** - * Set user specified answers to a new challenge combination - * - * @param user user - * @param challengeAnswers user's answers for selected challenges - * @return operation success - */ - public boolean setChallengeAnswersOfUser(User user, List challengeAnswers) { - - List answers = buildChallengeAnswers(challengeAnswers); - try { - List answeredList = ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .getChallengeQuestionUris(user); - if (answeredList.size() > 0) { - throw handleError(Response.Status.CONFLICT, - Constant.ErrorMessage.ERROR_CODE_USER_ALREADY_ANSWERED_CHALLENGES); - } - ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .setChallengesOfUser(user, answers.toArray(new UserChallengeAnswer[answers.size()])); - } catch (IdentityRecoveryException e) { - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_SETTING_CHALLENGE_ANSWERS_OF_USER); - } - return true; - } - - /** - * Update user challenge answers with a new challenge combination - * - * @param user user - * @param newChallengeAnswers user's answers for selected challenges - * @return operation success - */ - public boolean updateChallengeAnswersOfUser(User user, List newChallengeAnswers) { - - List answers = buildChallengeAnswers(newChallengeAnswers); - try { - validateUserAnsweredChallenges(user); - ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .setChallengesOfUser(user, answers.toArray(new UserChallengeAnswer[answers.size()])); - - } catch (IdentityRecoveryException e) { - - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_UPDATING_CHALLENGE_ANSWERS_OF_USER); - } - return true; - } - - /** - * Update user challenge answer of a specific challenge set - * - * @param user user - * @param challengeSetId challenge set id - * @param challengeAnswer challenge answer - * @return operation success - */ - public boolean updateChallengeAnswerOfUser(User user, String challengeSetId, - UserChallengeAnswerDTO challengeAnswer) { - - try { - validateUserAnsweredChallenge(user, challengeSetId); - UserChallengeAnswer answer = new UserChallengeAnswer( - createChallengeQuestion(challengeSetId, challengeAnswer.getChallengeQuestion()), - challengeAnswer.getAnswer()); - ChallengeQuestionServiceHolder.getChallengeQuestionManager().setChallengeOfUser(user, answer); - } catch (IdentityRecoveryException e) { - - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_UPDATING_CHALLENGE_ANSWER_OF_USER); - } - return true; - } - - /** - * Add user challenge answer to a specific challenge - * - * @param user user - * @param challengeSetId challenge set id - * @param challengeAnswer challenge answer - * @return operation success - */ - public boolean addChallengeAnswerOfUser(User user, String challengeSetId, UserChallengeAnswerDTO challengeAnswer) { - - try { - List answeredList = ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .getChallengeQuestionUris(user); - if (!answeredList.isEmpty() && answeredList.contains(WSO2_CLAIM_DIALECT + challengeSetId)) { - throw handleError(Response.Status.CONFLICT, - Constant.ErrorMessage.ERROR_CODE_USER_ALREADY_ANSWERED_CHALLENGE); - } - UserChallengeAnswer answer = new UserChallengeAnswer( - createChallengeQuestion(challengeSetId, challengeAnswer.getChallengeQuestion()), - challengeAnswer.getAnswer()); - ChallengeQuestionServiceHolder.getChallengeQuestionManager().setChallengeOfUser(user, answer); - } catch (IdentityRecoveryException e) { - - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_SETTING_CHALLENGE_ANSWER_OF_USER); - } - return true; - } - - /** - * Get answered challenges of a user - * - * @param user user - * @return list of answered challenges - */ - public List getChallengeAnswersOfUser(User user) { - - try { - return getUserChallengeAnswerDTOsOfUser(user); - } catch (IdentityRecoveryException e) { - - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_CHALLENGE_ANSWERS_OF_USER); - } - } - - /** - * Remove answers of all the challenges that user has answered - * - * @param user user - * @return operation success - */ - public boolean removeChallengeAnswersOfUser(User user) { - - try { - validateUserAnsweredChallenges(user); - - ChallengeQuestionServiceHolder.getChallengeQuestionManager().removeChallengeAnswersOfUser(user); - } catch (IdentityRecoveryException e) { - - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_DELETING_CHALLENGE_ANSWERS_OF_USER); - } - return true; - } - - /** - * Remove answer of a specific challenge that user has answered - * - * @param user user - * @param challengeSetId challenge set id - * @return operation success - */ - public boolean removeChallengeAnswerOfUser(User user, String challengeSetId) { - try { - validateUserAnsweredChallenge(user, challengeSetId); - ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .removeChallengeAnswerOfUser(user, WSO2_CLAIM_DIALECT + challengeSetId); - } catch (IdentityRecoveryException e) { - - throw handleIdentityRecoveryException(e, - Constant.ErrorMessage.ERROR_CODE_ERROR_DELETING_CHALLENGE_ANSWER_OF_USER); - } - return true; - } - - /** - * Check whether user has answered any challenge - * - * @param user - * @throws IdentityRecoveryException - */ - private void validateUserAnsweredChallenges(User user) throws IdentityRecoveryException { - List answeredList = ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .getChallengeQuestionUris(user); - if (answeredList.size() < 1) { - throw handleError(Response.Status.NOT_FOUND, - Constant.ErrorMessage.ERROR_CODE_USER_HAS_NOT_ANSWERED_CHALLENGES); - } - } - - /** - * Check whether user has answered a specific challenge - * - * @param user - * @param challengeSetId - * @throws IdentityRecoveryException - */ - private void validateUserAnsweredChallenge(User user, String challengeSetId) throws IdentityRecoveryException { - List answeredList = ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .getChallengeQuestionUris(user); - if (answeredList.isEmpty() || !answeredList.contains(WSO2_CLAIM_DIALECT + challengeSetId)) { - throw handleError(Response.Status.NOT_FOUND, - Constant.ErrorMessage.ERROR_CODE_USER_HAS_NOT_ANSWERED_CHALLENGE); - } - } - - /** - * Retrieve user challenge answers and transform - * - * @param user - * @return - * @throws IdentityRecoveryException - */ - private List getUserChallengeAnswerDTOsOfUser(User user) - throws IdentityRecoveryException { - UserChallengeAnswer[] answers = ChallengeQuestionServiceHolder.getChallengeQuestionManager() - .getChallengeAnswersOfUser(user); - return Arrays.stream(answers).map(new UserChallengeAnswerToExternal()).collect(Collectors.toList()); - } - - /** - * Transform incoming ChallengeQuestionDTO to ChallengeQuestion to be sent for osgi service - * - * @param setId - * @param q - * @return - */ - private ChallengeQuestion createChallengeQuestion(String setId, ChallengeQuestionDTO q) { - return new ChallengeQuestion(WSO2_CLAIM_DIALECT + setId, q.getQuestionId(), q.getQuestion(), q.getLocale()); - } - - /** - * Transform ChallengeQuestion list to ChallengeSetDTO list - * - * @param challengeQuestions - * @param offset - * @param limit - * @return - */ - private List buildChallengesDTO(List challengeQuestions, Integer offset, - Integer limit) { - - Map> challengeSets = groupChallenges(challengeQuestions); - return challengeSets.entrySet().stream().map((e) -> getChallengeSetDTO(e.getKey(), e.getValue())) - .collect(Collectors.toList()); - } - - /** - * Build ChallengeSetDTO from ChallengeQuestion list - * - * @param questionSetId - * @param questions - * @return - */ - private ChallengeSetDTO getChallengeSetDTO(String questionSetId, List questions) { - ChallengeSetDTO challenge = new ChallengeSetDTO(); - challenge.setQuestionSetId(questionSetId); - List questionDTOs = questions.stream().map(new ChallengeQuestionToExternal()) - .collect(Collectors.toList()); - challenge.setQuestions(questionDTOs); - return challenge; - } - - /** - * build list of UserChallengeAnswer from a ChallengeAnswerDTO list - * - * @param challengeAnswer - * @return - */ - private List buildChallengeAnswers(List challengeAnswer) { - - return challengeAnswer.stream().map((q) -> new UserChallengeAnswer( - createChallengeQuestion(q.getQuestionSetId(), q.getChallengeQuestion()), q.getAnswer())) - .collect(Collectors.toList()); - } - - private Map> groupChallenges(List challengeQuestions) { - return challengeQuestions.stream() - .collect(groupingBy(question -> question.getQuestionSetId().split(WSO2_CLAIM_DIALECT)[1])); - } - - /** - * Handle IdentityRecoveryException, extract error code, error description and status code to be sent in the - * response - * - * @param e - * @param errorEnum - * @return - */ - private APIError handleIdentityRecoveryException(IdentityRecoveryException e, Constant.ErrorMessage errorEnum) { - ErrorResponse errorResponse = getErrorBuilder(errorEnum).build(log, e, errorEnum.getDescription()); - - Response.Status status; - - if (e instanceof IdentityRecoveryClientException) { - if (e.getErrorCode() != null) { - String errorCode = e.getErrorCode(); - errorCode = errorCode.contains(Constants.ERROR_CODE_DELIMITER) ? - errorCode : - Constant.CHALLENGE_QUESTION_PREFIX + errorCode; - errorResponse.setCode(errorCode); - } - errorResponse.setDescription(e.getMessage()); - status = Response.Status.BAD_REQUEST; - } else { - status = Response.Status.INTERNAL_SERVER_ERROR; - } - return new APIError(status, errorResponse); - } - - /** - * Handle User errors - * - * @param status - * @param error - * @return - */ - private APIError handleError(Response.Status status, Constant.ErrorMessage error) { - return new APIError(status, getErrorBuilder(error).build()); - } - - /** - * Get ErrorResponse Builder for Error enum - * - * @param errorEnum - * @return - */ - private ErrorResponse.Builder getErrorBuilder(Constant.ErrorMessage errorEnum) { - - return new ErrorResponse.Builder().withCode(errorEnum.getCode()).withMessage(errorEnum.getMessage()) - .withDescription(errorEnum.getDescription()); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/functions/ChallengeQuestionToExternal.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/functions/ChallengeQuestionToExternal.java deleted file mode 100644 index d5d5375f2..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/functions/ChallengeQuestionToExternal.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.core.functions; - -import org.wso2.carbon.identity.recovery.model.ChallengeQuestion; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeQuestionDTO; - -import java.util.function.Function; - -/** - * Transform internal ChallengeQuestion to external ChallengeQuestionDTO - */ -public class ChallengeQuestionToExternal implements Function { - - @Override - public ChallengeQuestionDTO apply(ChallengeQuestion challengeQuestion) { - - ChallengeQuestionDTO question = new ChallengeQuestionDTO(); - question.setLocale(challengeQuestion.getLocale()); - question.setQuestion(challengeQuestion.getQuestion()); - question.setQuestionId(challengeQuestion.getQuestionId()); - - return question; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/functions/UserChallengeAnswerToExternal.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/functions/UserChallengeAnswerToExternal.java deleted file mode 100644 index d008ed910..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/core/functions/UserChallengeAnswerToExternal.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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.challenge.v1.core.functions; - -import org.wso2.carbon.identity.recovery.model.UserChallengeAnswer; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerResponseDTO; - -import java.util.function.Function; - -import static org.wso2.carbon.identity.rest.api.user.challenge.v1.core.UserChallengeService.WSO2_CLAIM_DIALECT; - -/** - * Transform internal UserChallengeAnswer to external UserChallengeAnswerResponseDTO - */ -public class UserChallengeAnswerToExternal implements Function { - - @Override - public UserChallengeAnswerResponseDTO apply(UserChallengeAnswer userChallengeAnswer) { - UserChallengeAnswerResponseDTO userChallengeAnswerDTO = new UserChallengeAnswerResponseDTO(); - userChallengeAnswerDTO.setAnswer(userChallengeAnswer.getAnswer()); - userChallengeAnswerDTO.setQuestion(userChallengeAnswer.getQuestion().getQuestion()); - userChallengeAnswerDTO.setQuestionSetId(userChallengeAnswer.getQuestion().getQuestionSetId().split - (WSO2_CLAIM_DIALECT)[1]); - return userChallengeAnswerDTO; - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/impl/MeApiServiceImpl.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/impl/MeApiServiceImpl.java deleted file mode 100644 index ddf324df0..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/impl/MeApiServiceImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.wso2.carbon.identity.rest.api.user.challenge.v1.impl; - -import org.springframework.beans.factory.annotation.Autowired; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.MeApiService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.core.UserChallengeService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; - -import java.net.URI; -import java.util.List; -import javax.ws.rs.core.Response; - -import static org.wso2.carbon.identity.api.user.challenge.common.Constant.ME_CONTEXT; -import static org.wso2.carbon.identity.api.user.challenge.common.Constant.USER_CHALLENGE_ANSWERS_PATH_COMPONENT; -import static org.wso2.carbon.identity.api.user.challenge.common.Constant.V1_API_PATH_COMPONENT; -import static org.wso2.carbon.identity.api.user.common.ContextLoader.buildURIForHeader; -import static org.wso2.carbon.identity.api.user.common.ContextLoader.getUserFromContext; - -/** - * API service implementation for authenticated user's challenge operations - */ -public class MeApiServiceImpl extends MeApiService { - - @Autowired - private UserChallengeService challengeService; - - @Override - public Response addChallengeAnswerOfLoggedInUser(String challengeSetId, UserChallengeAnswerDTO - challengeAnswer) { - - challengeService.addChallengeAnswerOfUser(getUserFromContext(), challengeSetId, challengeAnswer); - return Response.created(getMeChallengeAnswersLocation()).build(); - } - - @Override - public Response addChallengeAnswersForLoggedInUser(List challengeAnswer) { - - challengeService.setChallengeAnswersOfUser(getUserFromContext(), challengeAnswer); - return Response.created(getMeChallengeAnswersLocation()).build(); - } - - @Override - public Response deleteChallengeAnswerOfLoggedInUser(String challengeSetId) { - - challengeService.removeChallengeAnswerOfUser(getUserFromContext(), challengeSetId); - return Response.noContent().build(); - } - - @Override - public Response deleteChallengeAnswersOfLoggedInUser() { - - challengeService.removeChallengeAnswersOfUser(getUserFromContext()); - return Response.noContent().build(); - } - - @Override - public Response getAnsweredChallengesOfLoggedInUser() { - - return Response.ok().entity(challengeService.getChallengeAnswersOfUser(getUserFromContext())).build(); - } - - @Override - public Response getChallengesForLoggedInUser(Integer offset, Integer limit) { - - return Response.ok().entity(challengeService.getChallengesForUser(getUserFromContext(), offset, limit)).build(); - } - - @Override - public Response updateChallengeAnswerOfLoggedInUser(String challengeSetId, UserChallengeAnswerDTO - challengeAnswer) { - - challengeService.updateChallengeAnswerOfUser(getUserFromContext(), challengeSetId, challengeAnswer); - return Response.ok().build(); - } - - @Override - public Response updateChallengeAnswersOfLoggedInUser(List challengeAnswers) { - - challengeService.updateChallengeAnswersOfUser(getUserFromContext(), challengeAnswers); - return Response.ok().build(); - } - - - private URI getMeChallengeAnswersLocation() { - return buildURIForHeader(String.format(V1_API_PATH_COMPONENT + USER_CHALLENGE_ANSWERS_PATH_COMPONENT, - ME_CONTEXT)); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/impl/UserIdApiServiceImpl.java b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/impl/UserIdApiServiceImpl.java deleted file mode 100644 index 82bdc7cfa..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/challenge/v1/impl/UserIdApiServiceImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. 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.challenge.v1.impl; - -import org.springframework.beans.factory.annotation.Autowired; -import org.wso2.carbon.identity.api.user.challenge.common.ChallengeQuestionServiceHolder; -import org.wso2.carbon.identity.api.user.common.function.UniqueIdToUser; -import org.wso2.carbon.identity.application.common.model.User; -import org.wso2.carbon.identity.core.util.IdentityTenantUtil; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.UserIdApiService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.core.UserChallengeService; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.ChallengeAnswerDTO; -import org.wso2.carbon.identity.rest.api.user.challenge.v1.dto.UserChallengeAnswerDTO; - -import java.net.URI; -import java.util.List; -import javax.ws.rs.core.Response; - -import static org.wso2.carbon.identity.api.user.challenge.common.Constant.USER_CHALLENGE_ANSWERS_PATH_COMPONENT; -import static org.wso2.carbon.identity.api.user.challenge.common.Constant.V1_API_PATH_COMPONENT; -import static org.wso2.carbon.identity.api.user.common.ContextLoader.buildURIForHeader; - -/** - * API service implementation of a specific user's challenge operations - */ -public class UserIdApiServiceImpl extends UserIdApiService { - - @Autowired - private UserChallengeService challengeService; - - @Override - public Response addChallengeAnswerOfAUser(String challengeSetId, String userId, - UserChallengeAnswerDTO challengeAnswer) { - - challengeService.addChallengeAnswerOfUser(getUser(userId), challengeSetId, challengeAnswer); - return Response.created(getUserChallengeAnswersLocation(userId)).build(); - } - - @Override - public Response addChallengeAnswersOfAUser(String userId, List challengeAnswer) { - - challengeService.setChallengeAnswersOfUser(getUser(userId), challengeAnswer); - return Response.created(getUserChallengeAnswersLocation(userId)).build(); - } - - @Override - public Response deleteChallengeAnswerOfAUser(String challengeSetId, String userId) { - - challengeService.removeChallengeAnswerOfUser(getUser(userId), challengeSetId); - return Response.noContent().build(); - } - - @Override - public Response deleteChallengeAnswersOfAUser(String userId) { - - challengeService.removeChallengeAnswersOfUser(getUser(userId)); - return Response.noContent().build(); - } - - @Override - public Response getAnsweredChallengesOfAUser(String userId) { - - return Response.ok().entity(challengeService.getChallengeAnswersOfUser(getUser(userId))).build(); - } - - @Override - public Response getChallengesForAUser(String userId, Integer offset, Integer limit) { - - return Response.ok().entity(challengeService.getChallengesForUser(getUser(userId), offset, limit)).build(); - } - - @Override - public Response updateChallengeAnswerOfAUser(String challengeSetId, String userId, - UserChallengeAnswerDTO challengeAnswer) { - - challengeService.updateChallengeAnswerOfUser(getUser(userId), challengeSetId, challengeAnswer); - return Response.ok().build(); - } - - @Override - public Response updateChallengeAnswersOfAUser(String userId, List challengeAnswers) { - - challengeService.updateChallengeAnswersOfUser(getUser(userId), challengeAnswers); - return Response.ok().build(); - } - - private URI getUserChallengeAnswersLocation(String userId) { - - return buildURIForHeader(String.format(V1_API_PATH_COMPONENT + USER_CHALLENGE_ANSWERS_PATH_COMPONENT, userId)); - } - - private User getUser(String userId) { - - return new UniqueIdToUser().apply(ChallengeQuestionServiceHolder.getRealmService(), userId, - IdentityTenantUtil.resolveTenantDomain()); - } -} diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/resources/META-INF/cxf/user-challenge-v1-cxf.xml b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/resources/META-INF/cxf/user-challenge-v1-cxf.xml deleted file mode 100644 index 7b75d15c4..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/resources/META-INF/cxf/user-challenge-v1-cxf.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - diff --git a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/resources/challenge.yaml b/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/resources/challenge.yaml deleted file mode 100644 index e5f73eae8..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/org.wso2.carbon.identity.rest.api.user.challenge.v1/src/main/resources/challenge.yaml +++ /dev/null @@ -1,722 +0,0 @@ -swagger: '2.0' -info: - description: This is the RESTful API for managing challenge questions and answers of a user in WSO2 Identity Server - version: "v1" - title: WSO2 Identity Server - User's Challenge Questions and Answers API Definition. - contact: - name: "WSO2 Identity Server" - url: "https://wso2.com/identity-and-access-management/" - email: "architecture@wso2.com" - license: - name: Apache 2.0 - url: 'http://www.apache.org/licenses/LICENSE-2.0.html' - -schemes: - - https - -# Tags are used for organizing operations -tags: -- name: me - description: Operations for the authenticated user. -- name: admin - description: > - Operations available for privileged users, to be invoked on behalf of another user. - - **These endpoints are not released in WSO2 Identity Server - 5.9.0 version and will be released in the next product version.** - -# Applicable authentication mechanisms -security: - - OAuth2: [] - - BasicAuth: [] - -paths: - /me/challenges: - get: - tags: - - me - summary: Retrieve challenges available for the authenticated user. - operationId: getChallengesForLoggedInUser - description: | - Retrieves the available challenges in the system for the authenticated user. In the response challenge questions are grouped as **challenge set**s. - - Permission required: - * None - Scope required: - * internal_login - parameters: - - $ref: '#/parameters/limitQueryParam' - - $ref: '#/parameters/offsetQueryParam' - responses: - 200: - description: All the available challenges in the system that can be answered by the user. - schema: - type: array - items: - $ref: '#/definitions/ChallengeSet' - 400: - $ref: '#/responses/InvalidInput' - 403: - $ref: '#/responses/Forbidden' - 401: - $ref: '#/responses/Unauthorized' - 500: - $ref: '#/responses/ServerError' - /me/challenge-answers: - post: - tags: - - me - summary: Answer to a collection of new challenges. - operationId: addChallengeAnswersForLoggedInUser - description: | - Provide answer(s) to one or more candidate challenge question set(s) available in the system for the authenticated user. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **set(s)**. - - Permission required: - * None - Scope required: - * internal_login - parameters: - - in: body - name: challengeAnswer - description: One or more challenge(s) with the answer. - schema: - type: array - items: - $ref: '#/definitions/ChallengeAnswer' - responses: - 201: - $ref: '#/responses/Created' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 409: - $ref: '#/responses/Conflict' - 500: - $ref: '#/responses/ServerError' - get: - tags: - - me - summary: Get user's answered challenges. - operationId: getAnsweredChallengesOfLoggedInUser - description: > - Get previously answered challenge(s) in the system by the authenticated user. - - Permission required: - * None - Scope required: - * internal_login - responses: - 200: - description: Array of Challenge(s) that are already answered by the authenticated user. - schema: - type: array - items: - $ref: '#/definitions/UserChallengeAnswerResponse' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 500: - $ref: '#/responses/ServerError' - put: - tags: - - me - summary: Answer new challenge question combination over existing answers. - operationId: updateChallengeAnswersOfLoggedInUser - description: | - Overrides the *already answered challenges* in the system with a set of *new challenge question answers* for logged In user. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **sets**. - - Permission required: - * None - Scope required: - * internal_login - parameters: - - in: body - name: challengeAnswers - description: Set of challenges with answer. - schema: - type: array - items: - $ref: '#/definitions/ChallengeAnswer' - responses: - 200: - $ref: '#/responses/OK' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - delete: - tags: - - me - summary: Remove challenge question answers. - operationId: deleteChallengeAnswersOfLoggedInUser - description: | - Removes all the existing challenge answers of the authenticated user. - - Permission required: - * None - Scope required: - * internal_login - responses: - 204: - $ref: '#/responses/NoContent' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - /me/challenge-answers/{challenge-set-id}: - post: - tags: - - me - summary: Answers a specific new challenge. - operationId: addChallengeAnswerOfLoggedInUser - description: | - Provide an **answer** to **a specific challenge** in the system for logged-in user. The user can at most select one question from a challenge set of interest. - - Permission required: - * None - Scope required: - * internal_login - parameters: - - $ref: '#/parameters/questionSetIdPathParam' - - in: body - name: challengeAnswer - description: The answer to the challenge along with the question. - schema: - $ref: '#/definitions/UserChallengeAnswer' - responses: - 201: - $ref: '#/responses/Created' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 409: - $ref: '#/responses/Conflict' - 500: - $ref: '#/responses/ServerError' - put: - tags: - - me - summary: Update challenge answer of an already answered challenge. - operationId: updateChallengeAnswerOfLoggedInUser - description: | - Update challenge answer in a specific challenge for authenticated user. - - Permission required: - * None - Scope required: - * internal_login - parameters: - - $ref: '#/parameters/questionSetIdPathParam' - - in: body - name: challenge-answer - description: The challenge answer with the challenge-question. - schema: - $ref: '#/definitions/UserChallengeAnswer' - responses: - 200: - $ref: '#/responses/OK' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - delete: - tags: - - me - summary: Remove a challenge question answer. - operationId: deleteChallengeAnswerOfLoggedInUser - description: | - Removes existing answer provided by the authenticated user to a specific challenge. - - Permission required: - * None - Scope required: - * internal_login - parameters: - - $ref: '#/parameters/questionSetIdPathParam' - responses: - 204: - $ref: '#/responses/NoContent' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - /{user-id}/challenges: - get: - tags: - - admin - summary: Retrieve challenges available for a user identified by the user-id. - operationId: getChallengesForAUser - description: | - Retrieves the available challenges in the system for the specified user. In the response challenge questions are grouped as **challenge set**s. - - Permission required: - * /permission/admin/manage/identity/identitymgt/view - Scope required: - * internal_identity_mgt_view - parameters: - - $ref: '#/parameters/usernamePathParams' - - $ref: '#/parameters/limitQueryParam' - - $ref: '#/parameters/offsetQueryParam' - responses: - 200: - description: > - All the available challenges in the system that can be answered by the user. - schema: - type: array - items: - $ref: '#/definitions/ChallengeSet' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - /{user-id}/challenge-answers: - post: - tags: - - admin - summary: Answer to a collection of new challenges. - operationId: addChallengeAnswersOfAUser - description: > - Provide answer(s) to one or more candidate challenge question set(s) available in the system for the user identified by user-id. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **set(s)**. - - Permission required: - * /permission/admin/manage/identity/identitymgt/create - Scope required: - * internal_identity_mgt_create - parameters: - - $ref: '#/parameters/usernamePathParams' - - in: body - name: challenge-answer - description: One or more challenge(s) with the answer. - schema: - type: array - items: - $ref: '#/definitions/ChallengeAnswer' - responses: - 201: - $ref: '#/responses/Created' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 409: - $ref: '#/responses/Conflict' - 500: - $ref: '#/responses/ServerError' - get: - tags: - - admin - summary: Get user's answered challenges. - operationId: getAnsweredChallengesOfAUser - description: | - Get previously answered challenge(s) in the system by the user idenrified by user-id. - - Permission required: - * /permission/admin/manage/identity/identitymgt/view - Scope required: - * internal_identity_mgt_view - parameters: - - $ref: '#/parameters/usernamePathParams' - - responses: - 200: - description: Array of Challenge(s) that are already answered by the authenticated user. - schema: - type: array - items: - $ref: '#/definitions/UserChallengeAnswerResponse' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - put: - tags: - - admin - summary: Answer new challenge question combination over existing answers. - operationId: updateChallengeAnswersOfAUser - description: | - Overrides the *already answered challenges* in the system with a set of *new challenge question answers* for the user identified by user-id. A user can pick at maximum one question from each set to answer. A user may answer **one or more distinct** challenge question **sets**. - - Permission required: - * /permission/admin/manage/identity/identitymgt/update - Scope required: - * internal_identity_mgt_update - parameters: - - $ref: '#/parameters/usernamePathParams' - - in: body - name: challengeAnswers - description: Set of challenges with answer. - schema: - type: array - items: - $ref: '#/definitions/ChallengeAnswer' - responses: - 200: - $ref: '#/responses/OK' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - delete: - tags: - - admin - summary: Remove challenge question answers. - operationId: deleteChallengeAnswersOfAUser - description: | - Removes all the existing challenge answers of the user identified by user-id. - - Permission required: - * /permission/admin/manage/identity/identitymgt/delete - Scope required: - * internal_identity_mgt_delete - parameters: - - $ref: '#/parameters/usernamePathParams' - responses: - 204: - $ref: '#/responses/NoContent' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - /{user-id}/challenge-answers/{challenge-set-id}: - post: - tags: - - admin - summary: Answers a specific new challenge. - operationId: addChallengeAnswerOfAUser - description: | - Provide an **answer** to **a specific challenge** in the system for the user identified by user-id. The user can at most select one question from a challenge set of interest. - - Permission required: - * /permission/admin/manage/identity/identitymgt/create - Scope required: - * internal_identity_mgt_create - parameters: - - $ref: '#/parameters/questionSetIdPathParam' - - $ref: '#/parameters/usernamePathParams' - - in: body - name: challengeAnswer - description: The answer to the challenge along with the question. - schema: - $ref: '#/definitions/UserChallengeAnswer' - responses: - 201: - $ref: '#/responses/Created' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 409: - $ref: '#/responses/Conflict' - 500: - $ref: '#/responses/ServerError' - put: - tags: - - admin - summary: Update challenge answer of an already answered challenge. - operationId: updateChallengeAnswerOfAUser - description: | - Update challenge answer in a specific challenge for authenticated user. - - Permission required: - * /permission/admin/manage/identity/identitymgt/update - Scope required: - * internal_identity_mgt_update - parameters: - - $ref: '#/parameters/questionSetIdPathParam' - - $ref: '#/parameters/usernamePathParams' - - in: body - name: challengeAnswer - description: The challenge answer with the challenge-question. - schema: - $ref: '#/definitions/UserChallengeAnswer' - responses: - 200: - $ref: '#/responses/OK' - 400: - $ref: '#/responses/InvalidInput' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' - delete: - tags: - - admin - summary: Remove a challenge question answer. - operationId: deleteChallengeAnswerOfAUser - description: | - Removes existing answer provided by the user(identified by user-id) to a specific challenge. - - Permission required: - * /permission/admin/manage/identity/identitymgt/delete - Scope required: - * internal_identity_mgt_delete - parameters: - - $ref: '#/parameters/questionSetIdPathParam' - - $ref: '#/parameters/usernamePathParams' - responses: - 204: - $ref: '#/responses/NoContent' - 401: - $ref: '#/responses/Unauthorized' - 403: - $ref: '#/responses/Forbidden' - 404: - $ref: '#/responses/NotFound' - 500: - $ref: '#/responses/ServerError' -parameters: - usernamePathParams: - in: path - name: user-id - required: true - type: string - description: Uniquely identifiable user ID - questionSetIdPathParam: - in: path - name: challenge-set-id - required: true - type: string - description: Challenge Question Set ID - questionIdPathParam: - in: path - name: question-id - required: true - type: string - description: Challenge Question ID - localeQueryParam: - in: query - name: locale - description: An optional search string for looking up challenge-questions based on locale - required: false - type: string - offsetQueryParam: - in: query - name: offset - description: Number of records to skip for pagination. _*This filtering is not yet supported._ - type: integer - format: int32 - minimum: 0 - limitQueryParam: - in: query - name: limit - description: Maximum number of records to return. _*This filtering is not yet supported._ - type: integer - format: int32 - minimum: 0 -definitions: - #----------------------------------------------------- - # ChallengeSet Properties object - #----------------------------------------------------- - ChallengeSet: - type: object - required: - - challengeSetId - - questions - properties: - questionSetId: - type: string - example: challengeQuestion1 - description: A unique ID for the challenge set. - questions: - type: array - description: Challenge questions for the set. - items: - $ref: '#/definitions/ChallengeQuestion' - #----------------------------------------------------- - # ChallengeQuestion Properties object - #----------------------------------------------------- - ChallengeQuestion: - type: object - required: - - question - properties: - locale: - type: string - example: en_US - description: The locale of the question. - question: - type: string - example: Favorite vacation location ? - description: Challenge question display value. - questionId: - type: string - example: question1 - description: A unique ID for the challenge quesion within the set. - #----------------------------------------------------- - # ChallengeAnswer Properties object - #----------------------------------------------------- - ChallengeAnswer: - type: object - required: - - answer - - challenge - properties: - questionSetId: - type: string - example: challengeQuestion1 - description: A unique ID to identify the challenge set. - challengeQuestion: - $ref: '#/definitions/ChallengeQuestion' - description: A challenge question that is selected to answer from the set. - answer: - type: string - example: Colombo - description: Answer to the challenge question. - #----------------------------------------------------- - # UserChallengeAnswer Properties object - #----------------------------------------------------- - UserChallengeAnswer: - type: object - required: - - answer - - challenge - properties: - challengeQuestion: - $ref: '#/definitions/ChallengeQuestion' - answer: - type: string - example: Colombo - #----------------------------------------------------- - # UserChallengeAnswerResponse Properties object - #----------------------------------------------------- - UserChallengeAnswerResponse: - type: object - required: - - answer - - questionSetId - - question - properties: - questionSetId: - type: string - example: challengeQuestion1 - description: A unique ID to identify the challenge set. - question: - type: string - example: Favorite vacation location ? - description: Challenge question display value. - answer: - type: string - example: Ro83J+wm/zkUt2/6GDf+xZD8s/2pjPqTUhrkOrwGBb4= - description: A hashed value of the challenge answer. - #----------------------------------------------------- - # The Error Response object - #----------------------------------------------------- - Error: - type: object - required: - - code - - message - properties: - code: - type: string - example: "some_error_code" - message: - type: string - example: "Some Error Message" - description: - type: string - example: "Some Error Description" - traceId: - type: string - example: "Some Correlation for Error Instance" -securityDefinitions: - BasicAuth: - type: basic - OAuth2: - type: oauth2 - flow: accessCode - authorizationUrl: https://localhost:9443/oauth2/authorize - tokenUrl: https://localhost:9443/oauth2/token -#----------------------------------------------------- -# Descriptions of common responses -#----------------------------------------------------- -responses: - NotFound: - description: The specified resource is not found - schema: - $ref: '#/definitions/Error' - Unauthorized: - description: Unauthorized - ServerError: - description: Internal Server Error - schema: - $ref: '#/definitions/Error' - InvalidInput: - description: Invalid input request - schema: - $ref: '#/definitions/Error' - Conflict: - description: Element Already Exists - schema: - $ref: '#/definitions/Error' - Created: - description: Item Created - OK: - description: OK - NoContent: - description: No Content - Forbidden: - description: Resource Forbidden - -host: localhost:9443 -basePath: /t/{tenant-domain}/api/users/v1 diff --git a/components/org.wso2.carbon.identity.api.user.challenge/pom.xml b/components/org.wso2.carbon.identity.api.user.challenge/pom.xml deleted file mode 100644 index e1831282c..000000000 --- a/components/org.wso2.carbon.identity.api.user.challenge/pom.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - identity-api-user - org.wso2.carbon.identity.user.api - 1.3.25-SNAPSHOT - ../../pom.xml - - 4.0.0 - - org.wso2.carbon.identity.user.api - org.wso2.carbon.identity.api.user.challenge - pom - - org.wso2.carbon.identity.api.user.challenge.common - org.wso2.carbon.identity.rest.api.user.challenge.v1 - - - diff --git a/pom.xml b/pom.xml index 66bb4b7c3..e3cafbe12 100644 --- a/pom.xml +++ b/pom.xml @@ -442,7 +442,6 @@ components/org.wso2.carbon.identity.api.user.common components/org.wso2.carbon.identity.api.user.association - components/org.wso2.carbon.identity.api.user.challenge components/org.wso2.carbon.identity.api.user.authorized.apps components/org.wso2.carbon.identity.api.user.approval components/org.wso2.carbon.identity.api.user.session