You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by DylanVolz <gi...@git.apache.org> on 2017/08/08 22:56:33 UTC

[GitHub] incubator-trafficcontrol pull request #790: [CDN-240] build ui for managing ...

GitHub user DylanVolz opened a pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790

    [CDN-240] build ui for managing url sig keys,

    	this also adds a view by id route for url sig keys
    	and adds auditing to the copy keys api route

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/DylanVolz/incubator-trafficcontrol url-sig-key-ui

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafficcontrol/pull/790.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #790
    
----
commit 28aeeb62adf09a97e2e9db59da978f9c33865e7f
Author: Dylan Volz <dy...@comcast.com>
Date:   2017-08-04T16:35:17Z

    [CDN-240] build ui for managing url sig keys,
    	this also adds a view by id route for url sig keys
    	and adds auditing to the copy keys api route

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134324139
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/DeliveryServiceUrlSigKeysController.js ---
    @@ -0,0 +1,100 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysController = function(deliveryService, urlSigKeys, $scope, $state, locationUtils, deliveryServiceService, deliveryServiceUrlSigKeysService, $uibModal) {
    +	$scope.deliveryService = deliveryService;
    +	$scope.urlSigKeys = Object.keys(urlSigKeys).map(function(key) {
    +			return {sortBy: parseInt(key.slice(3)), label: key, urlSigKey: urlSigKeys[key]};
    --- End diff --
    
    maybe a comment here about what exactly is going on here...or maybe an example of what the result is?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-trafficcontrol-PR-trafficops-test/79/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134322151
  
    --- Diff: traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js ---
    @@ -169,9 +169,9 @@ var FormDeliveryServiceController = function(deliveryService, type, types, $scop
         };
     
         $scope.manageUrlSigKeys = function() {
    -        alert('not hooked up yet: manageUrlSigKeys for DS');
    +        $location.path($location.path() + '/urlSigKeys');
    --- End diff --
    
    can you make this url-sig-keys to match the other urls?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: WIP - [TC-336] build ui for managing ur...

Posted by DylanVolz <gi...@git.apache.org>.
Github user DylanVolz commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    waiting to merge on https://issues.apache.org/jira/browse/TC-547


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134324745
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/DeliveryServiceUrlSigKeysController.js ---
    @@ -0,0 +1,100 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysController = function(deliveryService, urlSigKeys, $scope, $state, locationUtils, deliveryServiceService, deliveryServiceUrlSigKeysService, $uibModal) {
    +	$scope.deliveryService = deliveryService;
    +	$scope.urlSigKeys = Object.keys(urlSigKeys).map(function(key) {
    +			return {sortBy: parseInt(key.slice(3)), label: key, urlSigKey: urlSigKeys[key]};
    +	});
    +
    +	$scope.generateUrlSigKeys = function() {
    +        var params = {
    +            title: 'Confirmation required',
    +            message: 'Are you sure you want to generate new URL signature keys for ' + deliveryService.displayName + '?'
    +        };
    +        var modalInstance = $uibModal.open({
    +            templateUrl: 'common/modules/dialog/confirm/dialog.confirm.tpl.html',
    +            controller: 'DialogConfirmController',
    +            size: 'md',
    +            resolve: {
    +                params: function () {
    +                    return params;
    +                }
    +            }
    +        });
    +        modalInstance.result
    +            .then(
    +            function() {
    +                deliveryServiceUrlSigKeysService.generateUrlSigKeys(deliveryService.xmlId).then(
    +                function() {
    +                    $scope.refresh();
    +                });
    +            });
    +	};
    +
    +	$scope.refresh = function() {
    +		$state.reload(); // reloads all the resolves for the view
    +	};
    +
    +	$scope.selectCopyFromDS = function() {
    +        var params = {
    +            title: 'Copy URL Sig Keys to: ' + deliveryService.displayName,
    +            message: "Please select a Delivery Service to copy from:",
    +            label: "xmlId"
    +        };
    +        var modalInstance = $uibModal.open({
    +            templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
    +            controller: 'DialogSelectController',
    +            size: 'md',
    +            resolve: {
    +                params: function () {
    +                    return params;
    +                },
    +                collection: function(deliveryServiceService) {
    +                    return deliveryServiceService.getDeliveryServices({ signed: true })
    +                    .then(function(result){
    +                    	return _.filter(result, function(ds){
    +                    		return ds.id !== deliveryService.id;
    --- End diff --
    
    a simple comment might be helpful "you can't copy url sig key from yourself" or something like that


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134332821
  
    --- Diff: traffic_ops/app/lib/TrafficOpsRoutes.pm ---
    @@ -571,6 +571,11 @@ sub api_routes {
     		->to( 'KeysUrlSig#copy_url_sig_keys', namespace => 'API::DeliveryService' );
     	$r->get("/api/$version/deliveryservices/xmlId/:xmlId/urlkeys")->over( authenticated => 1, not_ldap => 1 )
     		->to( 'KeysUrlSig#view_by_xmlid', namespace => 'API::DeliveryService' );
    +	# -- DELIVERY SERVICE: VIEW URL SIG KEYS BY ID
    +	$r->get("/api/$version/deliveryservices/:id/urlkeys")->over( authenticated => 1, not_ldap => 1 )
    --- End diff --
    
    did you make sure to update the applicable .rst doc with this new endpoint?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134324566
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/DeliveryServiceUrlSigKeysController.js ---
    @@ -0,0 +1,100 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysController = function(deliveryService, urlSigKeys, $scope, $state, locationUtils, deliveryServiceService, deliveryServiceUrlSigKeysService, $uibModal) {
    +	$scope.deliveryService = deliveryService;
    +	$scope.urlSigKeys = Object.keys(urlSigKeys).map(function(key) {
    +			return {sortBy: parseInt(key.slice(3)), label: key, urlSigKey: urlSigKeys[key]};
    +	});
    +
    +	$scope.generateUrlSigKeys = function() {
    +        var params = {
    +            title: 'Confirmation required',
    +            message: 'Are you sure you want to generate new URL signature keys for ' + deliveryService.displayName + '?'
    +        };
    +        var modalInstance = $uibModal.open({
    +            templateUrl: 'common/modules/dialog/confirm/dialog.confirm.tpl.html',
    +            controller: 'DialogConfirmController',
    +            size: 'md',
    +            resolve: {
    +                params: function () {
    +                    return params;
    +                }
    +            }
    +        });
    +        modalInstance.result
    +            .then(
    +            function() {
    +                deliveryServiceUrlSigKeysService.generateUrlSigKeys(deliveryService.xmlId).then(
    +                function() {
    +                    $scope.refresh();
    +                });
    +            });
    +	};
    +
    +	$scope.refresh = function() {
    +		$state.reload(); // reloads all the resolves for the view
    +	};
    +
    +	$scope.selectCopyFromDS = function() {
    +        var params = {
    +            title: 'Copy URL Sig Keys to: ' + deliveryService.displayName,
    --- End diff --
    
    again, xml-id rather than displayname? not sure.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [CDN-240] build ui for managing url sig...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-trafficcontrol-PR/25/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by DylanVolz <gi...@git.apache.org>.
Github user DylanVolz commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134556388
  
    --- Diff: traffic_portal/app/src/common/api/DeliveryServiceUrlSigKeysService.js ---
    @@ -0,0 +1,70 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysService = function(locationUtils, messageModel, $http, $q, ENV) {
    +
    +	this.generateUrlSigKeys = function(dsXmlId) {
    +		var request = $q.defer();
    +		$http.post(ENV.api['root'] + 'deliveryservices/xmlId/' + dsXmlId + '/urlkeys/generate')
    +		.then(
    +			function(result) {
    +				messageModel.setMessages([ { level: 'success', text: 'URL Sig Keys generated' } ], true);
    --- End diff --
    
    fault message included properly now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by DylanVolz <gi...@git.apache.org>.
Github user DylanVolz commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134556400
  
    --- Diff: traffic_portal/app/src/common/api/DeliveryServiceUrlSigKeysService.js ---
    @@ -0,0 +1,70 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysService = function(locationUtils, messageModel, $http, $q, ENV) {
    +
    +	this.generateUrlSigKeys = function(dsXmlId) {
    +		var request = $q.defer();
    +		$http.post(ENV.api['root'] + 'deliveryservices/xmlId/' + dsXmlId + '/urlkeys/generate')
    +		.then(
    +			function(result) {
    +				messageModel.setMessages([ { level: 'success', text: 'URL Sig Keys generated' } ], true);
    +				request.resolve();
    +			},
    +			function() {
    +				messageModel.setMessages(fault.data.alerts, false);
    +				request.reject();
    +			}
    +		);
    +		return request.promise;
    +	};
    +
    +	this.copyUrlSigKeys = function(dsXmlId, copyFromXmlId) {
    +		var request = $q.defer();
    +		 $http.post(ENV.api['root'] + 'deliveryservices/xmlId/' + dsXmlId + '/urlkeys/copyFromXmlId/' + copyFromXmlId)
    +		.then(
    +			function(result) {
    +				messageModel.setMessages([ { level: 'success', text: 'URL Sig Keys copied' } ], true);
    --- End diff --
    
    fault message included properly now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-trafficcontrol-PR/30/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134331397
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/deliveryServiceUrlSigKeys.tpl.html ---
    @@ -0,0 +1,55 @@
    +<!--
    +Licensed to the Apache Software Foundation (ASF) under one
    +or more contributor license agreements.  See the NOTICE file
    +distributed with this work for additional information
    +regarding copyright ownership.  The ASF licenses this file
    +to you 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.
    +-->
    +
    +<div id="deliveryServiceUrlSigKeysContainer">
    +    <div ui-view="deliveryServiceUrlSigKeysContent">
    +    	<div class="x_panel">
    +		    <div class="x_title">
    +		        <ol class="breadcrumb pull-left">
    +		            <li><a ng-click="navigateToPath('/configure/delivery-services')">Delivery Services</a></li>
    +		            <li><a ng-click="navigateToPath('/configure/delivery-services/' + deliveryService.id + '?type=' + deliveryService.type)">{{::deliveryService.displayName}}</a></li>
    +		            <li class="active">URL Sig Keys</li>
    +		        </ol>
    +		        <div class="pull-right">
    +		            <button class="btn btn-primary" title="Generate URL Sig Keys" ng-click="generateUrlSigKeys(deliveryService.xmlId)"><i class="fa">Generate URL Sig Keys</i></button>
    --- End diff --
    
    you don't need to wrap your button labels in <i class="fa">, it makes the fonts look different fyi


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134325053
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/index.js ---
    @@ -0,0 +1,43 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +module.exports = angular.module('trafficPortal.private.configure.deliveryServices.urlSigKeys', [])
    +	.controller('DeliveryServiceUrlSigKeysController', require('./DeliveryServiceUrlSigKeysController'))
    +	.config(function($stateProvider, $urlRouterProvider) {
    +		$stateProvider
    +			.state('trafficPortal.private.configure.deliveryServices.urlSigKeys', {
    +				url: '/{deliveryServiceId}/urlSigKeys',
    +				views: {
    +					deliveryServicesContent: {
    +						templateUrl: 'modules/private/configure/deliveryServices/urlSigKeys/deliveryServiceUrlSigKeys.tpl.html',
    +						controller: 'DeliveryServiceUrlSigKeysController'
    +					}
    +				},
    +				resolve: {
    +							deliveryService: function($stateParams, deliveryServiceService) {
    --- End diff --
    
    formatting looks a bit off here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-trafficcontrol-PR/38/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by DylanVolz <gi...@git.apache.org>.
Github user DylanVolz commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134555976
  
    --- Diff: traffic_ops/app/lib/TrafficOpsRoutes.pm ---
    @@ -571,6 +571,11 @@ sub api_routes {
     		->to( 'KeysUrlSig#copy_url_sig_keys', namespace => 'API::DeliveryService' );
     	$r->get("/api/$version/deliveryservices/xmlId/:xmlId/urlkeys")->over( authenticated => 1, not_ldap => 1 )
     		->to( 'KeysUrlSig#view_by_xmlid', namespace => 'API::DeliveryService' );
    +	# -- DELIVERY SERVICE: VIEW URL SIG KEYS BY ID
    +	$r->get("/api/$version/deliveryservices/:id/urlkeys")->over( authenticated => 1, not_ldap => 1 )
    --- End diff --
    
    documentation has now been added


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: WIP - [TC-336] build ui for managing ur...

Posted by zhilhuan <gi...@git.apache.org>.
Github user zhilhuan commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    https://github.com/apache/incubator-trafficcontrol/pull/855


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134324451
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/DeliveryServiceUrlSigKeysController.js ---
    @@ -0,0 +1,100 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysController = function(deliveryService, urlSigKeys, $scope, $state, locationUtils, deliveryServiceService, deliveryServiceUrlSigKeysService, $uibModal) {
    +	$scope.deliveryService = deliveryService;
    +	$scope.urlSigKeys = Object.keys(urlSigKeys).map(function(key) {
    +			return {sortBy: parseInt(key.slice(3)), label: key, urlSigKey: urlSigKeys[key]};
    +	});
    +
    +	$scope.generateUrlSigKeys = function() {
    +        var params = {
    +            title: 'Confirmation required',
    +            message: 'Are you sure you want to generate new URL signature keys for ' + deliveryService.displayName + '?'
    --- End diff --
    
    kinda thinking xml-id might be best here...seems like people associate more with the xml-id and displayname can get long and end up wrapping... but your call


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134323487
  
    --- Diff: traffic_portal/app/src/common/api/DeliveryServiceUrlSigKeysService.js ---
    @@ -0,0 +1,70 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysService = function(locationUtils, messageModel, $http, $q, ENV) {
    +
    +	this.generateUrlSigKeys = function(dsXmlId) {
    +		var request = $q.defer();
    +		$http.post(ENV.api['root'] + 'deliveryservices/xmlId/' + dsXmlId + '/urlkeys/generate')
    +		.then(
    +			function(result) {
    +				messageModel.setMessages([ { level: 'success', text: 'URL Sig Keys generated' } ], true);
    --- End diff --
    
    ideally this would probably show result.data.alerts so it can show the message sent back from the server rather than a hardcoded message in the UI. yes, i know, there are lots of instances where the message is hardcoded in the UI. that should be fixed at some point.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    you might want to consider adding a confirm dialog to the generate button. i.e. "Are you sure you want to generate url sig keys?" - search for dialog.confirm to see other places that use it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134324990
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/index.js ---
    @@ -0,0 +1,43 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +module.exports = angular.module('trafficPortal.private.configure.deliveryServices.urlSigKeys', [])
    +	.controller('DeliveryServiceUrlSigKeysController', require('./DeliveryServiceUrlSigKeysController'))
    +	.config(function($stateProvider, $urlRouterProvider) {
    +		$stateProvider
    +			.state('trafficPortal.private.configure.deliveryServices.urlSigKeys', {
    +				url: '/{deliveryServiceId}/urlSigKeys',
    --- End diff --
    
    url-sig-keys


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: WIP - [TC-336] build ui for managing ur...

Posted by zhilhuan <gi...@git.apache.org>.
Github user zhilhuan commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    @DylanVolz PR#855 for TC-547 is ready for review.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134323600
  
    --- Diff: traffic_portal/app/src/common/api/DeliveryServiceUrlSigKeysService.js ---
    @@ -0,0 +1,70 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysService = function(locationUtils, messageModel, $http, $q, ENV) {
    +
    +	this.generateUrlSigKeys = function(dsXmlId) {
    +		var request = $q.defer();
    +		$http.post(ENV.api['root'] + 'deliveryservices/xmlId/' + dsXmlId + '/urlkeys/generate')
    +		.then(
    +			function(result) {
    +				messageModel.setMessages([ { level: 'success', text: 'URL Sig Keys generated' } ], true);
    +				request.resolve();
    +			},
    +			function() {
    +				messageModel.setMessages(fault.data.alerts, false);
    +				request.reject();
    +			}
    +		);
    +		return request.promise;
    +	};
    +
    +	this.copyUrlSigKeys = function(dsXmlId, copyFromXmlId) {
    +		var request = $q.defer();
    +		 $http.post(ENV.api['root'] + 'deliveryservices/xmlId/' + dsXmlId + '/urlkeys/copyFromXmlId/' + copyFromXmlId)
    +		.then(
    +			function(result) {
    +				messageModel.setMessages([ { level: 'success', text: 'URL Sig Keys copied' } ], true);
    --- End diff --
    
    same thing. would probably be better to show result.data.alerts rather than a hardcoded UI message


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134322763
  
    --- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---
    @@ -26,6 +26,32 @@ use constant URL_SIG_KEYS_BUCKET => "url_sig_keys";
     use Exporter qw(import);
     our @EXPORT_OK = qw(URL_SIG_KEYS_BUCKET);
     
    +
    +sub view_by_id {
    +	my $self                = shift;
    +	my $id              = $self->param('id');
    +	my $rs = $self->db->resultset("Deliveryservice")->find( { id => $id } ); 
    +	my $xml_id;
    +	if ( defined($rs) ) {
    +		$xml_id = $rs->xml_id;
    +	}
    +	else {
    +		return $self->alert("Delivery Service '$id' does not exist.");
    +	}
    +
    --- End diff --
    
    can you add a tenant check in here similar to this:
    
    https://github.com/apache/incubator-trafficcontrol/blob/master/traffic_ops/app/lib/API/Deliveryservice.pm#L175
     
    going forward, anything ds related needs to check that the user requesting the ds info has the proper tenant to do so. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-trafficcontrol-PR-trafficops-test/9/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #790: [TC-336] build ui for managing url sig ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/790
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-trafficcontrol-PR/119/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #790: [TC-336] build ui for managing u...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/790#discussion_r134324897
  
    --- Diff: traffic_portal/app/src/modules/private/configure/deliveryServices/urlSigKeys/DeliveryServiceUrlSigKeysController.js ---
    @@ -0,0 +1,100 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +var DeliveryServiceUrlSigKeysController = function(deliveryService, urlSigKeys, $scope, $state, locationUtils, deliveryServiceService, deliveryServiceUrlSigKeysService, $uibModal) {
    +	$scope.deliveryService = deliveryService;
    +	$scope.urlSigKeys = Object.keys(urlSigKeys).map(function(key) {
    +			return {sortBy: parseInt(key.slice(3)), label: key, urlSigKey: urlSigKeys[key]};
    +	});
    +
    +	$scope.generateUrlSigKeys = function() {
    +        var params = {
    +            title: 'Confirmation required',
    +            message: 'Are you sure you want to generate new URL signature keys for ' + deliveryService.displayName + '?'
    +        };
    +        var modalInstance = $uibModal.open({
    +            templateUrl: 'common/modules/dialog/confirm/dialog.confirm.tpl.html',
    +            controller: 'DialogConfirmController',
    +            size: 'md',
    +            resolve: {
    +                params: function () {
    +                    return params;
    +                }
    +            }
    +        });
    +        modalInstance.result
    +            .then(
    +            function() {
    +                deliveryServiceUrlSigKeysService.generateUrlSigKeys(deliveryService.xmlId).then(
    +                function() {
    +                    $scope.refresh();
    +                });
    +            });
    +	};
    +
    +	$scope.refresh = function() {
    +		$state.reload(); // reloads all the resolves for the view
    +	};
    +
    +	$scope.selectCopyFromDS = function() {
    +        var params = {
    +            title: 'Copy URL Sig Keys to: ' + deliveryService.displayName,
    +            message: "Please select a Delivery Service to copy from:",
    +            label: "xmlId"
    +        };
    +        var modalInstance = $uibModal.open({
    +            templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
    +            controller: 'DialogSelectController',
    +            size: 'md',
    +            resolve: {
    +                params: function () {
    +                    return params;
    +                },
    +                collection: function(deliveryServiceService) {
    +                    return deliveryServiceService.getDeliveryServices({ signed: true })
    +                    .then(function(result){
    +                    	return _.filter(result, function(ds){
    +                    		return ds.id !== deliveryService.id;
    +                    	})
    +                    });
    +                }
    +            }
    +        });
    +        modalInstance.result.then(function(copyFromDs) {
    +            deliveryServiceUrlSigKeysService.copyUrlSigKeys(deliveryService.xmlId, copyFromDs.xmlId)
    +            .then(
    +           		function() {
    +            	$state.reload();
    +        	});
    +        });
    +    };
    +
    +	$scope.navigateToPath = locationUtils.navigateToPath;
    +
    +	angular.element(document).ready(function () {
    +		$('#regexesTable').dataTable({
    --- End diff --
    
    this id doesn't seem quite right. regexesTable? i know it's arbitrary but you might want to fix that


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---