Skip to content

Commit

Permalink
add properties for external claims
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-ariyaratne committed Oct 31, 2024
1 parent 447d195 commit 0e180df
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
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 @@ -42,6 +44,9 @@ 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 @@ -90,6 +95,18 @@ 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 @@ -101,6 +118,7 @@ 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 @@ -944,6 +944,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,11 @@ 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

0 comments on commit 0e180df

Please sign in to comment.