[GitHub] incubator-trafficcontrol pull request #858: [BACKPORT] [TC-441] - refactored...

2017-08-23 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #858: [BACKPORT] [TC-441] - refactored how to...

2017-08-23 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/858
  
manually closing


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #864: TPv2 - hides ds/user assign if u...

2017-08-23 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

TPv2 - hides ds/user assign if use_tenancy is turned on



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tp-hide-ds-assign-if-use-tenancy

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

https://github.com/apache/incubator-trafficcontrol/pull/864.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 #864


commit 3c770c4aa7b75c85b4f824a903366979f79b0917
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-23T20:42:06Z

hides ds/user assign if use_tenancy is turned on




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #863: [TC-551] - adds the ability to f...

2017-08-23 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-551] - adds the ability to filter parameters by name or config_file



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-551-add-filters-to-params-api

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

https://github.com/apache/incubator-trafficcontrol/pull/863.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 #863


commit 575b853616647cc0515ae8ea030f611d5866d9e9
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-23T20:10:45Z

adds the ability to filter parameters by name or config_file




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #860: [TC-535] - 2.1.x url sig tenancy...

2017-08-23 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-535] - 2.1.x url sig tenancy checks



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
2.1.x-url-sig-tenancy-checks

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

https://github.com/apache/incubator-trafficcontrol/pull/860.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 #860


commit c673c2973468c4fab7af4dd486416698d999a0ba
Author: nir-sopher <n...@qwilt.com>
Date:   2017-08-13T15:25:37Z

url sig - tenancy checks

(cherry picked from commit a70ba7d49f44ff7dbff81d38ba76913032b2916e)

commit cf65023066804e6f944a161d65f626b765e3b81c
Author: nir-sopher <n...@qwilt.com>
Date:   2017-08-22T19:54:16Z

DS URL access - removing a test probably failed on env diffs

(cherry picked from commit 4b68e32102e99f27f378e800a77976b486cc3bf7)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #858: [BACKPORT] [TC-441] - refactored...

2017-08-23 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-441] - refactored how tokin login works to ensure tokin 
login is complete be…

…fore attempting to resolve other dependencies that need the 
authentication cookie

(cherry picked from commit 98092836c2ae5ac3382245e1b3645eefbda1c7b6)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
2.1.x-fixes-token-login-on-tp

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

https://github.com/apache/incubator-trafficcontrol/pull/858.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 #858


commit 2598bd6a060a5419edb5dfea610fab194ef06081
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-23T16:33:36Z

refactored how tokin login works to ensure tokin login is complete before 
attempting to resolve other dependencies that need the authentication cookie

(cherry picked from commit 98092836c2ae5ac3382245e1b3645eefbda1c7b6)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #857: [TC-441] - refactored how tokin ...

2017-08-23 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-441] - refactored how tokin login works to ensure tokin login is 
complete be…

…fore attempting to resolve other dependencies that need the 
authentication cookie

this is related to password reset because password reset utilizes token 
login

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-441-fixes-token-login

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

https://github.com/apache/incubator-trafficcontrol/pull/857.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 #857


commit e4abe88f8b4493dd5f5a0cc91360b3da8f3d7a79
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-23T16:33:36Z

refactored how tokin login works to ensure tokin login is complete before 
attempting to resolve other dependencies that need the authentication cookie




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #847: [BACKPORT] [TC-441] - corrects r...

2017-08-23 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #847: [BACKPORT] [TC-441] - corrects reset pa...

2017-08-23 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/847
  
manually closing


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #831: [TC-535] url sig - tenancy check...

2017-08-22 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/831#discussion_r134509030
  
--- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---
@@ -69,14 +86,17 @@ sub copy_url_sig_keys {
else {
return $self->alert("Delivery Service to copy from 
'$copy_from_xml_id' does not exist.");
}
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$copy_rs->tenant_id)) {
+   return $self->forbidden("Forbidden. Source delivery-service 
tenant is not available to the user.");
+   }
my $copy_config_file = 
$self->url_sig_config_file_name($copy_from_xml_id);
 
my $helper = new Utils::Helper( { mojo => $self } );
my $url_sig_key_values_json;
 
#verify we can copy keys out
if ( $helper->is_valid_delivery_service($copy_ds_id) ) {
-   if ( $is_admin || 
$helper->is_delivery_service_assigned($copy_ds_id) ) {
+   if ( $is_admin || 
$helper->is_delivery_service_assigned($copy_ds_id) || 
$tenant_utils->use_tenancy()) {
--- End diff --

i see


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #850: [TC-483] - TPv2 - marks tenant a...

2017-08-22 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-483] - TPv2 - marks tenant as required for users and delivery services



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-483-tp-tenant-required

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

https://github.com/apache/incubator-trafficcontrol/pull/850.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 #850


commit 5cbebeb0fe38e0e27157559f06e665662b648512
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-22T13:45:58Z

marks tenant as required for users and delivery services




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #848: [TC-520] - TPv2 - adds a table t...

2017-08-21 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-520] - TPv2 - adds a table to view all delivery services for a given 
tenant

as well as adding a tenant filter to the ds api

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tp-view-tenant-ds-s

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

https://github.com/apache/incubator-trafficcontrol/pull/848.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 #848


commit e18c42e9c7810cbf58d94ded2ff91684f4a0d1ad
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-22T02:56:17Z

adds a table to view all deliveryservices for a given tenant




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #847: [BACKPORT] [TC-441] - corrects r...

2017-08-21 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-441] - corrects reset password link to match format of TP

(cherry picked from commit 404b4a0362a38c2656b53cbe056b7675b902c162)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
2.1.x-tc-441-fixes-reset-link

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

https://github.com/apache/incubator-trafficcontrol/pull/847.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 #847


commit a2c3cd5aec396a9d6c9f3abfaa8057482573254f
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-21T21:49:03Z

corrects reset password link to match format of TP

(cherry picked from commit 404b4a0362a38c2656b53cbe056b7675b902c162)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #844: [TC-441] - corrects reset passwo...

2017-08-21 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-441] - corrects reset password link to match format of TP



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-441-tp-password-reset

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

