From c73866cf44cad2be9a91ea1e2a3a77fcc29d9c2a Mon Sep 17 00:00:00 2001 From: "Kotagiri, Ramprasad (rp5662)" Date: Mon, 3 Feb 2020 13:43:25 -0500 Subject: DCAE dashboard security fixes Portal SDK ver 2.6.0, non-root user for docker container Change label on Dashboard Home page, API changes, Container optimization Change-Id: Ie2c8efd76d34fddc2b182d5ed494761522695914 Issue-ID: DCAEGEN2-1638 Issue-ID: CCSDK-1485 Issue-ID: DCAEGEN2-1921 Issue-ID: DCAEGEN2-1915 Issue-ID: DCAEGEN2-1856 Issue-ID: DCAEGEN2-1556 Issue-ID: DCAEGEN2-1592 Signed-off-by: Kotagiri, Ramprasad (rp5662) --- ccsdk-app-overlay/pom.xml | 4 +- .../webapp/app/ccsdk/home/api-docs-controller.js | 42 +++++++++++++++++++ .../src/main/webapp/app/ccsdk/home/api_doc.html | 26 ++++++++++++ .../src/main/webapp/app/ccsdk/home/appDS2.js | 25 ++++++++++-- .../webapp/app/ccsdk/home/controller-service.js | 35 ++++++++++++++++ .../webapp/app/ccsdk/home/executions_view.html | 2 +- .../src/main/webapp/app/ccsdk/home/oom-router.js | 42 ++++--------------- .../src/main/webapp/app/ccsdk/home/oom_spa.html | 47 +++++++++++++++++----- .../main/webapp/app/ccsdk/home/rest-api-spec.html | 27 +++++++++++++ .../app/fusion/scripts/DS2-view-models/footer.html | 13 ++++++ .../scripts/DS2-view-models/header-logo.html | 3 ++ .../fusion/scripts/DS2-view-models/welcome.html | 2 +- 12 files changed, 216 insertions(+), 52 deletions(-) create mode 100644 ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api-docs-controller.js create mode 100644 ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api_doc.html create mode 100644 ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/rest-api-spec.html create mode 100644 ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/footer.html create mode 100644 ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/header-logo.html (limited to 'ccsdk-app-overlay') diff --git a/ccsdk-app-overlay/pom.xml b/ccsdk-app-overlay/pom.xml index 135ba23..b9b7809 100644 --- a/ccsdk-app-overlay/pom.xml +++ b/ccsdk-app-overlay/pom.xml @@ -6,12 +6,12 @@ org.onap.ccsdk.dashboard ccsdk-app-parent - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT org.onap.ccsdk.dashboard ccsdk-app-overlay - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT war ONAP Operations Manager Dashboard overlay CCSDK Dashboard web resources diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api-docs-controller.js b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api-docs-controller.js new file mode 100644 index 0000000..6ac9839 --- /dev/null +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api-docs-controller.js @@ -0,0 +1,42 @@ +/******************************************************************************* + * =============LICENSE_START========================================================= + * + * ================================================================================= + * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + +appDS2.controller('apiDocsController',function( + $scope, ControllerService){ + + 'use strict'; + + // this object holds all app data and functions + $scope.ecdapp = {}; + $scope.ecdapp.apiSpec = ''; + + var getApiSpecs = function(){ + ControllerService.getApiSwaggerSpec().then(function(jsonObj) { + $scope.ecdapp.apiSpec = JSON.stringify(jsonObj, undefined, 4); + }, function(error) { + alert('Failed to get REST API spec file'); + }); + } + + // Populate the page on load + getApiSpecs(); + +}); diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api_doc.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api_doc.html new file mode 100644 index 0000000..342406c --- /dev/null +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/api_doc.html @@ -0,0 +1,26 @@ + +
+ +
\ No newline at end of file diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/appDS2.js b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/appDS2.js index c8f7071..ebb35cd 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/appDS2.js +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/appDS2.js @@ -1,3 +1,24 @@ +/******************************************************************************* + * =============LICENSE_START========================================================= + * + * ================================================================================= + * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + /* Angular application for the EC Dashboard web UI */ var appDS2 = angular.module("abs", [ @@ -6,6 +27,4 @@ var appDS2 = angular.module("abs", 'b2b.att', 'modalServices' ] - ).config(function($sceDelegateProvider) { - $sceDelegateProvider.resourceUrlWhitelist(['**']); - }); + ); diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/controller-service.js b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/controller-service.js index 389a44c..65495f1 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/controller-service.js +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/controller-service.js @@ -1,3 +1,24 @@ +/******************************************************************************* + * =============LICENSE_START========================================================= + * + * ================================================================================= + * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + *******************************************************************************/ + appDS2.factory('ControllerService', function ($http, $q, $log) { return { /** @@ -18,6 +39,20 @@ appDS2.factory('ControllerService', function ($http, $q, $log) { return $q.reject(error.statusText); }); }, + getApiSwaggerSpec: function() { + return $http({ + method: 'GET', + url: 'nb-api/api-docs', + cache: true, + responseType: 'json' + }).then(function(response) { + return response.data; + }, + function(error) { + $log.error('ControllerService.getApiSwaggerSpec failed: ' + JSON.stringify(error)); + return $q.reject(error.statusText); + }); + }, /** * Gets the cloudify tenant names. * diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/executions_view.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/executions_view.html index f8acb8b..5623b1c 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/executions_view.html +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/executions_view.html @@ -1,5 +1,5 @@
-

ONAP Operations Manager {{ecdapp.appLabel}}

+

DCAE Dashboard

diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom-router.js b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom-router.js index 7ec5537..592ab15 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom-router.js +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom-router.js @@ -2,7 +2,7 @@ * =============LICENSE_START========================================================= * * ================================================================================= - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +17,16 @@ * limitations under the License. * ============LICENSE_END========================================================= * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. *******************************************************************************/ appDS2.config(function($routeProvider) { $routeProvider - .when('/orgchart', { - /* horizontal layout */ - templateUrl: 'app/ccsdk/home/tree_view.html', - controller : 'treeViewController' + .when('/api', { + templateUrl: 'app/ccsdk/home/api_doc.html', + controller : '' + }) + .when('/api-spec', { + templateUrl: 'app/ccsdk/home/rest-api-spec.html', + controller : 'apiDocsController' }) .when('/ibp', { templateUrl: 'app/ccsdk/inventory/inventory_blueprint_table.html', @@ -82,34 +84,6 @@ appDS2.config(function($routeProvider) { templateUrl: 'app/fusion/scripts/DS2-view-models/ds2-admin/usage.html', controller: 'usageListControllerDS2' }) - .when('/cfy', { - templateUrl: 'app/ccsdk/ops/tabs_view.html', - controller: 'tabsController', - item: 'cfy' - }) - .when('/cnsl', { - templateUrl: 'app/ccsdk/ops/tabs_view.html', - controller: 'tabsController', - item: 'cnsl' - }) - .when('/grf', { - templateUrl: 'app/ccsdk/ops/tabs_view.html', - controller: 'tabsController', - item: 'grf' - }) - .when('/k8s', { - templateUrl: 'app/ccsdk/ops/tabs_view.html', - controller: 'tabsController', - item: 'k8s' - }) - .when('/prom', { - templateUrl: 'app/ecdapp/ops/tabs_view.html', - controller: 'tabsController', - item: 'prom' - }) - .when('/dbcl', { - templateUrl: 'app/ecdapp/ops/dbcl_view.html' - }) .otherwise({ templateUrl: 'app/ccsdk/home/executions_view.html', controller : 'executionsViewController' diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom_spa.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom_spa.html index 74651a9..fabb450 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom_spa.html +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/oom_spa.html @@ -1,20 +1,42 @@ + + - + - OOM Dashboard + DCAE Dashboard - - - - - - + + + + + + - + @@ -48,12 +70,15 @@ + + + + diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/rest-api-spec.html b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/rest-api-spec.html new file mode 100644 index 0000000..56ee149 --- /dev/null +++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/home/rest-api-spec.html @@ -0,0 +1,27 @@ + +
+

REST API Specifications

+
+{{ecdapp.apiSpec}}
+
+
\ No newline at end of file diff --git a/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/footer.html b/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/footer.html new file mode 100644 index 0000000..65ac372 --- /dev/null +++ b/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/footer.html @@ -0,0 +1,13 @@ +
+
+ +
+
\ No newline at end of file diff --git a/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/header-logo.html b/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/header-logo.html new file mode 100644 index 0000000..942af9b --- /dev/null +++ b/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/header-logo.html @@ -0,0 +1,3 @@ +
+ DCAE Dashboard +
\ No newline at end of file diff --git a/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/welcome.html b/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/welcome.html index 66c38e0..1c90f97 100644 --- a/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/welcome.html +++ b/ccsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-view-models/welcome.html @@ -10,7 +10,7 @@

- Redirecting to the ONAP Operations Manager Dashboard.. + Redirecting to the DCAE Dashboard..

-- cgit 1.2.3-korg