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.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.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.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/pom.xml b/pom.xml index 2e5c4acce7..0813b9db3b 100644 --- a/pom.xml +++ b/pom.xml @@ -689,7 +689,7 @@ 1.4 1.2.4 1.8.57 - 5.25.198 + 5.25.302 3.0.5 5.2.0 **/gen/**/*