use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project carbon-identity-framework by wso2.
the class ConfigurationEndpointUtils method getResourceLinkList.
private static List<LinkDTO> getResourceLinkList(String resourceType, List<Resource> resources) {
List<LinkDTO> linkDTOList = new ArrayList<>();
for (Resource resource : resources) {
LinkDTO linkDTO = new LinkDTO();
linkDTO.setHref(getResourceURI(resourceType, resource));
linkDTO.setRel("resource");
linkDTOList.add(linkDTO);
}
return linkDTOList;
}
use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project carbon-identity-framework by wso2.
the class ConfigurationEndpointUtils method geFileLinkDTOList.
private static List<LinkDTO> geFileLinkDTOList(Resource resource) {
LinkDTO linkDTO = new LinkDTO();
List<LinkDTO> linkDTOList = new ArrayList<>();
linkDTO.setRel(FILE);
linkDTO.setHref(getFileURI(resource.getResourceName(), resource.getResourceType()));
linkDTOList.add(linkDTO);
return linkDTOList;
}
use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project identity-api-server by wso2.
the class ServerClaimManagementService method getClaimDialectResDTO.
private ClaimDialectResDTO getClaimDialectResDTO(ClaimDialect claimDialect) {
ClaimDialectResDTO claimDialectResDTO = new ClaimDialectResDTO();
String dialectId;
if (StringUtils.equals(claimDialect.getClaimDialectURI(), LOCAL_DIALECT)) {
dialectId = LOCAL_DIALECT_PATH;
} else {
dialectId = base64EncodeId(claimDialect.getClaimDialectURI());
}
claimDialectResDTO.setId(dialectId);
claimDialectResDTO.setDialectURI(claimDialect.getClaimDialectURI());
LinkDTO linkDTO = new LinkDTO();
linkDTO.setRel(REL_CLAIMS);
linkDTO.setHref(buildURIForBody(String.format(V1_API_PATH_COMPONENT + CMT_PATH_COMPONENT + "/%s/claims", dialectId)).toString());
claimDialectResDTO.setLink(linkDTO);
return claimDialectResDTO;
}
use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project identity-governance by wso2-extensions.
the class RecoveryUtil method getInitiateQuestionResponseDTO.
public static InitiateAllQuestionResponseDTO getInitiateQuestionResponseDTO(ChallengeQuestionsResponse challengeQuestionsResponse) {
InitiateAllQuestionResponseDTO initiateAllQuestionResponseDTO = new InitiateAllQuestionResponseDTO();
List<QuestionDTO> questionDTOs = new ArrayList<>();
for (ChallengeQuestion challengeQuestion : challengeQuestionsResponse.getQuestion()) {
QuestionDTO questionDTO = new QuestionDTO();
questionDTO.setQuestion(challengeQuestion.getQuestion());
questionDTO.setQuestionSetId(challengeQuestion.getQuestionSetId());
questionDTOs.add(questionDTO);
}
initiateAllQuestionResponseDTO.setQuestions(questionDTOs);
initiateAllQuestionResponseDTO.setKey(challengeQuestionsResponse.getCode());
LinkDTO linkDTO = new LinkDTO();
linkDTO.setRel("validate-answer");
linkDTO.setUri("/api/identity/recovery/v0.9");
initiateAllQuestionResponseDTO.setLink(linkDTO);
return initiateAllQuestionResponseDTO;
}
use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project identity-governance by wso2-extensions.
the class RecoveryUtil method getInitiateQuestionResponseDTO.
public static InitiateQuestionResponseDTO getInitiateQuestionResponseDTO(ChallengeQuestionResponse challengeQuestionResponse) {
InitiateQuestionResponseDTO initiateQuestionResponseDTO = new InitiateQuestionResponseDTO();
QuestionDTO questionDTO = new QuestionDTO();
if (challengeQuestionResponse.getQuestion() != null) {
questionDTO.setQuestion(challengeQuestionResponse.getQuestion().getQuestion());
questionDTO.setQuestionSetId(challengeQuestionResponse.getQuestion().getQuestionSetId());
initiateQuestionResponseDTO.setQuestion(questionDTO);
}
initiateQuestionResponseDTO.setKey(challengeQuestionResponse.getCode());
LinkDTO linkDTO = new LinkDTO();
if (IdentityRecoveryConstants.RECOVERY_STATUS_COMPLETE.equals(challengeQuestionResponse.getStatus())) {
linkDTO.setRel("set-password");
linkDTO.setUri("/api/identity/recovery/v0.9");
} else {
linkDTO.setRel("validate-answer");
linkDTO.setUri("/api/identity/recovery/v0.9");
}
initiateQuestionResponseDTO.setLink(linkDTO);
return initiateQuestionResponseDTO;
}
Aggregations