Skip to content

Commit

Permalink
Revert "API changes for claim management"
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-ariyaratne authored Nov 12, 2024
1 parent a40317f commit 618bfb2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -44,9 +42,6 @@ public class ExternalClaimResDTO extends ClaimResDTO {
@Valid
private String mappedLocalClaimURI = null;

@Valid
private List<PropertyDTO> properties = new ArrayList<PropertyDTO>();

/**
* External claim ID.
**/
Expand Down Expand Up @@ -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<PropertyDTO> getProperties() {
return properties;
}
public void setProperties(List<PropertyDTO> properties) {
this.properties = properties;
}

@Override
public String toString() {

Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ public class ServerClaimManagementService {
ClaimConstants.ErrorMessage.ERROR_CODE_EXISTING_LOCAL_CLAIM_URI.getCode()
);

private static final List<String> 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.
*
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>
<org.apache.felix.annotations.version>1.2.4</org.apache.felix.annotations.version>
<identity.governance.version>1.11.11</identity.governance.version>
<carbon.identity.framework.version>7.6.4</carbon.identity.framework.version>
<carbon.identity.framework.version>7.5.117</carbon.identity.framework.version>
<maven.findbugsplugin.version>3.0.5</maven.findbugsplugin.version>
<findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
<maven.checkstyleplugin.excludes>**/gen/**/*</maven.checkstyleplugin.excludes>
Expand Down

0 comments on commit 618bfb2

Please sign in to comment.