From 6628d97745973282b98d9b40f09ba9c4193f4d9c Mon Sep 17 00:00:00 2001 From: GDLMadushanka Date: Fri, 4 Aug 2017 18:19:51 +0530 Subject: [PATCH 001/111] Fix for 1261 --- .pom.xml.swp | Bin 0 -> 16384 bytes .../jaggeryapps/devicemgt/api/device-api.jag | 1 + .../oauth/token-protected-service-invokers.js | 8 +++++--- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .pom.xml.swp diff --git a/.pom.xml.swp b/.pom.xml.swp new file mode 100644 index 0000000000000000000000000000000000000000..f89e01a40fab8e125782d12895c2d487b7de7fcc GIT binary patch literal 16384 zcmeHNON=8&8E%#&FhEE|Bm@!?wGJpVV!GO%nPjs|uY;N0C01s}!+3T#D|Qsx?XstL z?Cz$k+a3d16cOg1 zx4WGYFZDwypcHsz6u4EJpDV>%{m#Nsa>tv_zA|A|6s3StKq;UUPzopolmbctrGQf4 zP$&@kZ`D4Ao*t3CJtx0kmHWOfKTGoZ`5gaW$v+^ke!$2L z+K+$b_)q8fe@Z^BXr9UOFXq~RmmF{!{~wZnzifYyS5-5%T z*IfJE9RGsk)Bb-y$Nxq0ss6X$G#dZUl27O5VvhflTVe zR`Pd9{;?b{FRL%5fKosypcGIFC`xfA7)XI+mj{;TT z2yg}U`453l0Pg|b4qV5Xz>k5;zy@#s{E*K<6gnM#xR+7#))B>9N7xhHuIIkI;m{-=!o7_BG2A{4BSa6-EK$M$&Wf3YyNg zL*@#dvA(6*u-UxdrGBW}9S5DAz?gL{r=xSBKrn&1XGP)WjdjOnBKteG6~?dAP0&c6 zH7wuPMN=4r@bm(`6R@}X&niwW&w7s>eXi>_o`j?>9%tcPjD=80#T!{=#{ z-c!`;E0xvy{k8R+J{Xm~Wwjl*UB-K}LfG_Y5+(B|Z{$tec&}#2#QH{)x|mniIVbN) z3+QPvp7`N4O*8$#y98kg-syGu$$}KCYxS5*E%bMjQHW-&)|QPpLLsp{vCW+w>wdpa z`}48gT(MX(9$a3k!?A1Wj>|*KwHds)bArbgmptS!Oze*P-i?vHx)ZzTy@iL04;AS) zZx-UUD{er9Tqcpo-vs%REaA0fmopk)=03AU?j;?|ZAZ9;k+z3$Bv1b^ZR@*>!ThvbI)PS+Ab1liC_ttgW1?u2*X-_;rRd%a1f2 z9tKV$5?f%`_=v+t3_KTui2cvHxTkUwun$E}0N2KV;BJB&g4O6S2+cJwLi$iRYn9BLT*CxykZCcm1v#;WnRkk)Gnn(;21G zY%@bDoeo(OKAfyE)OS6s7ESz}(#-p?>4?lECkrK7ED-$j@|uwUWFZP$`n`qw%9^PE zb=2fv07U(tKL7j<>it!q29$uSsPTUT{1o^MFb}*L_%-VLuL2Bs8}KaRJOO+i_!=PM zejZRCrGQdEDWDWk3Md7X0!jg;fKosyFjfJaWh4g&!$YIMLlGVBoc0oY%%rrxWc943 zXH&lA_~kH&@MvWWq2ZWJSfUE&A(drOd7hT$XoX?Z-QI!9h_IJ4&ZIz;%o@P>-#EisdX^}npghD(VktZ5`PC2t99DNLu2eRq%!|c&gDZbV#VIn8-!Ldg2 dF*DYD;95RTqSC-(VI0%NF+uOxNZ7og_CI7u%0&PG literal 0 HcmV?d00001 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag index e49a8afba2..84a9b98bdc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag @@ -45,6 +45,7 @@ if (!user) { } else { queryString = "?" + queryString; } + var deviceType = request.getParameter("deviceType"); // need a better solution here deviceTypeConfig = utility.getDeviceTypeConfig(deviceType); if (deviceTypeConfig && deviceTypeConfig.deviceType.downloadAgentUri) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js index efcb3c6cae..cfde7134b6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js @@ -39,7 +39,7 @@ var invokers = function () { var constants = require("/app/modules/constants.js"); var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var tokenUtil = require("/app/modules/oauth/token-handlers.js")["handlers"]; - + var tokenHandler = require("/app/modules/oauth/token-handler-utils.js")["utils"]; /** * This method reads the token pair from the session and return the access token. * If the token pair is not set in the session, this will return null. @@ -259,10 +259,12 @@ var invokers = function () { var wsRequest = new ws.WSRequest(); var options = []; if (devicemgtProps["isOAuthEnabled"]) { - var accessToken = privateMethods.getAccessToken(); + var adminUsername = devicemgtProps["adminUser"]; + var accessToken = tokenHandler.getJwtToken(adminUsername); + var decoded = tokenHandler.encode(accessToken); if (accessToken) { var authenticationHeaderName = String(constants["AUTHORIZATION_HEADER"]); - var authenticationHeaderValue = String(constants["BEARER_PREFIX"] + accessToken); + var authenticationHeaderValue = String(constants["BEARER_PREFIX"] + decoded); var headers = []; var oAuthAuthenticationData = {}; oAuthAuthenticationData.name = authenticationHeaderName; From 4ef26cc12a18f838f37b105d0170856aa876c4e3 Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Wed, 9 Aug 2017 11:07:07 +0530 Subject: [PATCH 002/111] Fixing product-iots#1281 Fixed https://github.com/wso2/product-iots/issues/1281 --- .../app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs index eb788c4a81..49f4e02bad 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs @@ -764,7 +764,7 @@ stationaryAlert.addClass("geo-alert"); var withinAlert = createGeoToolListItem(geoPublicUri + '/assets/html_templates/modal/within_alert.html', - 'Add Geofence Alert', 'glyphicon glyphicon-log-in', geoToolsMenu); + 'Add Geofence Enter Alert', 'glyphicon glyphicon-log-in', geoToolsMenu); withinAlert.addClass("geo-alert"); var exitAlert = createGeoToolListItem(geoPublicUri + '/assets/html_templates/modal/exit_alert.html', From 9a12dfb91bbcb7975534a089b9503af7bdedbb1f Mon Sep 17 00:00:00 2001 From: kamidu Date: Thu, 10 Aug 2017 16:49:02 +0530 Subject: [PATCH 003/111] enable JS level audit logs for device cloud --- .../app/modules/oauth/token-protected-service-invokers.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js index cfde7134b6..5f8462a795 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js @@ -116,6 +116,11 @@ var invokers = function () { log.debug("Request payload if any : " + stringify(requestPayload)); log.debug("Response status : " + xmlHttpRequest.status); log.debug("Response payload if any : " + xmlHttpRequest.responseText); + if (devicemgtProps["isCloud"]) { + log.info("Request : " + httpMethod + " " + endpoint); + log.info("Request payload if any : " + stringify(requestPayload)); + log.info("Response status : " + xmlHttpRequest.status); + } if (xmlHttpRequest.status == 401) { if ((xmlHttpRequest.responseText == TOKEN_EXPIRED || From b7433ccbbbc9ee156450d6be66ff2e368d5022f5 Mon Sep 17 00:00:00 2001 From: kamidu Date: Thu, 10 Aug 2017 16:50:26 +0530 Subject: [PATCH 004/111] fixing the ui text issues in device cloud --- .../app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs index 9b726e0a63..5b8f29183a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.hbs @@ -175,7 +175,7 @@ Upgrade Now - Request Exception + Request Extension From 326afc3f06507dc0946bab22f0b76af5383155cd Mon Sep 17 00:00:00 2001 From: kamidu Date: Thu, 10 Aug 2017 16:51:08 +0530 Subject: [PATCH 005/111] Enabling ios platform configurations on Device cloud --- .../configuration.hbs | 113 ++++++++++-------- .../configuration.js | 4 +- .../cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs | 38 ++++-- 3 files changed, 95 insertions(+), 60 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs index 051fb23592..b6fd58752f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs @@ -27,26 +27,37 @@ Platform Configurations
- General and Platform Specific Server Settings for the Tenant + {{#if isCloud}} + iOS Mobile Management Related Specific Server Settings for the Tenant + {{else}} + General and Platform Specific Server Settings for the Tenant + {{/if}} +

- - - - - - - + + {{unless isCloud}} + + + + + + + + - - General Configurations - + General Configurations + + {{/unless}} {{#each deviceTypes}} - + @@ -62,50 +73,52 @@
-
-
- -
-