diff --git a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml index aace42c077..fa3ba701cd 100644 --- a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml @@ -19,7 +19,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.idle.account.identification - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml index 2cc6452a68..00a70da90c 100644 --- a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.idle.account.identification - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml b/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml index 041b867afc..5576f23bc0 100644 --- a/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml +++ b/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml index 539a861592..af22b39fb2 100644 --- a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.admin.advisory.management org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml index 341215fd76..9d8e32335d 100644 --- a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.admin.advisory.management org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml index dd5c329bda..13797866d2 100644 --- a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml index ef8579295e..9d123901cf 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml @@ -22,12 +22,12 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.application.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml org.wso2.carbon.identity.api.server.application.management.common - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT jar @@ -57,7 +57,7 @@ provided - org.wso2.carbon.security.mgt + org.wso2.carbon.identity.framework org.wso2.carbon.security.mgt provided diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml index 4338069c41..10b672d82e 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.application.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml WSO2 Identity Server - Applications Rest API WSO2 Identity Server - Applications Rest API org.wso2.carbon.identity.api.server.application.management.v1 - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT jar diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/CustomRepresenter.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/CustomRepresenter.java index 0005354cbd..2208c5b3dd 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/CustomRepresenter.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/CustomRepresenter.java @@ -18,6 +18,7 @@ package org.wso2.carbon.identity.api.server.application.management.v1.core; +import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.introspector.Property; import org.yaml.snakeyaml.representer.Representer; @@ -33,6 +34,10 @@ public class CustomRepresenter extends Representer { private static final String[] PROPERTIES_TO_REMOVE = {"inboundConfiguration", "applicationID", "owner", "tenantDomain", "id", "idpProperties", "resourceId", "spProperties", "applicationResourceId"}; + public CustomRepresenter(DumperOptions options) { + super(options); + } + @Override protected Set getProperties(Class type) { diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java index e0c61043f7..45c29a5228 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java @@ -119,6 +119,8 @@ import org.wso2.carbon.identity.template.mgt.model.Template; import org.wso2.carbon.user.core.common.AbstractUserStoreManager; import org.wso2.carbon.user.core.service.RealmService; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; @@ -551,8 +553,8 @@ public void beforeMarshal(Object source) { private String parseYamlFromServiceProvider(ServiceProvider serviceProvider) { - Constructor constructor = new Constructor(); - CustomRepresenter representer = new CustomRepresenter(); + Constructor constructor = new Constructor(new LoaderOptions()); + CustomRepresenter representer = new CustomRepresenter(new DumperOptions()); for (Class protocol : INBOUND_CONFIG_PROTOCOLS) { TypeDescription description = new TypeDescription(InboundConfigurationProtocol.class); @@ -684,7 +686,7 @@ private ServiceProvider parseServiceProviderFromYaml(SpFileContent spFileContent throws IdentityApplicationManagementException { try { - Yaml yaml = new Yaml(new Constructor(ServiceProvider.class)); + Yaml yaml = new Yaml(new Constructor(ServiceProvider.class, new LoaderOptions())); return yaml.loadAs(spFileContent.getContent(), ServiceProvider.class); } catch (YAMLException e) { throw new IdentityApplicationManagementException(String.format("Error in reading YAML Service Provider " + diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/ServiceProviderToApiModel.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/ServiceProviderToApiModel.java index e71a826e55..d23707a319 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/ServiceProviderToApiModel.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/ServiceProviderToApiModel.java @@ -83,6 +83,7 @@ public class ServiceProviderToApiModel implements Function systemApplications = ApplicationManagementServiceHolder .getApplicationManagementService().getSystemApplications(); private static final String IS_FRAGMENT_APP = "isFragmentApp"; + private static final String useUserIdForDefaultSubject = "useUserIdForDefaultSubject"; @Override public ApplicationResponseModel apply(ServiceProvider application) { @@ -283,9 +284,7 @@ private SubjectConfig buildSubjectClaimConfig(ServiceProvider application) { subjectConfig.includeUserDomain(localAndOutboundAuthConfig.isUseUserstoreDomainInLocalSubjectIdentifier()); if (StringUtils.isBlank(localAndOutboundAuthConfig.getSubjectClaimUri())) { - if (isLocalClaimDialectUsedBySp(application)) { - subjectConfig.claim(buildClaimModel(FrameworkConstants.USERNAME_CLAIM)); - } + assignClaimForSubjectValue(application, subjectConfig); } else { subjectConfig.claim(buildClaimModel(localAndOutboundAuthConfig.getSubjectClaimUri())); } @@ -294,6 +293,27 @@ private SubjectConfig buildSubjectClaimConfig(ServiceProvider application) { return subjectConfig; } + private void assignClaimForSubjectValue(ServiceProvider application, SubjectConfig subjectConfig) { + + if (isLocalClaimDialectUsedBySp(application)) { + if (isUserIdUsedAsDefaultSubject(application.getSpProperties())) { + subjectConfig.claim(buildClaimModel(FrameworkConstants.USER_ID_CLAIM)); + } else { + subjectConfig.claim(buildClaimModel(FrameworkConstants.USERNAME_CLAIM)); + } + } + } + + private boolean isUserIdUsedAsDefaultSubject (ServiceProviderProperty[] spProperties) { + + for (ServiceProviderProperty spProperty : spProperties) { + if (useUserIdForDefaultSubject.equals(spProperty.getName())) { + return true; + } + } + return false; + } + private ClaimConfiguration.DialectEnum getDialect(ServiceProvider application) { if (isLocalClaimDialectUsedBySp(application)) { diff --git a/components/org.wso2.carbon.identity.api.server.application.management/pom.xml b/components/org.wso2.carbon.identity.api.server.application.management/pom.xml index 99a463918c..57c801c445 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.application.management/pom.xml @@ -22,12 +22,12 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml org.wso2.carbon.identity.api.server.application.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT pom diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml index af7b18cb6e..3ab15b1aea 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.authenticators - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.authenticators.common diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml index 2b0cc951c5..3e8213cb1d 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.authenticators - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.authenticators.v1 diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml b/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml index b0ae999dd8..658876139b 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml index 1ad38bb3bb..a495659382 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml @@ -24,7 +24,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.branding.preference.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.server.api diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml index 7d12f04c80..140c03d99f 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.identity.api.server.branding.preference.management org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml b/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml index 724a3a8801..2948db6879 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml @@ -22,7 +22,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.api.server.challenge.common/pom.xml b/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.api.server.challenge.common/pom.xml index 7f535fe365..dd8ca67e95 100644 --- a/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.api.server.challenge.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.api.server.challenge.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.challenge org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.challenge.common diff --git a/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.rest.api.server.challenge.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.rest.api.server.challenge.v1/pom.xml index ecd12529f0..c0802214b7 100644 --- a/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.rest.api.server.challenge.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.challenge/org.wso2.carbon.identity.rest.api.server.challenge.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.challenge ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.rest.api.server.challenge.v1 diff --git a/components/org.wso2.carbon.identity.api.server.challenge/pom.xml b/components/org.wso2.carbon.identity.api.server.challenge/pom.xml index 700fbf53f9..5979410607 100644 --- a/components/org.wso2.carbon.identity.api.server.challenge/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.challenge/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml index 1df25b60c8..6d61bf82e6 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.claim.management org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.claim.management.common diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml index 83b48acd90..1e4733d959 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.claim.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.rest.api.server.claim.management.v1 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 7d2ee1ecc7..97ca0dc8df 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 @@ -58,6 +58,7 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.UserStoreManager; import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.error.YAMLException; @@ -1154,7 +1155,7 @@ private ClaimDialectConfiguration parseClaimDialectFromJson(FileContent fileCont private ClaimDialectConfiguration parseClaimDialectFromYaml(FileContent fileContent) throws ClaimMetadataException { try { - Yaml yaml = new Yaml(new Constructor(ClaimDialectConfiguration.class)); + Yaml yaml = new Yaml(new Constructor(ClaimDialectConfiguration.class, new LoaderOptions())); return yaml.loadAs(fileContent.getContent(), ClaimDialectConfiguration.class); } catch (YAMLException e) { throw new ClaimMetadataException(String.format( diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml b/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml index 751fb6fc90..140b6048ef 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.common/pom.xml b/components/org.wso2.carbon.identity.api.server.common/pom.xml index 2b809f2e25..3bc29da049 100644 --- a/components/org.wso2.carbon.identity.api.server.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.common/pom.xml @@ -19,7 +19,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml index 63cded253e..47e220421b 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.configs - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.configs.common diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml index 321bb65acf..25959cd3aa 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.configs - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.configs.v1 diff --git a/components/org.wso2.carbon.identity.api.server.configs/pom.xml b/components/org.wso2.carbon.identity.api.server.configs/pom.xml index 3cd61d30fa..1fc9443ed0 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.configs/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml index d6a16bf835..057771f8e5 100644 --- a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.cors - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.cors.common diff --git a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml index b0b9f5d0f4..d7001f03d2 100644 --- a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.cors - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.cors.v1 diff --git a/components/org.wso2.carbon.identity.api.server.cors/pom.xml b/components/org.wso2.carbon.identity.api.server.cors/pom.xml index 8509db52ec..2ecc2c1453 100644 --- a/components/org.wso2.carbon.identity.api.server.cors/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.cors/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml index b03527f43b..134ada6020 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.email.template - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml index ec79c95172..866f86614f 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.email.template - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.email.template/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/pom.xml index b4db49434f..6ce843fe58 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml index 2ccad79790..c1af4e4734 100644 --- a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml @@ -19,7 +19,7 @@ org.wso2.carbon.identity.api.server.extension.management org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml index 0808f06bf0..6de3bce605 100644 --- a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.extension.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.extension.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml b/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml index 9813600142..9b2bde3c0f 100644 --- a/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml @@ -19,7 +19,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.common/pom.xml b/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.common/pom.xml index 962cfa2ba0..83f5a39ec8 100644 --- a/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.fetch.remote - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.v1/pom.xml index 588ad3e711..fa4d4e805c 100644 --- a/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.fetch.remote/org.wso2.carbon.identity.api.server.fetch.remote.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.fetch.remote - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.fetch.remote/pom.xml b/components/org.wso2.carbon.identity.api.server.fetch.remote/pom.xml index 283f8d321b..1d6bdb81b2 100644 --- a/components/org.wso2.carbon.identity.api.server.fetch.remote/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.fetch.remote/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml index 752ac3a896..1d5e358f89 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.identity.api.server.identity.governance org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml index 1814eea250..ccb067cdea 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.identity.governance ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.identity.governance.v1 diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApi.java b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApi.java index bd3df87be2..b4f5b05af4 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApi.java +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApi.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2019, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.identity.governance.v1; @@ -23,6 +25,7 @@ import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorsPatchReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.Error; import java.util.List; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.MultipleConnectorsPatchReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PreferenceResp; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PreferenceSearchAttribute; import org.wso2.carbon.identity.api.server.identity.governance.v1.IdentityGovernanceApiService; @@ -176,4 +179,27 @@ public Response patchConnector(@ApiParam(value = "Id of the connector category." return delegate.patchConnector(categoryId, connectorId, connectorsPatchReq ); } + @Valid + @PATCH + @Path("/{category-id}/connectors") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "Patch governance connectors of a category.", notes = "Patch governance connectors of a category.
Permission required:
* /permission/admin/manage/identity/idpmgt/update
Scope required:
* internal_idp_update ", response = Void.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "Management" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK.", response = Void.class), + @ApiResponse(code = 400, message = "Bad Request.", response = Error.class), + @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class), + @ApiResponse(code = 404, message = "Not Found.", response = Error.class), + @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class) + }) + public Response patchConnectorsOfCategory(@ApiParam(value = "Id of the connector category.",required=true) @PathParam("category-id") String categoryId, @ApiParam(value = "Governance connectors and properties to update" ,required=true) @Valid MultipleConnectorsPatchReq multipleConnectorsPatchReq) { + + return delegate.patchConnectorsOfCategory(categoryId, multipleConnectorsPatchReq ); + } + } diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApiService.java b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApiService.java index 8ff0cf3d07..7bad8730bc 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApiService.java +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/IdentityGovernanceApiService.java @@ -1,23 +1,26 @@ /* -* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2019, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.identity.governance.v1; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorsPatchReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PreferenceSearchAttribute; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.MultipleConnectorsPatchReq; import java.util.List; @@ -37,4 +40,6 @@ public interface IdentityGovernanceApiService { public Response getPreferenceByPost(List preferenceSearchAttribute); public Response patchConnector(String categoryId, String connectorId, ConnectorsPatchReq connectorsPatchReq); + + public Response patchConnectorsOfCategory(String categoryId, MultipleConnectorsPatchReq multipleConnectorsPatchReq); } diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/model/ConnectorReq.java b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/model/ConnectorReq.java new file mode 100644 index 0000000000..31ce3fc4a1 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/model/ConnectorReq.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.api.server.identity.governance.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PropertyReq; +import javax.validation.constraints.*; + +/** + * Governance connector to patch + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; +@ApiModel(description = "Governance connector to patch") +public class ConnectorReq { + + private String id; + private List properties = new ArrayList<>(); + + + /** + * Connector id. + **/ + public ConnectorReq id(String id) { + + this.id = id; + return this; + } + + @ApiModelProperty(example = "c3VzcGVuc2lvbi5ub3RpZmljYXRpb24", required = true, value = "Connector id.") + @JsonProperty("id") + @Valid + @NotNull(message = "Property id cannot be null.") + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + /** + * Governance connector properties to patch. + **/ + public ConnectorReq properties(List properties) { + + this.properties = properties; + return this; + } + + @ApiModelProperty(required = true, value = "Governance connector properties to patch.") + @JsonProperty("properties") + @Valid + @NotNull(message = "Property properties cannot be null.") + + public List getProperties() { + return properties; + } + public void setProperties(List properties) { + this.properties = properties; + } + + public ConnectorReq addPropertiesItem(PropertyReq propertiesItem) { + this.properties.add(propertiesItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectorReq connectorReq = (ConnectorReq) o; + return Objects.equals(this.id, connectorReq.id) && + Objects.equals(this.properties, connectorReq.properties); + } + + @Override + public int hashCode() { + return Objects.hash(id, properties); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectorReq {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/model/MultipleConnectorsPatchReq.java b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/model/MultipleConnectorsPatchReq.java new file mode 100644 index 0000000000..20d7d60e8b --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/gen/java/org/wso2/carbon/identity/api/server/identity/governance/v1/model/MultipleConnectorsPatchReq.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.api.server.identity.governance.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorReq; +import javax.validation.constraints.*; + +/** + * Multiple governance connectors properties patch request. + **/ + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; +@ApiModel(description = "Multiple governance connectors properties patch request.") +public class MultipleConnectorsPatchReq { + + +@XmlType(name="OperationEnum") +@XmlEnum(String.class) +public enum OperationEnum { + + @XmlEnumValue("UPDATE") UPDATE(String.valueOf("UPDATE")); + + + private String value; + + OperationEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperationEnum fromValue(String value) { + for (OperationEnum b : OperationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private OperationEnum operation; + private List connectors = new ArrayList<>(); + + + /** + * Governance connector properties patch operation. + **/ + public MultipleConnectorsPatchReq operation(OperationEnum operation) { + + this.operation = operation; + return this; + } + + @ApiModelProperty(example = "UPDATE", required = true, value = "Governance connector properties patch operation.") + @JsonProperty("operation") + @Valid + @NotNull(message = "Property operation cannot be null.") + + public OperationEnum getOperation() { + return operation; + } + public void setOperation(OperationEnum operation) { + this.operation = operation; + } + + /** + * Governance connectors to patch + **/ + public MultipleConnectorsPatchReq connectors(List connectors) { + + this.connectors = connectors; + return this; + } + + @ApiModelProperty(required = true, value = "Governance connectors to patch") + @JsonProperty("connectors") + @Valid + @NotNull(message = "Property connectors cannot be null.") + + public List getConnectors() { + return connectors; + } + public void setConnectors(List connectors) { + this.connectors = connectors; + } + + public MultipleConnectorsPatchReq addConnectorsItem(ConnectorReq connectorsItem) { + this.connectors.add(connectorsItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultipleConnectorsPatchReq multipleConnectorsPatchReq = (MultipleConnectorsPatchReq) o; + return Objects.equals(this.operation, multipleConnectorsPatchReq.operation) && + Objects.equals(this.connectors, multipleConnectorsPatchReq.connectors); + } + + @Override + public int hashCode() { + return Objects.hash(operation, connectors); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class MultipleConnectorsPatchReq {\n"); + + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" connectors: ").append(toIndentedString(connectors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/core/ServerIdentityGovernanceService.java b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/core/ServerIdentityGovernanceService.java index fc7be0dd39..6787ef2fa8 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/core/ServerIdentityGovernanceService.java +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/core/ServerIdentityGovernanceService.java @@ -1,17 +1,19 @@ /* - * Copyright (c) 2019 , WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2019, WSO2 LLC. (http://www.wso2.com). * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.identity.api.server.identity.governance.v1.core; @@ -27,9 +29,11 @@ import org.wso2.carbon.identity.api.server.identity.governance.v1.model.CategoriesRes; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.CategoryConnectorsRes; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.CategoryRes; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorRes; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorsPatchReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.MetaRes; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.MultipleConnectorsPatchReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PreferenceResp; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PreferenceSearchAttribute; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PropertyReq; @@ -302,6 +306,55 @@ public void updateGovernanceConnectorProperty(String categoryId, String connecto } } + /** + * + * Update multiple governance connector properties. + * + * @param categoryId Governance connector category id. + * @param multipleConnectorsPatchReq Governance connectors and properties to update. + */ + public void updateGovernanceConnectorProperties(String categoryId, + MultipleConnectorsPatchReq multipleConnectorsPatchReq) { + + try { + IdentityGovernanceService identityGovernanceService = GovernanceDataHolder.getIdentityGovernanceService(); + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + + // Check whether the category ID exists. + CategoryRes category = getGovernanceConnectorCategory(categoryId); + if (category == null) { + throw handleNotFoundError(categoryId, GovernanceConstants.ErrorMessage.ERROR_CODE_CATEGORY_NOT_FOUND); + } + + Map configurationDetails = new HashMap<>(); + + // Loop through each connector in the request and add the properties to be updated to a hashmap. + for (ConnectorReq connectorReq : multipleConnectorsPatchReq.getConnectors()) { + String connectorId = connectorReq.getId(); + + // Check whether the connector ID exists. + ConnectorRes connector = getGovernanceConnector(categoryId, connectorId); + if (connector == null) { + throw handleNotFoundError(connectorId, + GovernanceConstants.ErrorMessage.ERROR_CODE_CONNECTOR_NOT_FOUND); + } + + // Add properties of the connector to be updated to the configurationDetails hashmap. + for (PropertyReq propertyReqDTO : connectorReq.getProperties()) { + configurationDetails.put(propertyReqDTO.getName(), propertyReqDTO.getValue()); + } + } + + identityGovernanceService.updateConfiguration(tenantDomain, configurationDetails); + + } catch (IdentityGovernanceException e) { + GovernanceConstants.ErrorMessage errorEnum = + GovernanceConstants.ErrorMessage.ERROR_CODE_ERROR_UPDATING_CONNECTOR_PROPERTY; + Response.Status status = Response.Status.INTERNAL_SERVER_ERROR; + throw handleException(e, errorEnum, status); + } + } + private APIError handleException(Exception e, GovernanceConstants.ErrorMessage errorEnum, Response.Status status, String... data) { diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/impl/IdentityGovernanceApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/impl/IdentityGovernanceApiServiceImpl.java index 74fbae8546..dd85e5de13 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/impl/IdentityGovernanceApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/java/org/wso2/carbon/identity/api/server/identity/governance/v1/impl/IdentityGovernanceApiServiceImpl.java @@ -1,17 +1,19 @@ /* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2019, WSO2 LLC. (http://www.wso2.com). * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.identity.api.server.identity.governance.v1.impl; @@ -20,6 +22,7 @@ import org.wso2.carbon.identity.api.server.identity.governance.v1.IdentityGovernanceApiService; import org.wso2.carbon.identity.api.server.identity.governance.v1.core.ServerIdentityGovernanceService; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorsPatchReq; +import org.wso2.carbon.identity.api.server.identity.governance.v1.model.MultipleConnectorsPatchReq; import org.wso2.carbon.identity.api.server.identity.governance.v1.model.PreferenceSearchAttribute; import java.util.List; @@ -65,6 +68,14 @@ public Response patchConnector(String categoryId, String connectorId, Connectors return Response.ok().build(); } + @Override + public Response patchConnectorsOfCategory(String categoryId, + MultipleConnectorsPatchReq multipleConnectorsPatchReq) { + + identityGovernanceService.updateGovernanceConnectorProperties(categoryId, multipleConnectorsPatchReq); + return Response.ok().build(); + } + @Override public Response getPreferenceByPost(List preferenceSearchAttribute) { diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/resources/identity-governance.yaml b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/resources/identity-governance.yaml index a03f1a34b0..a4db1aa9a5 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/resources/identity-governance.yaml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/src/main/resources/identity-governance.yaml @@ -108,6 +108,37 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + patch: + tags: + - Management + summary: Patch governance connectors of a category. + operationId: patchConnectorsOfCategory + description: | + Patch governance connectors of a category.
+ Permission required:
+ * /permission/admin/manage/identity/idpmgt/update
+ Scope required:
+ * internal_idp_update + parameters: + - $ref: '#/components/parameters/categoryIdPathParam' + responses: + '200': + $ref: '#/components/responses/OK' + '400': + $ref: '#/components/responses/InvalidInput' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/ServerError' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MultipleConnectorsPatchReq' + description: Governance connectors and properties to update + required: true '/identity-governance/{category-id}/connectors/{connector-id}': get: tags: @@ -748,6 +779,40 @@ components: description: Governance connector properties to patch. items: $ref: '#/components/schemas/PropertyReq' + MultipleConnectorsPatchReq: + type: object + description: Multiple governance connectors properties patch request. + required: + - operation + - connectors + properties: + operation: + type: string + description: Governance connector properties patch operation. + enum: + - UPDATE + example: UPDATE + connectors: + type: array + description: Governance connectors to patch + items: + $ref: '#/components/schemas/ConnectorReq' + ConnectorReq: + type: object + description: Governance connector to patch + required: + - id + - properties + properties: + id: + type: string + description: Connector id. + example: c3VzcGVuc2lvbi5ub3RpZmljYXRpb24 + properties: + type: array + description: Governance connector properties to patch. + items: + $ref: '#/components/schemas/PropertyReq' PropertyReq: type: object description: Governance connector property to patch. diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml b/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml index 6562e030b5..063d3c493b 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml index 082a4462e5..814b21b10b 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.idp org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml index 71814eca93..b0035a10b8 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.idp ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java index 95509184a4..30f1f70d0d 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java @@ -112,6 +112,8 @@ import org.wso2.carbon.idp.mgt.model.ConnectedAppsResult; import org.wso2.carbon.idp.mgt.model.IdpSearchResult; import org.wso2.carbon.user.core.UserCoreConstants; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; @@ -3620,7 +3622,7 @@ private FileContent parseIdpToYaml(IdentityProvider identityProvider) StringBuilder fileNameSB = new StringBuilder(identityProvider.getIdentityProviderName()); fileNameSB.append(YAML_FILE_EXTENSION); - Representer representer = new Representer(); + Representer representer = new Representer(new DumperOptions()); TypeDescription typeDescription = new TypeDescription(IdentityProvider.class); typeDescription.setExcludes("id", "resourceId"); representer.addTypeDescription(typeDescription); @@ -3694,7 +3696,7 @@ private IdentityProvider parseIdpFromYaml(FileContent fileContent) throws IdentityProviderManagementClientException { try { - Yaml yaml = new Yaml(new Constructor(IdentityProvider.class)); + Yaml yaml = new Yaml(new Constructor(IdentityProvider.class, new LoaderOptions())); return yaml.loadAs(fileContent.getContent(), IdentityProvider.class); } catch (YAMLException e) { throw new IdentityProviderManagementClientException(String.format("Error in reading YAML file " + diff --git a/components/org.wso2.carbon.identity.api.server.idp/pom.xml b/components/org.wso2.carbon.identity.api.server.idp/pom.xml index 8e0463b21d..f9611b4274 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idp/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml index 49459129d7..23b1954d68 100644 --- a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.idv.provider ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.idv.provider.common diff --git a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml index dcb2a6c163..dfb62bf8f5 100644 --- a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.idv.provider ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT org.wso2.carbon.identity.api.server.idv.provider.v1 diff --git a/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml b/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml index b6b346d1fa..abb79b7953 100644 --- a/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml index c2ab215470..5af9c02bcb 100644 --- a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.input.validation org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml index 64b83b6c06..ef4b73ba21 100644 --- a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.input.validation - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml WSO2 Identity Server - Input Validation Rest API WSO2 Identity Server - Validation Rest API org.wso2.carbon.identity.api.server.input.validation.v1 - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT jar diff --git a/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml b/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml index cb9ec4b5ad..9f5f88a5f6 100644 --- a/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml @@ -22,7 +22,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml index c493a9d028..74441130a0 100644 --- a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.keystore.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.keystore.management.common @@ -49,7 +49,7 @@ provided - org.wso2.carbon.security.mgt + org.wso2.carbon.identity.framework org.wso2.carbon.security.mgt provided diff --git a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml index caa2576cc7..22d39dca2f 100644 --- a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.keystore.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.keystore.management.v1 @@ -161,7 +161,7 @@ provided - org.wso2.carbon.security.mgt + org.wso2.carbon.identity.framework org.wso2.carbon.security.mgt provided diff --git a/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml b/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml index ad47da7ca9..f1dd6734d8 100644 --- a/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml index c209d4b98c..ef0d0be91d 100644 --- a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.notification.sender org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml index 9ff418a9c2..b1c618efa4 100644 --- a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.notification.sender org.wso2.carbon.identity.server.api ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml index be125909d3..25268002f2 100644 --- a/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml index 362a89ed07..6456b49cd9 100644 --- a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.oidc.scope.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml index 2d3d2425e4..6976a0bf95 100644 --- a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.oidc.scope.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.oidc.scope.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml index 8b976fb205..11c4ceff5c 100644 --- a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml index 60e0d92fa5..9a0169ae76 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml index 0c0beb5ab9..83bd228779 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml index f580090395..5cbc17e086 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml index 6c00d781ee..38e573fc4c 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.role.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml index e3a97c250f..4665f35525 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.role.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml index 2850d59af3..1d76be8e07 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml index a9437af075..3c41d92be2 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.user.invitation.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/common/UserInvitationMgtConstants.java b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/common/UserInvitationMgtConstants.java index 328186a641..0c390ab223 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/common/UserInvitationMgtConstants.java +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/common/UserInvitationMgtConstants.java @@ -64,6 +64,18 @@ public enum ErrorMessage { ERROR_CODE_INVALID_FILTER("60009", "Invalid filter.", "Provided filter %s is not valid."), + ERROR_CODE_INVALID_APPLICATION("60009", + "Invalid application provided.", + "One of the provided applications with roles are not valid."), + ERROR_CODE_INVALID_CONFIRMATION_CODE_FOR_ACCEPTANCE("60010", + "Invalid confirmation code.", + "Could not accept the invitation since the confirmation code %s is not valid."), + ERROR_CODE_INVALID_USER("60011", + "Invalid user provided.", + "Invalid user is provided."), + ERROR_CODE_EXISTING_USER("60012", + "Authenticated user exist.", + "The authenticated user is already available in the organization."), // Server errors. ERROR_CODE_CREATE_INVITATION("65001", @@ -78,6 +90,9 @@ public enum ErrorMessage { ERROR_CODE_DELETE_INVITATION("65004", "Unable to delete the invitation.", "Could not delete the invitation with the id %s."), + ERROR_CODE_ACCEPT_INVITATION("65005", + "Unable to accept the invitation.", + "Could not accept the invitation with the confirmation code %s."), ERROR_CODE_NOT_IMPLEMENTED("65100", "Not Implemented.", "Method is not implemented."); diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml index dc2e4be9ab..8807670e01 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.user.invitation.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/v1/core/GuestApiServiceCore.java b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/v1/core/GuestApiServiceCore.java index 7c4ac0c1ec..bab04b99ff 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/v1/core/GuestApiServiceCore.java +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/user/invitation/management/v1/core/GuestApiServiceCore.java @@ -44,13 +44,15 @@ import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_CONFIRMATION_CODE; import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_FILTER; import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_INVITATION_ID; +import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_USER; import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_MULTIPLE_INVITATIONS_FOR_USER; +import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_STORE_ROLES_APP_ID_INVALID; import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_UNSUPPORTED_FILTER_ATTRIBUTE; import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_UNSUPPORTED_FILTER_ATTRIBUTE_VALUE; +import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_USER_ALREADY_EXISTS; import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_USER_NOT_FOUND; import static javax.ws.rs.core.Response.Status.BAD_REQUEST; import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; -import static javax.ws.rs.core.Response.Status.NOT_IMPLEMENTED; /** * Service class for the User Invitation Management APIs. @@ -109,6 +111,9 @@ public InvitationSuccessResponse createInvitation(InvitationRequestBody invitati } else if (ERROR_CODE_ACTIVE_INVITATION_EXISTS.getCode().equals(e.getErrorCode())) { throw handleException(BAD_REQUEST, UserInvitationMgtConstants.ErrorMessage .ERROR_CODE_ACTIVE_INVITATION_AVAILABLE, invitation.getUsername()); + } else if (ERROR_CODE_STORE_ROLES_APP_ID_INVALID.getCode().equals(e.getErrorCode())) { + throw handleException(BAD_REQUEST, UserInvitationMgtConstants.ErrorMessage + .ERROR_CODE_INVALID_APPLICATION, StringUtils.EMPTY); } throw handleException(Response.Status.INTERNAL_SERVER_ERROR, UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_CREATE_INVITATION, @@ -199,8 +204,24 @@ public boolean deleteInvitation(String invitationId) { */ public void acceptInvitation(AcceptanceRequestBody acceptanceRequestBody) { - throw handleException(NOT_IMPLEMENTED, UserInvitationMgtConstants - .ErrorMessage.ERROR_CODE_NOT_IMPLEMENTED, null); + InvitationCoreServiceImpl invitationCoreService = new InvitationCoreServiceImpl(); + try { + invitationCoreService.acceptInvitation(acceptanceRequestBody.getConfirmationCode()); + } catch (UserInvitationMgtException e) { + if (ERROR_CODE_INVALID_CONFIRMATION_CODE.getCode().equals(e.getErrorCode())) { + throw handleException(BAD_REQUEST, UserInvitationMgtConstants.ErrorMessage + .ERROR_CODE_INVALID_CONFIRMATION_CODE_FOR_ACCEPTANCE, acceptanceRequestBody + .getConfirmationCode()); + } else if (ERROR_CODE_INVALID_USER.getCode().equals(e.getErrorCode())) { + throw handleException(BAD_REQUEST, UserInvitationMgtConstants.ErrorMessage + .ERROR_CODE_INVALID_USER, StringUtils.EMPTY); + } else if (ERROR_CODE_USER_ALREADY_EXISTS.getCode().equals(e.getErrorCode())) { + throw handleException(BAD_REQUEST, UserInvitationMgtConstants.ErrorMessage + .ERROR_CODE_EXISTING_USER, StringUtils.EMPTY); + } + throw handleException(INTERNAL_SERVER_ERROR, UserInvitationMgtConstants.ErrorMessage + .ERROR_CODE_ACCEPT_INVITATION, acceptanceRequestBody.getConfirmationCode()); + } } private APIError handleException(Response.Status status, UserInvitationMgtConstants.ErrorMessage error, diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml index a64c42e150..3609f1a7ef 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml index d864b2158b..83e6c620be 100644 --- a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.permission.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT WSO2 Identity Server - Common Permission Management WSO2 Identity Server - PCommon Permission Management diff --git a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml index 639c605e91..0a670657d0 100644 --- a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.permission.management ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.permission.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml b/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml index cf27634f07..0b83c3310e 100644 --- a/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml index b8ff93c829..ddf75fe27c 100644 --- a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.script.library org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml index 472852d88d..e50f0997ff 100644 --- a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.script.library/pom.xml b/components/org.wso2.carbon.identity.api.server.script.library/pom.xml index 5589717a1e..7ea4915a5f 100644 --- a/components/org.wso2.carbon.identity.api.server.script.library/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.script.library/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml index 5e8295fa9a..1b2ae8874c 100644 --- a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.secret.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml index 489367530c..2259ab7688 100644 --- a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.secret.management - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml b/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml index a8e8c47940..477f5451b6 100644 --- a/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml index 12ccad3a19..dc9fd822dd 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.identity.api.server.tenant.management org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml index b9368c9704..eda4310845 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml @@ -18,7 +18,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml index 87b8b82daf..7d0f389895 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml @@ -18,7 +18,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml index 3adca78cdb..cfdeea816e 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.identity.api.server.userstore org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml index ac9a6bd703..6c7bbb84a9 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.userstore ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.userstore.v1 diff --git a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/src/main/java/org/wso2/carbon/identity/api/server/userstore/v1/core/ServerUserStoreService.java b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/src/main/java/org/wso2/carbon/identity/api/server/userstore/v1/core/ServerUserStoreService.java index 97182254bc..2fea6c2b1c 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/src/main/java/org/wso2/carbon/identity/api/server/userstore/v1/core/ServerUserStoreService.java +++ b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/src/main/java/org/wso2/carbon/identity/api/server/userstore/v1/core/ServerUserStoreService.java @@ -76,6 +76,7 @@ import org.wso2.carbon.user.core.UserStoreManager; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.tracker.UserStoreManagerRegistry; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.error.YAMLException; @@ -1660,7 +1661,7 @@ private UserStoreConfigurations parseUserStoreFromXml(FileContent fileContent) t private UserStoreConfigurations parseUserStoreFromYaml(FileContent fileContent) throws UserStoreException { try { - Yaml yaml = new Yaml(new Constructor(UserStoreConfigurations.class)); + Yaml yaml = new Yaml(new Constructor(UserStoreConfigurations.class, new LoaderOptions())); return yaml.loadAs(fileContent.getContent(), UserStoreConfigurations.class); } catch (YAMLException e) { throw new UserStoreException(String.format("Error in reading YAML file " + diff --git a/components/org.wso2.carbon.identity.api.server.userstore/pom.xml b/components/org.wso2.carbon.identity.api.server.userstore/pom.xml index 5a11c549ec..156a0f1bf7 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.userstore/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.workflow.engine/org.wso2.carbon.identity.rest.api.server.workflow.engine.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.workflow.engine/org.wso2.carbon.identity.rest.api.server.workflow.engine.v1/pom.xml index 00471bf51d..39cb7e8e69 100644 --- a/components/org.wso2.carbon.identity.api.server.workflow.engine/org.wso2.carbon.identity.rest.api.server.workflow.engine.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.workflow.engine/org.wso2.carbon.identity.rest.api.server.workflow.engine.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.workflow.engine ../pom.xml - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.workflow.engine/pom.xml b/components/org.wso2.carbon.identity.api.server.workflow.engine/pom.xml index 31edf11bca..3bceb50542 100644 --- a/components/org.wso2.carbon.identity.api.server.workflow.engine/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.workflow.engine/pom.xml @@ -19,7 +19,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index b51b41e47a..71aacfc23b 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 4.0.0 identity-api-server pom - 1.2.71-SNAPSHOT + 1.2.76-SNAPSHOT WSO2 Identity Server - Server API Module @@ -293,9 +293,9 @@ ${identity.inbound.oauth2.version} - org.wso2.carbon.security.mgt + org.wso2.carbon.identity.framework org.wso2.carbon.security.mgt - ${carbon.security.mgt.version} + ${carbon.identity.framework.version} provided @@ -700,7 +700,7 @@ 1.4 1.2.4 1.8.62 - 5.25.198 + 5.25.305 3.0.5 5.2.0 **/gen/**/* @@ -711,7 +711,6 @@ findbugs-exclude-filter.xml 4.9.4 4.9.10 - 1.0.0 0.7.12 2.4.21 5.2.15 @@ -729,7 +728,7 @@ - 1.3.54 + 1.3.61