You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/08 21:29:40 UTC

[1/2] incubator-trafficcontrol git commit: TC-34, fixed and issue where Traffic Ops would return a 4xx error when getting ssl keys for a DS with a period in the xml_id

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master e15a0d475 -> d1fb679e7


TC-34, fixed and issue where Traffic Ops would return a 4xx error when getting ssl keys for a DS with a period in the xml_id


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f3e13b6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f3e13b6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f3e13b6b

Branch: refs/heads/master
Commit: f3e13b6b3a0980f6bea7f962d7410835584b4024
Parents: e15a0d4
Author: Dave Neuman <ne...@apache.org>
Authored: Mon Nov 7 15:00:41 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Tue Nov 8 14:28:11 2016 -0700

----------------------------------------------------------------------
 traffic_ops/app/lib/TrafficOpsRoutes.pm              | 2 +-
 traffic_ops/app/script/update_riak_for_search.pl     | 1 +
 traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f3e13b6b/traffic_ops/app/lib/TrafficOpsRoutes.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index 0534318..9d0e546 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -515,7 +515,7 @@ sub api_routes {
 	# -- DELIVERYSERVICE: SSL KEYS
 	# Support for SSL private keys, certs, and csrs
 	# gets the latest key by default unless a version query param is provided with ?version=x
-	$r->get("/api/$version/deliveryservices/xmlId/:xmlid/sslkeys")->over( authenticated => 1 )
+	$r->get("/api/$version/deliveryservices/xmlId/#xmlid/sslkeys")->over( authenticated => 1 )
 		->to( 'SslKeys#view_by_xml_id', namespace => 'API::DeliveryService' );
 	$r->get("/api/$version/deliveryservices/hostname/#hostname/sslkeys")->over( authenticated => 1 )
 		->to( 'SslKeys#view_by_hostname', namespace => 'API::DeliveryService' );

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f3e13b6b/traffic_ops/app/script/update_riak_for_search.pl
----------------------------------------------------------------------
diff --git a/traffic_ops/app/script/update_riak_for_search.pl b/traffic_ops/app/script/update_riak_for_search.pl
index 5eb2950..6cfe6d5 100755
--- a/traffic_ops/app/script/update_riak_for_search.pl
+++ b/traffic_ops/app/script/update_riak_for_search.pl
@@ -39,6 +39,7 @@ foreach my $ds (@$dss) {
 	if ($ds->{protocol} > 0) {
 		my $xml_id = $ds->{xmlId};
 		my $cdn = $ds->{cdnName};
+		print "Updating record for: $xml_id\n";
 		my $record = &get_riak_record($xml_id, $to_url, $ua);
 		if (!defined($record)) {
 			next;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f3e13b6b/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t b/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t
index ce36467..ad33a43 100644
--- a/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t
+++ b/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t
@@ -138,6 +138,13 @@ ok $t->get_ok("/api/1.1/deliveryservices/xmlId/$key/sslkeys.json")->json_has("/r
 	->json_is( "/response/version" => $version )->json_is( "/response/country" => $country )->json_is( "/response/hostname" => $hostname )->status_is(200)
 	->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
+# #get key with period
+ok $t->get_ok("/api/1.1/deliveryservices/xmlId/foo.bar/sslkeys.json")->json_has("/response")->json_has("/response/certificate/csr")
+	->json_has("/response/certificate/key")->json_has("/response/certificate/crt")->json_is( "/response/organization" => $org )
+	->json_is( "/response/state" => $state )->json_is( "/response/city" => $city )->json_is( "/response/businessUnit" => $unit )
+	->json_is( "/response/version" => $version )->json_is( "/response/country" => $country )->json_is( "/response/hostname" => $hostname )->status_is(200)
+	->or( sub { diag $t->tx->res->content->asset->{content}; } );
+
 #get key by hostname
 my $gen_hostname = "edge.foo.top.kabletown.com";
 ok $t->get_ok("/api/1.1/deliveryservices/hostname/$gen_hostname/sslkeys.json")->json_has("/response")->json_has("/response/certificate/csr")


[2/2] incubator-trafficcontrol git commit: This closes #61

Posted by mi...@apache.org.
This closes #61


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/d1fb679e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/d1fb679e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/d1fb679e

Branch: refs/heads/master
Commit: d1fb679e7bf04e340ea370cda14ba192579be629
Parents: f3e13b6
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Tue Nov 8 14:29:23 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Tue Nov 8 14:29:23 2016 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------