https://github.com/apache/incubator-trafficcontrol/pull/844.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 #844


commit 75a0d0546f55ef99fa162fb6aaafb1dec9c7f091
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-21T21:49:03Z

corrects reset password link to match format of TP




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 @@
+
+
+
+
+   
+   
+   
+   Delivery 
Services
+   {{::deliveryService.displayName}}
+   URL Sig Keys
+   
+   
+   Generate URL Sig Keys
--- End diff --

you don't need to wrap your button labels in , 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-21 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #835: [BACKPORT] [TC-533] - ssl_keys - tenanc...

2017-08-21 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/835
  
manually closing


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #835: [BACKPORT] [TC-533] - ssl_keys -...

2017-08-21 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #840: [BACKPORT] [TC-491] [TC-492] deletes ap...

2017-08-21 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/840
  
manually closing


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #840: [BACKPORT] [TC-491] [TC-492] del...

2017-08-21 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #840: [BACKPORT] [TC-491] [TC-492] del...

2017-08-21 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-491] [TC-492]deletes applicable staticdnsentries and 
jobs when a ds is deleted

cherry pick of b7b293718c0ca8174dba5759c01301208d5c6a78

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
2.1.x-tc-491-492

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

https://github.com/apache/incubator-trafficcontrol/pull/840.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 #840






---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #833: [TC-541] - TPv2 - turning on saveState ...

2017-08-18 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/833
  
@dneuman64 will be looking at this one



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #838: [BACKPORT] [TC-441] - hooks up p...

2017-08-18 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-441] - hooks up password reset to TP

(cherry picked from commit 421d390de80d5fa75a0d17488cf3a24bbe2fcc27)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
2.1.x-tc-441

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

https://github.com/apache/incubator-trafficcontrol/pull/838.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 #838


commit caab9b148a16cd267d709aceaa99b3d7a0c0256d
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-16T21:22:13Z

hooks up password reset to TP

(cherry picked from commit 421d390de80d5fa75a0d17488cf3a24bbe2fcc27)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #814: [BACKPORT] [TC-519] - adds back ...

2017-08-18 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #814: [BACKPORT] [TC-519] - adds back missing...

2017-08-18 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/814
  
manually closing


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #834: [BACKPORT] [TC-533] - ssl_keys -...

2017-08-18 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #834: [BACKPORT] [TC-533] - ssl_keys -...

2017-08-18 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-533] - ssl_keys - tenancy checks

(cherry picked from commit 01452c99a0fc4d459742a67bad3bab9f20fcf4e6)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-533-2.1.x

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

https://github.com/apache/incubator-trafficcontrol/pull/834.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 #834


commit cecadabea9b7ff8779764f69ee666c2f359ef649
Author: nir-sopher <n...@qwilt.com>
Date:   2017-08-13T16:01:38Z

ssl_keys - tenancy checks

(cherry picked from commit 01452c99a0fc4d459742a67bad3bab9f20fcf4e6)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #831: [TC-535] url sig - tenancy check...

2017-08-18 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/831#discussion_r134007307
  
--- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---
@@ -134,17 +154,22 @@ sub generate {
my $current_user = $self->current_user()->{username};
( $self, "Generated new url_sig_keys for " . $xml_id, "APICHANGE" );
 
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
my $rs = $self->db->resultset("Deliveryservice")->find( { xml_id => 
$xml_id } );
my $ds_id;
if ( defined($rs) ) {
$ds_id = $rs->id;
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$rs->tenant_id)) {
+   return $self->forbidden("Forbidden. Delivery-service 
tenant is not available to the user.");
+   }
}
 
my $helper = new Utils::Helper( { mojo => $self } );
 
