From ac95b3c53bbee89426b8e971f4abd302bb63bc42 Mon Sep 17 00:00:00 2001 From: Rawlin Peters Date: Mon, 18 Oct 2021 13:31:20 -0600 Subject: [PATCH] Remove the addition of the 4.1 TO API version 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 3130a23215..992cb063ce 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 fd6772247a..7a1d534854 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 b4d1502735..82af2dd50f 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 8c3ccf03ef..b2670704a1 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 3973a1593b..52e5f0c093 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/" } });