From b705092c86f1949440e787b53b594996cde27018 Mon Sep 17 00:00:00 2001 From: rushannanayakkara Date: Tue, 21 Nov 2023 09:28:22 +0530 Subject: [PATCH 1/6] Initialize CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME value to true. --- .../auth/functions/analytics/CallAnalyticsFunctionImplTest.java | 2 ++ .../auth/functions/choreo/CallChoreoFunctionImplTest.java | 2 ++ .../auth/functions/elk/CallElasticFunctionImplTest.java | 2 ++ .../conditional/auth/functions/http/CookieFunctionImplTest.java | 2 ++ .../auth/functions/http/HTTPGetFunctionImplTest.java | 2 ++ .../auth/functions/http/HTTPPostFunctionImplTest.java | 2 ++ .../auth/functions/notification/SendEmailFunctionImplTest.java | 2 ++ .../auth/functions/user/HasAnyOfTheRolesFunctionImplTest.java | 2 ++ .../auth/functions/user/HasRoleFunctionImplTest.java | 2 ++ .../functions/user/IsMemberOfAnyOfGroupsFunctionImplTest.java | 2 ++ 10 files changed, 20 insertions(+) diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/analytics/CallAnalyticsFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/analytics/CallAnalyticsFunctionImplTest.java index 2c304a96..6049264c 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/analytics/CallAnalyticsFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/analytics/CallAnalyticsFunctionImplTest.java @@ -21,6 +21,7 @@ import org.mockito.Mockito; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.CacheBackedLongWaitStatusDAO; @@ -75,6 +76,7 @@ protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("callAnalytics", new CallAnalyticsFunctionImpl()); UserRealm userRealm = realmService.getTenantUserRealm(-1234); userRealm.getUserStoreManager().addRole("admin", new String[]{"admin", "test_user"}, null); diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/choreo/CallChoreoFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/choreo/CallChoreoFunctionImplTest.java index f460e062..8d3fd64a 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/choreo/CallChoreoFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/choreo/CallChoreoFunctionImplTest.java @@ -35,6 +35,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.CacheBackedLongWaitStatusDAO; @@ -110,6 +111,7 @@ protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("callChoreo", new CallChoreoFunctionImpl()); UserRealm userRealm = realmService.getTenantUserRealm(-1234); userRealm.getUserStoreManager().addRole("admin", new String[]{"admin", "test_user"}, null); diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.elk/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/elk/CallElasticFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.elk/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/elk/CallElasticFunctionImplTest.java index 7c47d25d..95a0cfe5 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.elk/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/elk/CallElasticFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.elk/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/elk/CallElasticFunctionImplTest.java @@ -23,6 +23,7 @@ import org.mockito.Mockito; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.CacheBackedLongWaitStatusDAO; @@ -76,6 +77,7 @@ public class CallElasticFunctionImplTest extends JsSequenceHandlerAbstractTest { protected void initClass() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("callElastic", new CallElasticFunctionImpl()); } diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/CookieFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/CookieFunctionImplTest.java index 8ef9bdba..6b7bc473 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/CookieFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/CookieFunctionImplTest.java @@ -27,6 +27,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.core.internal.CarbonCoreDataHolder; import org.wso2.carbon.crypto.impl.DefaultCryptoService; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; @@ -68,6 +69,7 @@ public class CookieFunctionImplTest extends JsSequenceHandlerAbstractTest { protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("setCookie", (SetCookieFunction) new CookieFunctionImpl()::setCookie); sequenceHandlerRunner.registerJsFunction("getCookieValue", (GetCookieFunction) new CookieFunctionImpl() ::getCookieValue); diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPGetFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPGetFunctionImplTest.java index cf5ebe68..32929d19 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPGetFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPGetFunctionImplTest.java @@ -21,6 +21,7 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.CacheBackedLongWaitStatusDAO; @@ -80,6 +81,7 @@ public class HTTPGetFunctionImplTest extends JsSequenceHandlerAbstractTest { protected void initClass() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; LongWaitStatusDAOImpl daoImpl = new LongWaitStatusDAOImpl(); CacheBackedLongWaitStatusDAO cacheBackedDao = new CacheBackedLongWaitStatusDAO(daoImpl); int connectionTimeout = 5000; diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPPostFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPPostFunctionImplTest.java index 963f3e8d..6388b46e 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPPostFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/http/HTTPPostFunctionImplTest.java @@ -21,6 +21,7 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.CacheBackedLongWaitStatusDAO; @@ -82,6 +83,7 @@ public class HTTPPostFunctionImplTest extends JsSequenceHandlerAbstractTest { protected void initClass() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; LongWaitStatusDAOImpl daoImpl = new LongWaitStatusDAOImpl(); CacheBackedLongWaitStatusDAO cacheBackedDao = new CacheBackedLongWaitStatusDAO(daoImpl); int connectionTimeout = 5000; diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.notification/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/notification/SendEmailFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.notification/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/notification/SendEmailFunctionImplTest.java index 1eb8dbbd..52b5f5ea 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.notification/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/notification/SendEmailFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.notification/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/notification/SendEmailFunctionImplTest.java @@ -23,6 +23,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder; @@ -58,6 +59,7 @@ protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("sendEmail", new SendEmailFunctionImpl()); } diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasAnyOfTheRolesFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasAnyOfTheRolesFunctionImplTest.java index d901c259..ee02610e 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasAnyOfTheRolesFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasAnyOfTheRolesFunctionImplTest.java @@ -22,6 +22,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder; @@ -56,6 +57,7 @@ protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("hasAnyOfTheRoles", new HasAnyOfTheRolesFunctionImpl()); UserRealm userRealm = realmService.getTenantUserRealm(-1234); userRealm.getUserStoreManager().addRole("admin", new String[]{"test_user1", "test_user2"}, null); diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasRoleFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasRoleFunctionImplTest.java index a5df2214..e2751916 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasRoleFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/HasRoleFunctionImplTest.java @@ -21,6 +21,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException; @@ -58,6 +59,7 @@ protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("hasRole", new HasRoleFunctionImpl()); UserRealm userRealm = realmService.getTenantUserRealm(-1234); userRealm.getUserStoreManager().addRole("admin", new String[]{"test_user1", "test_user2"}, null); diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/IsMemberOfAnyOfGroupsFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/IsMemberOfAnyOfGroupsFunctionImplTest.java index 00f1a4f5..7b8afd19 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/IsMemberOfAnyOfGroupsFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/user/IsMemberOfAnyOfGroupsFunctionImplTest.java @@ -22,6 +22,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder; @@ -55,6 +56,7 @@ public class IsMemberOfAnyOfGroupsFunctionImplTest extends JsSequenceHandlerAbst protected void setUp() throws Exception { super.setUp(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = true; sequenceHandlerRunner.registerJsFunction("isMemberOfAnyOfGroups", new IsMemberOfAnyOfGroupsFunctionImpl()); UserRealm userRealm = realmService.getTenantUserRealm(-1234); From 0f2208c9f6c7f623a650a74ae1f3755ad63b74af Mon Sep 17 00:00:00 2001 From: rushannanayakkara Date: Tue, 21 Nov 2023 09:31:28 +0530 Subject: [PATCH 2/6] Add missing dependencies --- .../pom.xml | 6 ++++++ .../pom.xml | 6 ++++++ .../pom.xml | 6 ++++++ .../pom.xml | 6 ++++++ .../pom.xml | 6 ++++++ .../pom.xml | 13 +++++++++++++ pom.xml | 6 ++++++ 7 files changed, 49 insertions(+) diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml index 7b833e57..d233b1fc 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml @@ -109,6 +109,12 @@ org.wso2.orbit.org.apache.httpcomponents httpasyncclient + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + test + diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml index 2f62f5eb..e53ec494 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml @@ -132,6 +132,12 @@ jsr311-api test + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + test + diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml index 9c9087a0..5173d498 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml @@ -93,6 +93,12 @@ org.wso2.carbon.identity.conditional.auth.functions.test.utils test + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + test + diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml index b5a034dc..cfc3f7a6 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml @@ -108,6 +108,12 @@ org.wso2.carbon.crypto.impl test + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + test + diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml index 258605c9..6a91c125 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml @@ -68,6 +68,12 @@ runtime test + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + test + diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml index 39bbb65b..83183dc7 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml @@ -104,6 +104,19 @@ nashorn-core provided + + org.wso2.orbit.com.nimbusds + nimbus-jose-jwt + + + net.minidev + json-smart + + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + diff --git a/pom.xml b/pom.xml index 703e552c..0638a235 100644 --- a/pom.xml +++ b/pom.xml @@ -294,6 +294,12 @@ org.wso2.carbon.crypto.impl ${carbon.crypto.version} + + org.wso2.carbon.identity.organization.management.core + org.wso2.carbon.identity.organization.management.service + ${identity.organization.management.core.version} + test + From fcad6c5798d5fae50f7589e31d0b32707eabffcc Mon Sep 17 00:00:00 2001 From: rushannanayakkara Date: Tue, 21 Nov 2023 09:33:10 +0530 Subject: [PATCH 3/6] kernal, identity.framework version bump and set organization.management.core version --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0638a235..eca52424 100644 --- a/pom.xml +++ b/pom.xml @@ -474,10 +474,11 @@ - 4.6.3-m5 + 4.9.17 [4.6.0, 5.0.0) [1.0.1, 2.0.0) - 5.22.0 + 5.25.509 + 1.0.89 5.20.447 [5.14.0, 7.0.0) 1.1.17 From 977382aa7049ce95a9f91b3b5e3bea5c02a92bd1 Mon Sep 17 00:00:00 2001 From: rushannanayakkara Date: Tue, 21 Nov 2023 09:34:29 +0530 Subject: [PATCH 4/6] Change JSONObjectUtils.parseJSONObject to JSONObjectUtils.parse as changed in latest version. --- .../functions/user/MicrosoftEmailVerificationFunctionImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/MicrosoftEmailVerificationFunctionImpl.java b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/MicrosoftEmailVerificationFunctionImpl.java index 7382485d..addc7a7c 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/MicrosoftEmailVerificationFunctionImpl.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/MicrosoftEmailVerificationFunctionImpl.java @@ -78,7 +78,7 @@ private Map getIdTokenClaims(String idToken) { byte[] decoded = Base64.decodeBase64(base64Body.getBytes()); Set> jwtAttributeSet = new HashSet<>(); try { - jwtAttributeSet = JSONObjectUtils.parseJSONObject(new String(decoded)).entrySet(); + jwtAttributeSet = JSONObjectUtils.parse(new String(decoded)).entrySet(); } catch (ParseException e) { LOG.error("Error occurred while parsing JWT provided by federated IDP: ", e); } From 0cfa96705c9fa684341000dc65cd65828c6d29e0 Mon Sep 17 00:00:00 2001 From: rushannanayakkara Date: Tue, 21 Nov 2023 09:35:45 +0530 Subject: [PATCH 5/6] Use util function in place of FrameworkServiceDataHolder.getJsGraphBuilderFactory function. --- .../auth/functions/user/model/JsWrapperFactoryProvider.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/model/JsWrapperFactoryProvider.java b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/model/JsWrapperFactoryProvider.java index b6a34bc2..27308c67 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/model/JsWrapperFactoryProvider.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/model/JsWrapperFactoryProvider.java @@ -19,7 +19,7 @@ package org.wso2.carbon.identity.conditional.auth.functions.user.model; import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.openjdk.nashorn.JsOpenJdkNashornGraphBuilderFactory; -import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder; +import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils; /** * Singleton to get the appropriate Javascript Proxy Object Wrapper Factory. @@ -32,8 +32,7 @@ public class JsWrapperFactoryProvider { private JsWrapperFactoryProvider() { - if (FrameworkServiceDataHolder.getInstance(). - getJsGraphBuilderFactory() instanceof JsOpenJdkNashornGraphBuilderFactory) { + if (FrameworkUtils.createJsGraphBuilderFactoryFromConfig() instanceof JsOpenJdkNashornGraphBuilderFactory) { jsWrapperBaseFactory = new JsOpenJdkNashornWrapperFactory(); } else { jsWrapperBaseFactory = new JsWrapperFactory(); From 5386cf5eb07603d1430316046dba631d9fa04387 Mon Sep 17 00:00:00 2001 From: rushannanayakkara Date: Thu, 23 Nov 2023 17:16:15 +0530 Subject: [PATCH 6/6] Addressing comments --- .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - 6 files changed, 6 deletions(-) diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml index d233b1fc..92bbac6f 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/pom.xml @@ -112,7 +112,6 @@ org.wso2.carbon.identity.organization.management.core org.wso2.carbon.identity.organization.management.service - ${identity.organization.management.core.version} test diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml index e53ec494..12919e17 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/pom.xml @@ -135,7 +135,6 @@ org.wso2.carbon.identity.organization.management.core org.wso2.carbon.identity.organization.management.service - ${identity.organization.management.core.version} test diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml index 5173d498..fcc79a6e 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.elk/pom.xml @@ -96,7 +96,6 @@ org.wso2.carbon.identity.organization.management.core org.wso2.carbon.identity.organization.management.service - ${identity.organization.management.core.version} test diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml index cfc3f7a6..16d1b847 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.http/pom.xml @@ -111,7 +111,6 @@ org.wso2.carbon.identity.organization.management.core org.wso2.carbon.identity.organization.management.service - ${identity.organization.management.core.version} test diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml index 6a91c125..dda2474d 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.session/pom.xml @@ -71,7 +71,6 @@ org.wso2.carbon.identity.organization.management.core org.wso2.carbon.identity.organization.management.service - ${identity.organization.management.core.version} test diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml b/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml index 83183dc7..8918cf0c 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.user/pom.xml @@ -115,7 +115,6 @@ org.wso2.carbon.identity.organization.management.core org.wso2.carbon.identity.organization.management.service - ${identity.organization.management.core.version}