# Admins can always do this, otherwise verify the user
if ( ( defined($rs) && $helper->is_valid_delivery_service($ds_id) ) ) {
-   if ( _admin($self) || 
$helper->is_delivery_service_assigned($ds_id) ) {
+   if ( _admin($self) || 
$helper->is_delivery_service_assigned($ds_id) || $tenant_utils->use_tenancy()) {
--- End diff --

same comment as before


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #831: [TC-535] url sig - tenancy check...

2017-08-18 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/831#discussion_r134007130
  
--- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---
@@ -69,14 +86,17 @@ sub copy_url_sig_keys {
else {
return $self->alert("Delivery Service to copy from 
'$copy_from_xml_id' does not exist.");
}
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$copy_rs->tenant_id)) {
+   return $self->forbidden("Forbidden. Source delivery-service 
tenant is not available to the user.");
+   }
my $copy_config_file = 
$self->url_sig_config_file_name($copy_from_xml_id);
 
my $helper = new Utils::Helper( { mojo => $self } );
my $url_sig_key_values_json;
 
#verify we can copy keys out
if ( $helper->is_valid_delivery_service($copy_ds_id) ) {
-   if ( $is_admin || 
$helper->is_delivery_service_assigned($copy_ds_id) ) {
+   if ( $is_admin || 
$helper->is_delivery_service_assigned($copy_ds_id) || 
$tenant_utils->use_tenancy()) {
--- End diff --

I don't understand this line. If use_tenancy is 1 then it doesn't matter if 
you are an admin or you have the ds assigned you simply have to have the right 
tenant.right?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #831: [TC-535] url sig - tenancy check...

2017-08-18 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/831#discussion_r134007236
  
--- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---
@@ -98,7 +118,7 @@ sub copy_url_sig_keys {
if ( defined($url_sig_key_values_json) ) { # verify we got keys copied
# Admins can always do this, otherwise verify the user
--- End diff --

this comment is not true. admins cannot always do this anymore. not if 
use_tenancy=1


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #831: [TC-535] url sig - tenancy check...

2017-08-18 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/831#discussion_r134007263
  
--- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---
@@ -98,7 +118,7 @@ sub copy_url_sig_keys {
if ( defined($url_sig_key_values_json) ) { # verify we got keys copied
# Admins can always do this, otherwise verify the user
if ( $helper->is_valid_delivery_service($ds_id) ) {
-   if ( $is_admin || 
$helper->is_delivery_service_assigned($ds_id) ) {
+   if ( $is_admin || 
$helper->is_delivery_service_assigned($ds_id) || $tenant_utils->use_tenancy()) {
--- End diff --

same comment as before


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #833: [TC-541] - TPv2 - turning on sav...

2017-08-18 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-541] - TPv2 - turning on saveState for all tables



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tpv2-preserve-table-filters

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

https://github.com/apache/incubator-trafficcontrol/pull/833.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 #833


commit 581826a52a58c23a34bd3852377a7b3c5c362204
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-18T15:08:39Z

turning on saveState for all TPv2 tables




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #783: [TC-437] - adds the ability to generate...

2017-08-17 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/783
  
The ISO created was verified in this manner:

sudo mkdir /mnt/iso
sudo mount -t iso9660 -o loop this-is-the-iso-created.iso /mnt/iso/
df -h
cd /mnt/iso
sudo cat ./ks_scripts/password.cfg
sudo cat ./ks_scripts/network.cfg
sudo cat ./ks_scripts/disk.cfg
sudo cat ./ks_scripts/state.out


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #821: [BACKPORT] [TC-521] TPv2 - accou...

2017-08-17 Thread mitchell852
Github user mitchell852 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #821: [BACKPORT] [TC-521] TPv2 - accounts for...

2017-08-17 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/821
  
manually closing this


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #818: [TC-515] - TPv2 - adds human rea...

2017-08-16 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/818#discussion_r133571450
  
--- Diff: traffic_portal/app/src/common/modules/header/header.tpl.html ---
@@ -61,11 +61,11 @@
 
 
 
-
-
-
-
-
+
--- End diff --

yea, i did


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #825: [TC-441] - hooks up password res...

2017-08-16 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-441] - hooks up password reset to TP



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-441-tp-password-reset

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

https://github.com/apache/incubator-trafficcontrol/pull/825.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 #825


commit a1313fbf5825a5e485e6e60eb7712a56e040172a
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-16T21:22:13Z

hooks up password reset to TP




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #824: [TC-491] [TC-492] - deletes appl...

2017-08-16 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-491] [TC-492] - deletes applicable staticdnsentries and jobs when a ds 
is deleted



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-492-staticdnsentry-cascade-delete

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

https://github.com/apache/incubator-trafficcontrol/pull/824.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 #824


commit bf048b657ae745b993e4a76e50c491d3c5436327
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-16T20:32:14Z

deletes applicable staticdnsentries and jobs when a ds is deleted




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #818: [TC-515] - TPv2 - adds human readable d...

2017-08-16 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/818
  
@dneuman64 will be looking at this one


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #822: [TC-82] - removes dead API route...

2017-08-16 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-82] - removes dead API routes that must have resurfaced due to a bad 
conflict r…

…esolution

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-82-removes-dead-routes

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

https://github.com/apache/incubator-trafficcontrol/pull/822.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 #822


commit c4948a477b3d8de4e04265d23860df0310df8c3a
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-16T17:01:57Z

removes dead routes that must have resurfaced due to a bad conflict 
resolution




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol issue #754: Configure session tracking on TO side

2017-08-16 Thread mitchell852
Github user mitchell852 commented on the issue:

https://github.com/apache/incubator-trafficcontrol/pull/754
  
and was this discussed on the ML because i'm a pretty hard -1 on more DS 
table columns (if possible). That table is way out of control imo (50+ columns 
already?). @knutsel did introduce ds profiles...maybe that could be leveraged 
instead? i don't know.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #821: [BACKPORT] [TC-521] TPv2 - accou...

2017-08-15 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-521] TPv2 - accounts for missing dependency that centos 7.3 
doesn't provide

… when centos 7.4 is available this dependency will be provided with the 
distro.

(cherry picked from commit 15901255c1847800bbd871e33c757017ec23f74f)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
2.1.x-tc-521

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

https://github.com/apache/incubator-trafficcontrol/pull/821.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 #821


commit 66eb0cae181e340ef3602de9917dab9d9c4d3dc2
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T16:44:56Z

accounts for missing dependency that centos 7.3 doesn't provide. when 
centos 7.4 is available this dependency will be provided with the distro.

(cherry picked from commit 15901255c1847800bbd871e33c757017ec23f74f)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #818: [TC-515] - TPv2 - adds human rea...

2017-08-15 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-515] - TPv2 - adds human readable ds protocols to ds table



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-515-ds-protocol-names

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

https://github.com/apache/incubator-trafficcontrol/pull/818.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 #818


commit 2fbf009a5458c53b2a08b227ef1e1e049c80bf24
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T18:20:41Z

adds human readable ds protocols to ds table




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #817: [TC-524] - hooks popout button t...

2017-08-15 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-524] - hooks popout button to open new window/tab



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tp-new-tab-button

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

https://github.com/apache/incubator-trafficcontrol/pull/817.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 #817


commit 345f0b0484561e26f9a5f9a821dc18759163b8ba
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T17:48:23Z

hooks popout button to open new window/tab




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #815: [TC-521] - TPv2 - accounts for m...

2017-08-15 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-521] - TPv2 - accounts for missing dependency that centos 7.3 doesn't 
provide. when…

… centos 7.4 is available this dependency will be provided with the 
distro.

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-521-fixes-tp-build-failure

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

https://github.com/apache/incubator-trafficcontrol/pull/815.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 #815


commit 15901255c1847800bbd871e33c757017ec23f74f
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T16:44:56Z

accounts for missing dependency that centos 7.3 doesn't provide. when 
centos 7.4 is available this dependency will be provided with the distro.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #814: [BACKPORT] [TC-519] - adds back ...

2017-08-15 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[BACKPORT] [TC-519] - adds back missing tenants menu item

(cherry picked from commit a049589041ece51d6069cae09e2fdf23440d4a91)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 2.1.x

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

https://github.com/apache/incubator-trafficcontrol/pull/814.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 #814


commit a1ceb273271b7bbfb2db1195aed3d19946b6c9cd
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T02:13:51Z

adds back missing tenants menu item

(cherry picked from commit a049589041ece51d6069cae09e2fdf23440d4a91)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #812: [TC-517] TP - displays users fil...

2017-08-14 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-517] TP - displays users filtered by tenant. API adds tenant filter to 
use…

…rs api.

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-517-tenant-users

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

https://github.com/apache/incubator-trafficcontrol/pull/812.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 #812


commit d0b90ec5409bd3b0bac70673072a90832157597b
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T03:04:07Z

TP - displays users filtered by tenant. API adds tenant filter to users api.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #811: [TC-519] - adds back missing ten...

2017-08-14 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-519] - adds back missing tenants menu item



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-519-adds-back-tenants-menu-item

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

https://github.com/apache/incubator-trafficcontrol/pull/811.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 #811


commit a049589041ece51d6069cae09e2fdf23440d4a91
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-15T02:13:51Z

adds back missing tenants menu item




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2017-08-10 Thread mitchell852
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #792: [Backport] [TC-504] - fixes numb...

2017-08-09 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[Backport] [TC-504] - fixes number validation on global max settings

(cherry picked from commit 8603bc83dfe9b667af54f9101028740940bac86f)

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 2.1.x

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

https://github.com/apache/incubator-trafficcontrol/pull/792.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 #792


commit a376bc0670ea137ceef7da7a6e26394600fc77b3
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-09T14:58:10Z

fixes number validation on global max settings

(cherry picked from commit 8603bc83dfe9b667af54f9101028740940bac86f)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #791: [TC-504] - fixes number validati...

2017-08-09 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-504] - fixes number validation on global max settings



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-504-fixes-tp-validation-on-global-maxes

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

https://github.com/apache/incubator-trafficcontrol/pull/791.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 #791


commit 8603bc83dfe9b667af54f9101028740940bac86f
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-09T14:58:10Z

fixes number validation on global max settings




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #787: TPv2 - adds unique query param v...

2017-08-08 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

TPv2 - adds unique query param value on build to force invalidation of 
assets



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tp-query-params-to-assets

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

https://github.com/apache/incubator-trafficcontrol/pull/787.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 #787


commit 498387f78bcde23a68aa08e61bbd95f4372d151b
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-08T18:03:08Z

adds unique query param value on build to force invalidation of TP assets




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #784: [TC-423] - adds clone profile to...

2017-08-08 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-423] - adds clone profile to TPv2 and adds a few missing change log 
statements



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-423-copy-profile

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

https://github.com/apache/incubator-trafficcontrol/pull/784.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 #784


commit 3844e9e450a63e6bcd891d26e2f55787a2e80a1a
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-08T14:35:33Z

adds clone profile to TPv2 and adds a few missing change log statements




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #783: [TC-437] - adds the ability to g...

2017-08-07 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-437] - adds the ability to generate an ISO to the api / traffic portal 
v2



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-437-generate-iso

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

https://github.com/apache/incubator-trafficcontrol/pull/783.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 #783






---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #782: updates tp dev install doc

2017-08-07 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

updates tp dev install doc



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
updates-tp-install-doc

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

https://github.com/apache/incubator-trafficcontrol/pull/782.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 #782


commit dd454ad04fd1822a30a2dc99323ae27c3b8a48c1
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-07T15:25:59Z

updates tp dev install doc




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #777: [TC-498] - case mismatch was cau...

2017-08-04 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-498] - case mismatch was causing no validation on fullName when  
updating current user



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
fixes-current-user-full-name

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

