Skip to content

Commit

Permalink
Merge branch 'master' into DP-add-b2b-template-inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaura authored Dec 10, 2024
2 parents 8d58573 + 35b7380 commit 9d9dbb2
Show file tree
Hide file tree
Showing 105 changed files with 194 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.expired.password.identification</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.expired.password.identification</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.idle.account.identification</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.idle.account.identification</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.action.management</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.action.management</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>identity-api-server</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>org.wso2.carbon.identity.api.server.admin.advisory.management</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>org.wso2.carbon.identity.api.server.admin.advisory.management</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.api.resource</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.api.resource</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.application.management</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>org.wso2.carbon.identity.api.server.application.management.common</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.application.management</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>WSO2 Identity Server - Applications Rest API</name>
<description>WSO2 Identity Server - Applications Rest API</description>
<artifactId>org.wso2.carbon.identity.api.server.application.management.v1</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>org.wso2.carbon.identity.api.server.application.management</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.authenticators</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>

<artifactId>org.wso2.carbon.identity.api.server.authenticators.common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.authenticators</artifactId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>

<artifactId>org.wso2.carbon.identity.api.server.authenticators.v1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.branding.preference.management</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>

<groupId>org.wso2.carbon.identity.server.api</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<artifactId>org.wso2.carbon.identity.api.server.branding.preference.management</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<relativePath>../pom.xml</relativePath>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>org.wso2.carbon.identity.api.server.claim.management</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<relativePath>../pom.xml</relativePath>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.api.server.claim.management.common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,5 @@ public String toString() {
public static final String PROP_REG_EX = "RegEx";
public static final String PROP_REQUIRED = "Required";
public static final String PROP_SUPPORTED_BY_DEFAULT = "SupportedByDefault";
public static final String PROP_UNIQUENESS_SCOPE = "UniquenessScope";
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.claim.management</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.7-SNAPSHOT</version>
<version>1.3.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.rest.api.server.claim.management.v1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public class LocalClaimReqDTO {
@Valid
private Boolean supportedByDefault = null;

public enum UniquenessScopeEnum {
NONE, WITHIN_USERSTORE, ACROSS_USERSTORES,
};
@Valid
private UniquenessScopeEnum uniquenessScope = null;

@Valid
@NotNull(message = "Property attributeMapping cannot be null.")
private List<AttributeMappingDTO> attributeMapping = new ArrayList<AttributeMappingDTO>();
Expand Down Expand Up @@ -163,6 +169,18 @@ public void setSupportedByDefault(Boolean supportedByDefault) {
this.supportedByDefault = supportedByDefault;
}

/**
* Specifies the scope of uniqueness validation for the claim value.
**/
@ApiModelProperty(value = "Specifies the scope of uniqueness validation for the claim value.")
@JsonProperty("uniquenessScope")
public UniquenessScopeEnum getUniquenessScope() {
return uniquenessScope;
}
public void setUniquenessScope(UniquenessScopeEnum uniquenessScope) {
this.uniquenessScope = uniquenessScope;
}

/**
* Userstore attribute mappings.
**/
Expand Down Expand Up @@ -201,6 +219,7 @@ public String toString() {
sb.append(" regEx: ").append(regEx).append("\n");
sb.append(" required: ").append(required).append("\n");
sb.append(" supportedByDefault: ").append(supportedByDefault).append("\n");
sb.append(" uniquenessScope: ").append(uniquenessScope).append("\n");
sb.append(" attributeMapping: ").append(attributeMapping).append("\n");
sb.append(" properties: ").append(properties).append("\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.List;
import org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.AttributeMappingDTO;
import org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.ClaimResDTO;
import org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.PropertyDTO;
import io.swagger.annotations.*;
import com.fasterxml.jackson.annotation.*;
Expand Down Expand Up @@ -64,6 +65,12 @@ public class LocalClaimResDTO extends ClaimResDTO {
@Valid
private Boolean supportedByDefault = null;

public enum UniquenessScopeEnum {
NONE, WITHIN_USERSTORE, ACROSS_USERSTORES,
};
@Valid
private UniquenessScopeEnum uniquenessScope = null;

@Valid
private List<AttributeMappingDTO> attributeMapping = new ArrayList<AttributeMappingDTO>();

Expand Down Expand Up @@ -190,6 +197,18 @@ public void setSupportedByDefault(Boolean supportedByDefault) {
this.supportedByDefault = supportedByDefault;
}

/**
* Specifies the scope of uniqueness validation for the claim value.
**/
@ApiModelProperty(value = "Specifies the scope of uniqueness validation for the claim value.")
@JsonProperty("uniquenessScope")
public UniquenessScopeEnum getUniquenessScope() {
return uniquenessScope;
}
public void setUniquenessScope(UniquenessScopeEnum uniquenessScope) {
this.uniquenessScope = uniquenessScope;
}

/**
* Userstore attribute mappings.
**/
Expand Down Expand Up @@ -231,6 +250,7 @@ public String toString() {
sb.append(" regEx: ").append(regEx).append("\n");
sb.append(" required: ").append(required).append("\n");
sb.append(" supportedByDefault: ").append(supportedByDefault).append("\n");
sb.append(" uniquenessScope: ").append(uniquenessScope).append("\n");
sb.append(" attributeMapping: ").append(attributeMapping).append("\n");
sb.append(" properties: ").append(properties).append("\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
import static org.wso2.carbon.identity.api.server.claim.management.common.Constant.PROP_REG_EX;
import static org.wso2.carbon.identity.api.server.claim.management.common.Constant.PROP_REQUIRED;
import static org.wso2.carbon.identity.api.server.claim.management.common.Constant.PROP_SUPPORTED_BY_DEFAULT;
import static org.wso2.carbon.identity.api.server.claim.management.common.Constant.PROP_UNIQUENESS_SCOPE;
import static org.wso2.carbon.identity.api.server.common.Constants.JSON_FILE_EXTENSION;
import static org.wso2.carbon.identity.api.server.common.Constants.MEDIA_TYPE_JSON;
import static org.wso2.carbon.identity.api.server.common.Constants.MEDIA_TYPE_XML;
Expand Down Expand Up @@ -1001,6 +1002,15 @@ private LocalClaimResDTO getLocalClaimResDTO(LocalClaim localClaim) {
localClaimResDTO.setRequired(Boolean.valueOf(claimProperties.remove(PROP_REQUIRED)));
localClaimResDTO.setSupportedByDefault(Boolean.valueOf(claimProperties.remove(PROP_SUPPORTED_BY_DEFAULT)));

String uniquenessScope = claimProperties.remove(PROP_UNIQUENESS_SCOPE);
if (StringUtils.isNotBlank(uniquenessScope)) {
try {
localClaimResDTO.setUniquenessScope(LocalClaimResDTO.UniquenessScopeEnum.valueOf(uniquenessScope));
} catch (IllegalArgumentException e) {
localClaimResDTO.setUniquenessScope(LocalClaimResDTO.UniquenessScopeEnum.NONE);
}
}

List<AttributeMappingDTO> attributeMappingDTOs = new ArrayList<>();
for (AttributeMapping attributeMapping : localClaim.getMappedAttributes()) {
AttributeMappingDTO attributeMappingDTO = new AttributeMappingDTO();
Expand Down Expand Up @@ -1049,6 +1059,10 @@ private LocalClaim createLocalClaim(LocalClaimReqDTO localClaimReqDTO) {
claimProperties.put(PROP_DISPLAY_ORDER, "0");
}

if (localClaimReqDTO.getUniquenessScope() != null) {
claimProperties.put(PROP_UNIQUENESS_SCOPE, localClaimReqDTO.getUniquenessScope().toString());
}

claimProperties.put(PROP_READ_ONLY, String.valueOf(localClaimReqDTO.getReadOnly()));
claimProperties.put(PROP_REQUIRED, String.valueOf(localClaimReqDTO.getRequired()));
claimProperties.put(PROP_SUPPORTED_BY_DEFAULT, String.valueOf(localClaimReqDTO.getSupportedByDefault()));
Expand Down
Loading

0 comments on commit 9d9dbb2

Please sign in to comment.