From 5caa68801477fcf2960e16e205a28023e22c4b85 Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 9 Jan 2017 12:35:04 +0530 Subject: [PATCH 1/6] Fixed issue in populating server.ip property. --- .../main/resources/jaggeryapps/devicemgt/app/conf/config.json | 2 +- .../jaggeryapps/devicemgt/app/modules/conf-reader/main.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index 8b923a9b82..95996fb6bb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -5,7 +5,7 @@ "httpsWebURL" : "%https.ip%", "wssURL" : "https://localhost:9445", "wsURL" : "%http.ip%", - "portalURL": "https://${server.ip}:9445", + "portalURL": "https://%server.ip%:9445", "dashboardServerURL" : "%https.ip%", "androidEnrollmentDir": "/android-web-agent/enrollment", "windowsEnrollmentDir": "/windows-web-agent/enrollment", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js index f81849fe3b..8e02b70ff3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/conf-reader/main.js @@ -33,6 +33,9 @@ var conf = function () { } else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) { var year = new Date().getFullYear(); return value.replace("%date-year%", year); + } else if ((typeof value === "string") && value.indexOf("%server.ip%") > -1) { + var getProperty = require("process").getProperty; + return value.replace("%server.ip%", getProperty("carbon.local.ip")); } return value; } From c909144589897b868f7bec601b873d83abf99315 Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 9 Jan 2017 15:02:10 +0530 Subject: [PATCH 2/6] Add select2 controller to select roles to share a group --- .../app/pages/cdmf.page.groups/groups.hbs | 21 +++++++++-- .../cdmf.page.groups/public/js/listing.js | 37 +++++-------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index da79afe1bd..198890e4ba 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -119,10 +119,9 @@

Select user role(s) -

-
-

+
+
'; - $('.roleCheckBoxes').each( - function () { - if (data.roles[i] == $(this).data('role-name')) { - $(this).attr('checked', true); - } - } - ); + html += ''; } + html += ''; $("#rolesListing").html(html); markAlreadySavedUsersRoles(groupId); + $("select.select2[multiple=multiple]").select2({ + tags: false + }); } else { $("#rolesListing").html("No roles available"); } From 9d5061230c87b5be023e3963776cd64e4f0e45e2 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 10 Jan 2017 09:27:10 +0530 Subject: [PATCH 3/6] fixing test failures (cherry picked from commit ac8dae7) --- .../src/test/resources/testng.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml index b30b66cb78..32c9dca57d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml @@ -31,7 +31,7 @@ - + From 819074833f88520a245db67f57d38eb846771ac8 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 10 Jan 2017 03:09:42 +0530 Subject: [PATCH 4/6] added missing components (cherry picked from commit b35e0dd) --- .../pom.xml | 7 +++++++ .../device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml | 5 +++++ pom.xml | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index 0cc36fe99e..8c8d0665d6 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -48,6 +48,10 @@ org.wso2.orbit.org.scannotation scannotation + + io.swagger + swagger-annotations + @@ -137,6 +141,9 @@ org.wso2.orbit.org.scannotation:scannotation:${scannotation.version} + + io.swagger:swagger-annotations:${swagger.version} + org.wso2.carbon.core.server:${carbon.kernel.version} diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index 3ba32fa1bc..ee5fa7b255 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -48,6 +48,10 @@ javax.servlet.jsp javax.servlet.jsp-api + + org.wso2.carbon.store + org.wso2.store.sso.common + @@ -76,6 +80,7 @@ javax.servlet.jsp:javax.servlet.jsp-api + org.wso2.carbon.store:org.wso2.store.sso.common:${carbon.store.sso.common.version} diff --git a/pom.xml b/pom.xml index e9339f6644..76fb99e3b2 100644 --- a/pom.xml +++ b/pom.xml @@ -1664,6 +1664,11 @@ wss4j ${org.apache.ws.security.wso2.version} + + org.wso2.carbon.store + org.wso2.store.sso.common + ${carbon.store.sso.common.version} + @@ -2059,6 +2064,9 @@ 2.1.7-wso2v7 1.5.11.wso2v15 + + + 1.4.4 From cb7ff7f66a1200472a4dc3b72d49a73220724352 Mon Sep 17 00:00:00 2001 From: charitha Date: Tue, 10 Jan 2017 10:18:28 +0530 Subject: [PATCH 5/6] Change package name to lower case --- .../device/mgt/core/{Search => search}/DeviceDetails.java | 0 .../carbon/device/mgt/core/{Search => search}/SearchDevice.java | 0 .../carbon/device/mgt/core/{Search => search}/util/Utils.java | 0 .../src/test/resources/testng.xml | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/{Search => search}/DeviceDetails.java (100%) rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/{Search => search}/SearchDevice.java (100%) rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/{Search => search}/util/Utils.java (100%) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/DeviceDetails.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/DeviceDetails.java similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/DeviceDetails.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/DeviceDetails.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/SearchDevice.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/SearchDevice.java similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/SearchDevice.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/SearchDevice.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/util/Utils.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/util/Utils.java similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/util/Utils.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/util/Utils.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml index 32c9dca57d..b30b66cb78 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml @@ -31,7 +31,7 @@ - + From 562631cc1d639c8d923866fb4dd0196c60845507 Mon Sep 17 00:00:00 2001 From: Milan Perera Date: Tue, 10 Jan 2017 11:36:45 +0530 Subject: [PATCH 6/6] Fixed scopes related issue in SAML Granttype --- .../devicemgt/app/modules/oauth/token-handlers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js index d9d51101c1..1365fed267 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js @@ -90,9 +90,15 @@ var handlers = function () { "missing - setupTokenPairByPasswordGrantType(x, y)"); } else { var tokenData; + var arrayOfScopes = devicemgtProps["scopes"]; + var stringOfScopes = ""; + arrayOfScopes.forEach(function (entry) { + stringOfScopes += entry + " "; + }); + // accessTokenPair will include current access token as well as current refresh token tokenData = tokenUtil. - getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, "PRODUCTION"); + getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, stringOfScopes); if (!tokenData) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up token " + "pair by password grant type. Error in token " +