https://github.com/apache/incubator-trafficcontrol/pull/777.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 #777


commit ca74f9313d02f098db05068adb48d64fa37625f8
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-04T17:32:43Z

case mismatch was causing no validation on fullName




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #776: fixes tenant test

2017-08-04 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

fixes tenant test



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
fixes-tenant-test

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

https://github.com/apache/incubator-trafficcontrol/pull/776.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 #776


commit 0042e205454ff4058ee2fda53f72a3755767cd29
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-04T16:12:28Z

fixes tenant test




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #766: [TC-461] DS steering tenancy che...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/766#discussion_r131236009
  
--- Diff: traffic_ops/app/lib/API/DeliveryService/SteeringTarget.pm ---
@@ -29,6 +30,20 @@ sub index {
my $steering_id = $self->param('id');
my @data;
 
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+   my $ds = $self->db->resultset('Deliveryservice')->find( { id => 
$steering_id } );
+   if ( defined($ds) ) {
+   #TO THE REVIEWER
--- End diff --

can you take out the "to the reviewer"s


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #753: [TC-463] User tenancy ds assignm...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/753#discussion_r129939021
  
--- Diff: traffic_ops/app/lib/API/Deliveryservice.pm ---
@@ -949,6 +959,8 @@ sub get_deliveryservices_by_userId {
my @data;
if ( defined($deliveryservices) ) {
while ( my $row = $deliveryservices->next ) {
+   ### we do not check here if we have access to the DS.i
--- End diff --

i still think it's important to check tenancy on both the user and the ds's 
returned. remember, no guarantee that the user using this api has a high-level 
role. i think there's no harm in ALWAYS limiting ds's to those in your tenant 
tree. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #753: [TC-463] User tenancy ds assignm...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/753#discussion_r129940638
  
--- Diff: traffic_ops/app/lib/API/User.pm ---
@@ -408,16 +423,24 @@ sub assign_deliveryservices {
if ( !defined($user) ) {
return $self->not_found();
}
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+   if (!$tenant_utils->is_user_resource_accessible($tenants_data, 
$user->tenant_id)) {
+   #no access to resource tenant
+   return $self->alert("Invalid user. This user is not available 
to you for assignment.");
+   }
 
if ( $replace ) {
# start fresh and delete existing user/deliveryservice 
associations
+   # We are not checking DS tenancy on deletion - we manage the 
user here - we remove permissions to touch a DS
my $delete = 
$self->db->resultset('DeliveryserviceTmuser')->search( { tm_user_id => $user_id 
} );
$delete->delete();
}
 
my @values = ( [ qw( deliveryservice tm_user_id ) ]); # column names 
are required for 'populate' function
 
foreach my $ds_id (@{ $delivery_services }) {
+   #not checking ds tenancy - this is a user operation, setting 
his premissions, not a "DS" operation
--- End diff --

in my opinion we SHOULD be checking tenancy here to ensure only ds's inside 
the current users tenant tree are assigned, however, that is hard to do with 
the way this code is implemented plus since assigning individual ds's to a user 
is going to be replace with tenancy, i would not worry about this but i'd 
remove the comments about not checking tenancy


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #753: [TC-463] User tenancy ds assignm...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/753#discussion_r129937967
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceUser.pm ---
@@ -31,6 +32,18 @@ sub delete {
 return $self->forbidden();
 }
 
+my $user = $self->db->resultset('TmUser')->find( { id => $user_id } );
+if ( !defined($user) ) {
+return $self->not_found();
+}
+my $tenant_utils = Utils::Tenant->new($self);
+my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+if (!$tenant_utils->is_user_resource_accessible($tenants_data, 
$user->tenant_id)) {
+#no access to resource tenant
+return $self->forbidden();
--- End diff --

can you add forbidden messages?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #753: [TC-463] User tenancy ds assignm...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/753#discussion_r129937865
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceUser.pm ---
@@ -31,6 +32,18 @@ sub delete {
 return $self->forbidden();
 }
 
+my $user = $self->db->resultset('TmUser')->find( { id => $user_id } );
--- End diff --

i feel like there is no harm in checking tenancy on both the user and the 
DS.

if i am trying to remove DS1 from user1 first check that user1 has a tenant 
inside my tenant tree and then check that DS1 has a tenant in my tenant tree.

if DS1 is not inside my tenant tree, i should know NOTHING about that DS. 
to me, that DS does not exist.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #753: [TC-463] User tenancy ds assignm...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/753#discussion_r129940738
  
--- Diff: traffic_ops/app/lib/Utils/Tenant.pm ---
@@ -224,6 +224,15 @@ sub is_ds_resource_accessible {
 return $self->_is_resource_accessable( $tenants_data, 
$resource_tenancy);
 }
 
+sub is_ds_resource_accessible_to_tenant {
+my $self = shift;
+my $tenants_data = shift;
+my $resource_tenancy = shift;
+my $user_tenancy = shift;
+
+return $self->_is_resource_accessable_to_tenant( $tenants_data, 
$resource_tenancy, $user_tenancy);
+}
+
 sub ignore_ds_users_table {
--- End diff --

ignore_ds_users_table() is going away, right?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

2017-08-03 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/758#discussion_r131186253
  
--- Diff: traffic_ops/app/lib/API/Parameter.pm ---
@@ -317,7 +317,7 @@ sub update {
 
 my $name = $params->{name} || $find->name;
 my $configFile = $params->{configFile} || $find->config_file;
-my $value = $params->{value} || $find->value;
+my $value = exists($params->{value}) ?  $params->{value} : 
$find->value;
--- End diff --

ok, makes sense. i forgot how perl treats 0 or "0"


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #758: [TC-478] Parameter value can be ...

2017-08-02 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/758#discussion_r131001497
  
--- Diff: traffic_ops/app/lib/API/Parameter.pm ---
@@ -317,7 +317,7 @@ sub update {
 
 my $name = $params->{name} || $find->name;
 my $configFile = $params->{configFile} || $find->config_file;
-my $value = $params->{value} || $find->value;
+my $value = exists($params->{value}) ?  $params->{value} : 
$find->value;
--- End diff --

what does this allow you to do? to set the parameter value to null? is that 
what you want to do?

it sounds like by the name of the PR you want to set a parameter value to 
0...but parameter values are strings so can you set the value to "0" without 
this change? and is that sufficient?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #751: [TC-462] Ds tenancy validation r...

2017-08-02 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/751#discussion_r130975670
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceRegexes.pm ---
@@ -222,6 +262,18 @@ sub delete {
return $self->forbidden();
}
 
+   my $ds = $self->db->resultset('Deliveryservice')->find( { id => $ds_id 
} );
+   if ( !defined($ds) ) {
+   #allow deletion if the ds is not valid
--- End diff --

can  you make this change? this doesn't make sense to me. if the ds doesn't 
exist, don't worry about deleting ds regexes...just throw a not_found()


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #770: [TC-486] - adds steering role to...

2017-08-01 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-486] - adds steering role to steering apis



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
adds-steering-role

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

https://github.com/apache/incubator-trafficcontrol/pull/770.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 #770


commit c76be0cb69ba7e3cfa3bcf2894cd3dffe130f0e2
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-08-01T13:54:00Z

adds steering role to steering apis




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r130410539
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -569,10 +575,17 @@ sub get_unassigned_servers_by_dsid {
$ds_server_criteria{'deliveryservice.id'} = $ds_id;
 
my @assigned_servers;
-   if ( _privileged($self) || 
$self->is_delivery_service_assigned($ds_id) ) {
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$ds->tenant_id)) {
--- End diff --

ok, sounds good. thx for verifying


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r130410587
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -726,41 +746,26 @@ sub get_servers_by_type {
my $orderby   = $self->param('orderby') || "hostName";
my $orderby_snakecase = lcfirst( decamelize($orderby) );
 
+   my $forbidden;
--- End diff --

k


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r130407887
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -400,40 +401,25 @@ sub get_servers_by_status {
my $orderby   = $self->param('orderby') || "hostName";
my $orderby_snakecase = lcfirst( decamelize($orderby) );
 
+   my $forbidden;
--- End diff --

ok


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r130407783
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceServer.pm ---
@@ -223,8 +240,19 @@ sub remove_server_from_ds {
my $ds_id   = $self->param('dsId');
my $server_id   = $self->param('serverId');
 
-   if ( !_privileged($self) && 
!$self->is_delivery_service_assigned($ds_id) ) {
-   $self->forbidden("Forbidden. Delivery service not assigned to 
user.");
+   my $tenant_utils = Utils::Tenant->new($self);
+   if ( !_privileged($self) && !$tenant_utils->ignore_ds_users_table() 
&& !$self->is_delivery_service_assigned($ds_id) ) {
--- End diff --

yep, i like the idea of maybe having 1 function use_tenancy() or whatever 
that keys off of the use-tenancy parameter


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r130407547
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceServer.pm ---
@@ -80,15 +86,21 @@ sub assign_servers_to_ds {
return $self->forbidden();
}
 
-   if ( ref($servers) ne 'ARRAY' ) {
-   return $self->alert("Servers must be an array");
-   }
-
my $ds = $self->db->resultset('Deliveryservice')->find( { id => $ds_id 
} );
if ( !defined($ds) ) {
return $self->not_found();
}
 
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$ds->tenant_id)) {
+   return $self->alert("Invalid delivery-service assignment. The 
delivery-service is not avaialble for your tenant.");
--- End diff --

ok, i see your 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #751: [TC-462] Ds tenancy validation r...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/751#discussion_r130406581
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceRegexes.pm ---
@@ -222,6 +262,18 @@ sub delete {
return $self->forbidden();
}
 
+   my $ds = $self->db->resultset('Deliveryservice')->find( { id => $ds_id 
} );
+   if ( !defined($ds) ) {
+   #allow deletion if the ds is not valid
--- End diff --

i don't think you can have an entry in deliveryservice_regex without the 
same delivery service in the deliveryservice table due to the foreign key in 
deliveryservice_regex. 

if that happens then you have a data integrity problem and someone will 
have to clean up the database manually and whatever bug is allowing this to 
happen needs to be fixed. So i would just stick with the basic:

my $ds = $self->db->resultset('Deliveryservice')->find( { id => $ds_id } );
if ( !defined($ds) ) {
return $self->not_found();
}


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #751: [TC-462] Ds tenancy validation r...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/751#discussion_r130405550
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceRegexes.pm ---
@@ -27,12 +28,18 @@ use Validate::Tiny ':all';
 sub all {
my $self = shift;
 
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+
my $rs;
-   if ( _privileged($self) ) {
+   if ( _privileged($self) or $tenant_utils->ignore_ds_users_table()) {
--- End diff --

i think that would make sense to merge the 2 functions


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #751: [TC-462] Ds tenancy validation r...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/751#discussion_r130405449
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceMatches.pm ---
@@ -28,11 +29,19 @@ sub index {
my $format = $self->param("format") || "";
 
my $rs;
-   if ( _privileged($self) ) {
+   # TO the reviewer: Do we need to override the "is_priviledged" here byt 
the standard "ignore_ds_user_table" flag?
+   # What is the reason of the is_priv test - was someone just dussmissed 
the ds_tmuser table tests
+   if ( _privileged($self)) {
--- End diff --

no idea why it was restricted to "is privileged" which is really the same 
is "is operations or above" since ldap only users don't work any more


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #767: TPv2 - disables target on update...

2017-07-31 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

TPv2 - disables target on update. a steering target is comprised of a 
source…

… and a target. changing the target represents a creation of a new target 
rather than an update per the api.

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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
updates-steering-target-ui

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

https://github.com/apache/incubator-trafficcontrol/pull/767.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 #767


commit a79bd35c3844a5573ce2863489466697b3680088
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-07-31T15:27:02Z

disables target on update. a steering target is comprised of a source and a 
target. changing the target represents a creation of a new target rather than 
an update per the api.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #761: Add TO client DS ByServer, Regex...

2017-07-31 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/761#discussion_r130380695
  
--- Diff: traffic_ops/client/delivery_service_endpoints.go ---
@@ -22,6 +22,10 @@ func deliveryServicesEp() string {
return apiBase + dsPath + ".json"
 }
 
+func deliveryServicesByServerEp(id string) string {
+   return apiBase + "/servers/" + id + dsPath + ".json"
--- End diff --

consistency is good


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #764: [TC-480] - adds exampleurls (aka...

2017-07-28 Thread mitchell852
GitHub user mitchell852 opened a pull request:

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

[TC-480] - adds exampleurls (aka edge fqdns) to ds view/edit form



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

$ git pull https://github.com/mitchell852/incubator-trafficcontrol 
tc-480-example-urls

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

https://github.com/apache/incubator-trafficcontrol/pull/764.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 #764


commit e70b36e7250f161eda3ce6c74bf83c69ea99215f
Author: Jeremy Mitchell <mitchell...@gmail.com>
Date:   2017-07-28T19:02:51Z

adds exampleurls (aka edge fqdns) to ds view/edit form




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129934310
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -1021,6 +1030,10 @@ sub details {
}
 
my $rs_ds_data = $row->deliveryservice_servers;
+   #FOR THE REVIEWER - Currently I do not check DS tenancy 
here.
--- End diff --

same thing. always check tenancy for anything ds-related imo


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129934238
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -947,6 +952,10 @@ sub details_v11 {
}
 
my $rs_ds_data = $row->deliveryservice_servers;
+   #FOR THE REVIEWER - Currently I do not check DS tenancy here.
--- End diff --

always check tenancy in my opinion if use_tenancy=1. never rely on roles / 
capabilities because roles can be setup to include whatever capabilities the 
system owner wants. there is no harm in always ensuring the user has the proper 
tenancy. they can always sidestep tenancy by assigning themself with the root 
tenant...


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129933537
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -569,10 +575,17 @@ sub get_unassigned_servers_by_dsid {
$ds_server_criteria{'deliveryservice.id'} = $ds_id;
 
my @assigned_servers;
-   if ( _privileged($self) || 
$self->is_delivery_service_assigned($ds_id) ) {
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$ds->tenant_id)) {
+   return $self->forbidden();
+   }
+   elsif ( _privileged($self) || $tenant_utils->ignore_ds_users_table() 
|| $self->is_delivery_service_assigned($ds_id) ) {
@assigned_servers = 
$self->db->resultset('DeliveryserviceServer')->search( \%ds_server_criteria, { 
prefetch => [ 'deliveryservice', 'server' ] } )->get_column('server')->all();
}
else {
+   #for the reviewer - I believe it should turn into forbidden as 
well
--- End diff --

yes, this is wrong. should be $self->forbidden


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129913844
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceServer.pm ---
@@ -27,6 +28,11 @@ sub index {
my @data;
my $orderby = $self->param('orderby') || "deliveryservice";
 
+   #FOR THE REVIEWER - Currently I do not check DS tenancy here.
--- End diff --

if this operation is of a cdn owner for debug then the cdn owner needs to 
have the root tenant and there will be no fear of hidden data.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129913397
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceServer.pm ---
@@ -27,6 +28,11 @@ sub index {
my @data;
my $orderby = $self->param('orderby') || "deliveryservice";
 
+   #FOR THE REVIEWER - Currently I do not check DS tenancy here.
--- End diff --

in my opinion tenancy is ALWAYs checked. it doesn't hurt, does it? it's 
always good imo to ensure the user (regardless of role) is only seeing the 
appropriate delivery services...


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129930025
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceServer.pm ---
@@ -223,8 +240,19 @@ sub remove_server_from_ds {
my $ds_id   = $self->param('dsId');
my $server_id   = $self->param('serverId');
 
-   if ( !_privileged($self) && 
!$self->is_delivery_service_assigned($ds_id) ) {
-   $self->forbidden("Forbidden. Delivery service not assigned to 
user.");
+   my $tenant_utils = Utils::Tenant->new($self);
+   if ( !_privileged($self) && !$tenant_utils->ignore_ds_users_table() 
&& !$self->is_delivery_service_assigned($ds_id) ) {
--- End diff --

wasn't ignore_ds_users_table going to go away? so this would become

if ( !_privileged($self) && !$tenant_utils->use_tenancy() && 
!$self->is_delivery_service_assigned($ds_id) ) {


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129914745
  
--- Diff: traffic_ops/app/lib/API/DeliveryServiceServer.pm ---
@@ -80,15 +86,21 @@ sub assign_servers_to_ds {
return $self->forbidden();
}
 
-   if ( ref($servers) ne 'ARRAY' ) {
-   return $self->alert("Servers must be an array");
-   }
-
my $ds = $self->db->resultset('Deliveryservice')->find( { id => $ds_id 
} );
if ( !defined($ds) ) {
return $self->not_found();
}
 
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$ds->tenant_id)) {
+   return $self->alert("Invalid delivery-service assignment. The 
delivery-service is not avaialble for your tenant.");
--- End diff --

this could be a forbidden


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129933912
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -726,41 +746,26 @@ sub get_servers_by_type {
my $orderby   = $self->param('orderby') || "hostName";
my $orderby_snakecase = lcfirst( decamelize($orderby) );
 
+   my $forbidden;
--- End diff --

not sure why this changed. seems unrelated to delivery services but if you 
are trying to establish consistency, i am fine with 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129933611
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -569,10 +575,17 @@ sub get_unassigned_servers_by_dsid {
$ds_server_criteria{'deliveryservice.id'} = $ds_id;
 
my @assigned_servers;
-   if ( _privileged($self) || 
$self->is_delivery_service_assigned($ds_id) ) {
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$ds->tenant_id)) {
--- End diff --

you might want to rethink this if/elseif/else seems wrong.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129931534
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -445,18 +431,27 @@ sub get_servers_by_dsid {
my $orderby_snakecase = lcfirst( decamelize($orderby) );
my $helper= new Utils::Helper( { mojo => $self } );
 
+   my $ds = $self->db->resultset('Deliveryservice')->search( { 'me.id' => 
$ds_id }, { prefetch => ['type'] } )->single();
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+
my @ds_servers;
my $forbidden;
-   if ( _privileged($self) || 
$self->is_delivery_service_assigned($ds_id) ) {
+   my $servers;
+
+   if (defined($ds) && 
!$tenant_utils->is_ds_resource_accessible($tenants_data, $ds->tenant_id)) {
+   $forbidden = "Forbidden. Delivery service not available for 
user's tenant.";
+   return ($forbidden, $servers);
+   }
+   elsif ( _privileged($self) || $tenant_utils->ignore_ds_users_table() 
|| $self->is_delivery_service_assigned($ds_id) ) {
--- End diff --

same thing. is this going to change to $tenant_utils->use_tenancy()


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafficcontrol pull request #752: [TC-460] Ds tenancy validation s...

2017-07-27 Thread mitchell852
Github user mitchell852 commented on a diff in the pull request:


https://github.com/apache/incubator-trafficcontrol/pull/752#discussion_r129931600
  
--- Diff: traffic_ops/app/lib/API/Server.pm ---
@@ -489,11 +484,22 @@ sub get_edge_servers_by_dsid {
my $self= shift;
my $ds_id   = $self->param('id');
 
+   my $ds = $self->db->resultset('Deliveryservice')->search( { 'me.id' => 
$ds_id } )->single();
+   if ( !defined($ds) ) {
+   return $self->not_found();
+   }
+
my $ds_servers;
-   if ( _privileged($self) || 
$self->is_delivery_service_assigned($ds_id) ) {
+   my $tenant_utils = Utils::Tenant->new($self);
+   my $tenants_data = $tenant_utils->create_tenants_data_from_db();
+   if (!$tenant_utils->is_ds_resource_accessible($tenants_data, 
$ds->tenant_id)) {
+   return $self->forbidden();
--- End diff --

can you add a forbidden 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   3   4   5   >