From 618bfb20da849772afb46acb5b16a5f968d21787 Mon Sep 17 00:00:00 2001 From: Amanda Ariyaratne Date: Tue, 12 Nov 2024 18:04:02 +0530 Subject: [PATCH] Revert "API changes for claim management" --- .../management/v1/dto/ExternalClaimResDTO.java | 18 ------------------ .../v1/core/ServerClaimManagementService.java | 15 --------------- .../src/main/resources/claim-management.yaml | 5 ----- pom.xml | 2 +- 4 files changed, 1 insertion(+), 39 deletions(-) diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/dto/ExternalClaimResDTO.java b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/dto/ExternalClaimResDTO.java index c9436ef1b5..8c4cd0d886 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/dto/ExternalClaimResDTO.java +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/dto/ExternalClaimResDTO.java @@ -23,8 +23,6 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; -import java.util.ArrayList; -import java.util.List; /** * External claim response. @@ -44,9 +42,6 @@ public class ExternalClaimResDTO extends ClaimResDTO { @Valid private String mappedLocalClaimURI = null; - @Valid - private List properties = new ArrayList(); - /** * External claim ID. **/ @@ -95,18 +90,6 @@ public void setMappedLocalClaimURI(String mappedLocalClaimURI) { this.mappedLocalClaimURI = mappedLocalClaimURI; } - /** - * Define any additional properties if required. - **/ - @ApiModelProperty(value = "Define any additional properties if required.") - @JsonProperty("properties") - public List getProperties() { - return properties; - } - public void setProperties(List properties) { - this.properties = properties; - } - @Override public String toString() { @@ -118,7 +101,6 @@ public String toString() { sb.append(" claimURI: ").append(claimURI).append("\n"); sb.append(" claimDialectURI: ").append(claimDialectURI).append("\n"); sb.append(" mappedLocalClaimURI: ").append(mappedLocalClaimURI).append("\n"); - sb.append(" properties: ").append(properties).append("\n"); sb.append("}\n"); return sb.toString(); diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java index 1afbe00801..4146a2dcdb 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java @@ -159,12 +159,6 @@ public class ServerClaimManagementService { ClaimConstants.ErrorMessage.ERROR_CODE_EXISTING_LOCAL_CLAIM_URI.getCode() ); - private static final List forbiddenErrorScenarios = Arrays.asList( - ClaimConstants.ErrorMessage.ERROR_CODE_NO_RENAME_SYSTEM_DIALECT.getCode(), - ClaimConstants.ErrorMessage.ERROR_CODE_NO_DELETE_SYSTEM_DIALECT.getCode(), - ClaimConstants.ErrorMessage.ERROR_CODE_NO_DELETE_SYSTEM_CLAIM.getCode() - ); - /** * Add a claim dialect. * @@ -950,7 +944,6 @@ private ExternalClaimResDTO getExternalClaimResDTO(ExternalClaim externalClaim) externalClaimResDTO.setClaimDialectURI(externalClaim.getClaimDialectURI()); externalClaimResDTO.setClaimURI(externalClaim.getClaimURI()); externalClaimResDTO.setMappedLocalClaimURI(externalClaim.getMappedLocalClaim()); - externalClaimResDTO.setProperties(mapToProperties(externalClaim.getClaimProperties())); return externalClaimResDTO; } @@ -1272,9 +1265,6 @@ private APIError handleClaimManagementException(ClaimMetadataException e, Consta if (isConflictScenario(e.getErrorCode())) { status = CONFLICT; } - if (isForbiddenScenario(e.getErrorCode())) { - status = FORBIDDEN; - } if (StringUtils.isNotBlank(e.getErrorCode()) && e.getErrorCode().contains(Constant.CLAIM_MANAGEMENT_PREFIX)) { return handleClaimManagementClientError(e.getErrorCode(), e.getMessage(), status, data); @@ -1297,11 +1287,6 @@ private boolean isConflictScenario(String errorCode) { return !StringUtils.isBlank(errorCode) && conflictErrorScenarios.contains(errorCode); } - private boolean isForbiddenScenario(String errorCode) { - - return !StringUtils.isBlank(errorCode) && forbiddenErrorScenarios.contains(errorCode); - } - private APIError handleClaimManagementClientError(Constant.ErrorMessage errorEnum, Response.Status status) { return handleClaimManagementClientError(errorEnum, status, StringUtils.EMPTY); diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/resources/claim-management.yaml b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/resources/claim-management.yaml index 6231037ef2..c788734b40 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/resources/claim-management.yaml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/src/main/resources/claim-management.yaml @@ -910,11 +910,6 @@ definitions: type: string description: The local claim URI to map with the external claim. example: "http://wso2.org/claims/username" - properties: - type: array - description: Define any additional properties if required. - items: - $ref: '#/definitions/Property' #----------------------------------------------------- # Property Object diff --git a/pom.xml b/pom.xml index fae8afba11..d2ab690d21 100644 --- a/pom.xml +++ b/pom.xml @@ -809,7 +809,7 @@ 1.4 1.2.4 1.11.11 - 7.6.4 + 7.5.117 3.0.5 1.12.0 **/gen/**/*