You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ma...@apache.org on 2021/10/18 21:46:24 UTC

[trafficcontrol] branch master updated: Remove the addition of the 4.1 TO API version (#6297)

This is an automated email from the ASF dual-hosted git repository.

mattjackson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new fe6f36b  Remove the addition of the 4.1 TO API version (#6297)
fe6f36b is described below

commit fe6f36b98d5646e4ec5954df2f72a5abe45207a5
Author: Rawlin Peters <ra...@apache.org>
AuthorDate: Mon Oct 18 15:46:14 2021 -0600

    Remove the addition of the 4.1 TO API version (#6297)
    
    The 4.0 TO API version is currently considered unstable and under
    development, so the addition of a 4.1 TO API version was unnecessary.
    New TO API changes can currently be made to 4.0.
    
    This is a follow-up to #6282 which included the addition of 4.1.
---
 docs/source/api/v4/deliveryservices_xmlid_xmlid_sslkeys.rst | 2 +-
 lib/go-tc/deliveryservice_ssl_keys.go                       | 4 ++--
 traffic_ops/traffic_ops_golang/deliveryservice/keys.go      | 2 +-
 traffic_ops/traffic_ops_golang/routing/routes.go            | 3 ---
 traffic_portal/app/src/scripts/config.js                    | 2 +-
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/docs/source/api/v4/deliveryservices_xmlid_xmlid_sslkeys.rst b/docs/source/api/v4/deliveryservices_xmlid_xmlid_sslkeys.rst
index 3130a23..992cb06 100644
--- a/docs/source/api/v4/deliveryservices_xmlid_xmlid_sslkeys.rst
+++ b/docs/source/api/v4/deliveryservices_xmlid_xmlid_sslkeys.rst
@@ -73,7 +73,7 @@ Response Structure
 :expiration:      The expiration date of the certificate for the :term:`Delivery Service` in :rfc:`3339` format
 :sans:            The :abbr:`SANs (Subject Alternate Names)` from the SSL certificate.
 
-	.. versionadded:: 4.1
+	.. versionadded:: 4.0
 
 .. code-block:: http
 	:caption: Response Example
diff --git a/lib/go-tc/deliveryservice_ssl_keys.go b/lib/go-tc/deliveryservice_ssl_keys.go
index fd67722..7a1d534 100644
--- a/lib/go-tc/deliveryservice_ssl_keys.go
+++ b/lib/go-tc/deliveryservice_ssl_keys.go
@@ -67,14 +67,14 @@ type DeliveryServiceSSLKeys struct {
 
 // DeliveryServiceSSLKeysV4 is the representation of a DeliveryServiceSSLKeys in the latest minor version of
 // version 4 of the Traffic Ops API.
-type DeliveryServiceSSLKeysV4 = DeliveryServiceSSLKeysV41
+type DeliveryServiceSSLKeysV4 = DeliveryServiceSSLKeysV40
 
 // DeliveryServiceSSLKeysV41 structures contain information about an SSL key
 // certificate pair used by a Delivery Service.
 //
 // "V41" is used because this structure was first introduced in version 4.1 of
 // the Traffic Ops API.
-type DeliveryServiceSSLKeysV41 struct {
+type DeliveryServiceSSLKeysV40 struct {
 	DeliveryServiceSSLKeysV15
 	Sans []string `json:"sans,omitempty"`
 }
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/keys.go b/traffic_ops/traffic_ops_golang/deliveryservice/keys.go
index b4d1502..82af2dd 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/keys.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/keys.go
@@ -166,7 +166,7 @@ func GetSSLKeysByXMLID(w http.ResponseWriter, r *http.Request) {
 	}
 
 	var keyObj interface{}
-	if inf.Version.Major < 4 || (inf.Version.Major == 4 && inf.Version.Minor < 1) {
+	if inf.Version.Major < 4 {
 		keyObj = keyObjV4.DeliveryServiceSSLKeysV15
 	} else {
 		keyObj = keyObjV4
diff --git a/traffic_ops/traffic_ops_golang/routing/routes.go b/traffic_ops/traffic_ops_golang/routing/routes.go
index 8c3ccf0..b267070 100644
--- a/traffic_ops/traffic_ops_golang/routing/routes.go
+++ b/traffic_ops/traffic_ops_golang/routing/routes.go
@@ -130,9 +130,6 @@ func Routes(d ServerData) ([]Route, http.Handler, error) {
 		 * 4.x API
 		 */
 
-		// SSL Keys
-		{api.Version{Major: 4, Minor: 1}, http.MethodGet, `deliveryservices/xmlId/{xmlid}/sslkeys$`, deliveryservice.GetSSLKeysByXMLID, auth.PrivLevelAdmin, nil, Authenticated, nil, 41357729074},
-
 		// CDN lock
 		{api.Version{Major: 4, Minor: 0}, http.MethodGet, `cdn_locks/?$`, cdn_lock.Read, auth.PrivLevelReadOnly, nil, Authenticated, nil, 4134390561},
 		{api.Version{Major: 4, Minor: 0}, http.MethodPost, `cdn_locks/?$`, cdn_lock.Create, auth.PrivLevelOperations, nil, Authenticated, nil, 4134390562},
diff --git a/traffic_portal/app/src/scripts/config.js b/traffic_portal/app/src/scripts/config.js
index 3973a15..52e5f0c 100644
--- a/traffic_portal/app/src/scripts/config.js
+++ b/traffic_portal/app/src/scripts/config.js
@@ -23,4 +23,4 @@
 
 angular.module('config', [])
 
-.constant('ENV', { api: { root:'/api/4.1/', stable: "/api/3.1/" } });
+.constant('ENV', { api: { root:'/api/4.0/', stable: "/api/3.1/" } });