diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml index ed61a4a115..bb8e00495d 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml @@ -29,7 +29,7 @@ admin - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java index 84ebc86365..1b7a88dd3b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java @@ -47,7 +47,7 @@ public class IOTServerConfigurationTest extends BaseAPIHandlerTest { Assert.assertEquals(serverConfiguration.getUsername(), "testuser"); Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd"); Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(), - "https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register"); + "https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register"); Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(), "https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token"); Assert.assertEquals(serverConfiguration.getApis().size(), 1); @@ -87,7 +87,7 @@ public class IOTServerConfigurationTest extends BaseAPIHandlerTest { Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd"); Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(), "https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT - + "/client-registration/v0.11/register"); + + "/client-registration/v0.12/register"); Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(), "https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT + "/oauth2/token"); diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml index b7519e99ac..25110b26a6 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml @@ -29,7 +29,7 @@ testuserpwd - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid.xml index 9951e7b98e..67ffc7fd8c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid.xml @@ -29,7 +29,7 @@ testuserpwd - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml index fcb53bd009..73af43c45f 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml @@ -29,7 +29,7 @@ testuserpwd - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/TestTaskManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/TestTaskManagerImpl.java index 6eda125c3f..c673c584b0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/TestTaskManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/task/TestTaskManagerImpl.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.core.task; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; +import org.wso2.carbon.ntask.core.impl.LocalTaskActionListener; import java.util.ArrayList; import java.util.List; @@ -96,4 +97,9 @@ public class TestTaskManagerImpl implements TaskManager { public boolean isTaskScheduled(String taskName) throws TaskException { return this.registeredTasks.size() > 0; } + + @Override + public void registerLocalTaskActionListener(LocalTaskActionListener localTaskActionListener, String s) { + + } } diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java index 58c975bbec..f4745548dd 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java @@ -30,6 +30,8 @@ import org.wso2.carbon.identity.oauth.cache.OAuthCache; import org.wso2.carbon.identity.oauth.cache.OAuthCacheKey; import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; +import org.wso2.carbon.identity.oauth2.dao.OAuthScopeDAO; +import org.wso2.carbon.identity.oauth2.dao.OAuthScopeDAOImpl; import org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO; import org.wso2.carbon.identity.oauth2.model.AccessTokenDO; import org.wso2.carbon.identity.oauth2.model.ResourceScopeCacheEntry; @@ -62,7 +64,8 @@ public class ExtendedJDBCScopeValidator extends OAuth2ScopeValidator { } String resourceScope = null; - TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); +// TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); + OAuthScopeDAOImpl scopeDAO = new OAuthScopeDAOImpl(); boolean cacheHit = false; // Check the cache, if caching is enabled. @@ -79,7 +82,7 @@ public class ExtendedJDBCScopeValidator extends OAuth2ScopeValidator { } if (!cacheHit) { - resourceScope = tokenMgtDAO.findScopeOfResource(resource); + resourceScope = scopeDAO.findScopeOfResource(resource); if (OAuthServerConfiguration.getInstance().isCacheEnabled()) { OAuthCache oauthCache = OAuthCache.getInstance(); @@ -112,7 +115,7 @@ public class ExtendedJDBCScopeValidator extends OAuth2ScopeValidator { try { //Get the permissions associated with the scope, if any - Set permissionsOfScope = tokenMgtDAO.getRolesOfScopeByScopeKey(resourceScope); + Set permissionsOfScope = scopeDAO.getBindingsOfScopeByScopeName(resourceScope); //If the scope doesn't have any permissions associated with it. if(permissionsOfScope == null || permissionsOfScope.isEmpty()){ diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java index 5be19a5a0c..ef720b15ad 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java @@ -26,6 +26,9 @@ import org.wso2.carbon.device.mgt.oauth.extensions.internal.OAuthExtensionsDataH import org.wso2.carbon.identity.application.common.model.User; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; +import org.wso2.carbon.identity.oauth2.dao.OAuthScopeDAO; +import org.wso2.carbon.identity.oauth2.dao.OAuthScopeDAOImpl; +import org.wso2.carbon.identity.oauth2.dao.OAuthTokenPersistenceFactory; import org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO; import org.wso2.carbon.identity.oauth2.model.AccessTokenDO; import org.wso2.carbon.identity.oauth2.validators.OAuth2ScopeValidator; @@ -56,7 +59,11 @@ public class PermissionBasedScopeValidator extends OAuth2ScopeValidator { return true; } - TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); + OAuthScopeDAO pp = OAuthTokenPersistenceFactory.getInstance().getOAuthScopeDAO(); + int tid = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); + +// TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); + OAuthScopeDAOImpl nn = new OAuthScopeDAOImpl(); List scopeList = new ArrayList<>(Arrays.asList(scopes)); @@ -71,7 +78,7 @@ public class PermissionBasedScopeValidator extends OAuth2ScopeValidator { try { //Get the permissions associated with the scope, if any - Set permissionsOfScope = tokenMgtDAO.getRolesOfScopeByScopeKey(resourceScope); + Set permissionsOfScope = pp.getBindingsOfScopeByScopeName(resourceScope, tid); //If the scope doesn't have any permissions associated with it. if(permissionsOfScope == null || permissionsOfScope.isEmpty()){ diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java index 593d9d0c89..6fd79eac17 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java @@ -28,6 +28,7 @@ import org.wso2.carbon.identity.base.IdentityConstants; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.core.util.IdentityUtil; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; +import org.wso2.carbon.identity.oauth2.dao.OAuthScopeDAOImpl; import org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO; import org.wso2.carbon.identity.oauth2.model.AccessTokenDO; import org.wso2.carbon.identity.oauth2.validators.OAuth2ScopeValidator; @@ -61,7 +62,8 @@ public class RoleBasedScopeValidator extends OAuth2ScopeValidator { return true; } - TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); +// TokenMgtDAO tokenMgtDAO = new TokenMgtDAO(); + OAuthScopeDAOImpl scopeDAO = new OAuthScopeDAOImpl(); List scopeList = new ArrayList<>(Arrays.asList(scopes)); @@ -76,7 +78,7 @@ public class RoleBasedScopeValidator extends OAuth2ScopeValidator { try { //Get the roles associated with the scope, if any - Set rolesOfScope = tokenMgtDAO.getRolesOfScopeByScopeKey(resourceScope); + Set rolesOfScope = scopeDAO.getBindingsOfScopeByScopeName(resourceScope); //If the scope doesn't have any roles associated with it. if(rolesOfScope == null || rolesOfScope.isEmpty()){ diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/task/TestTaskManagerImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/task/TestTaskManagerImpl.java index cf15c76b0a..3d3f40c0ec 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/task/TestTaskManagerImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/task/TestTaskManagerImpl.java @@ -21,6 +21,7 @@ package org.wso2.carbon.policy.mgt.core.task; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; +import org.wso2.carbon.ntask.core.impl.LocalTaskActionListener; import java.util.ArrayList; import java.util.List; @@ -97,4 +98,9 @@ public class TestTaskManagerImpl implements TaskManager { public boolean isTaskScheduled(String taskName) throws TaskException { return this.registeredTasks.size() > 0; } + + @Override + public void registerLocalTaskActionListener(LocalTaskActionListener localTaskActionListener, String s) { + + } } diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 18fefe60f5..0aba564bc0 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -184,6 +184,12 @@ org.wso2.carbon.identity.framework org.wso2.carbon.identity.core + + + org.slf4j + slf4j-api + + org.wso2.carbon.identity.inbound.auth.oauth2 @@ -217,10 +223,6 @@ commons-httpclient.wso2 commons-httpclient - - org.testng - testng - commons-pool.wso2 commons-pool diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml index ed61a4a115..bb8e00495d 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml @@ -29,7 +29,7 @@ admin - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml index dfabaf24f5..d6f08a2853 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml @@ -19,7 +19,7 @@ --> - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register https://${iot.gateway.host}:${iot.gateway.https.port}/token https://${iot.apimpublisher.host}:${iot.apimpublisher.https.port}/api/am/publisher/v0.11 https://${iot.apimstore.host}:${iot.apimstore.https.port}/api/am/store/v0.11 diff --git a/pom.xml b/pom.xml index 0e7e03645c..189f63fefd 100644 --- a/pom.xml +++ b/pom.xml @@ -401,6 +401,10 @@ org.wso2.securevault org.wso2.securevault + + org.mockito + mockito-core + @@ -884,6 +888,16 @@ org.wso2.carbon.identity.framework org.wso2.carbon.identity.core ${carbon.identity.framework.version} + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-testng + + org.wso2.carbon.identity.inbound.auth.oauth2 @@ -904,6 +918,24 @@ org.wso2.carbon.identity.inbound.auth.oauth2 org.wso2.carbon.identity.oauth ${identity.inbound.auth.oauth.version} + + + org.apache.tomcat + tomcat-coyote + + + org.wso2.carbon.consent.mgt + org.wso2.carbon.consent.mgt.core + + + org.wso2.carbon.identity.framework + org.wso2.carbon.identity.event + + + org.wso2.carbon.identity.framework + org.wso2.carbon.identity.testutil + + org.wso2.carbon.identity.framework @@ -914,11 +946,27 @@ org.wso2.carbon.identity.framework org.wso2.carbon.user.mgt ${carbon.identity.framework.version} + + + org.slf4j + log4j-over-slf4j + + org.wso2.carbon.identity.framework org.wso2.carbon.identity.base ${carbon.identity.framework.version} + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-testng + + @@ -1293,6 +1341,10 @@ org.wso2.carbon.identity org.wso2.carbon.user.mgt + + org.powermock + powermock-api-mockito + @@ -1808,7 +1860,7 @@ 2.2.1 6.1.1 - 4.4.17 + 4.4.24 4.4.9 [4.4.0, 5.0.0) 1.5.4 @@ -1849,13 +1901,13 @@ 7.0.34.wso2v2 - 4.7.2 + 4.7.10 - 5.7.0 + 5.11.120 [5.0.0, 6.0.0) - 5.3.1 - 5.3.0 + 5.6.51 + 5.4.4 1.0.2 [1.0.2, 2.0.0) @@ -1864,10 +1916,10 @@ [5.1.0, 6.0.0) - 4.6.1 + 4.6.8 - 4.7.8 + 4.7.23 1.2.11-wso2v10 @@ -1878,7 +1930,7 @@ 3.0.244-SNAPSHOT - 4.4.8 + 4.6.21 1.4.0.wso2v1 [1.4.0,2.0.0) 2.4.0.wso2v1 @@ -1886,7 +1938,7 @@ [2.6.0,3.0.0) - 6.1.109 + 6.2.146 (6.0.0,7.0.0] @@ -1897,7 +1949,7 @@ 2.1.10 - 4.6.8 + 4.6.28 4.6.8 [4.4.8, 5.0.0) @@ -1969,7 +2021,7 @@ 2.5 - 1.0.2 + 1.0.10 2.6.1.wso2v1 2.6.1.wso2v3 2.8.2.wso2v1 @@ -1985,7 +2037,7 @@ [1.0.0, 1.1.0) - 1.6.1 + 1.7.0 2.3.2