You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by el...@apache.org on 2018/11/09 17:14:22 UTC

[trafficcontrol] 04/05: Add Changelog for ToDnssecRefresh.pl login req

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

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

commit d596fe3c495929aaca9d9697ff6882e0a2117a62
Author: Robert Butts <ro...@apache.org>
AuthorDate: Tue Oct 23 15:27:44 2018 -0600

    Add Changelog for ToDnssecRefresh.pl login req
---
 CHANGELOG.md                                        |  3 ++-
 traffic_ops/traffic_ops_golang/cdn/dnssecrefresh.go | 10 ++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4a76532..12bfcbe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
   
 ### Changed
 - Issue 2821: Fixed "Traffic Router may choose wrong certificate when SNI names overlap"
-  
+- traffic_ops/app/bin/checks/ToDnssecRefresh.pl now requires "user" and "pass" parameters of an operations-level user! Update your scripts accordingly! This was necessary to move to an API endpoint with proper authentication, which may be safely exposed.
+
 ## [3.0.0] - 2018-10-30
 ### Added
 - Removed MySQL-to-Postgres migration tools.  This tool is supported for 1.x to 2.x upgrades only and should not be used with 3.x.
diff --git a/traffic_ops/traffic_ops_golang/cdn/dnssecrefresh.go b/traffic_ops/traffic_ops_golang/cdn/dnssecrefresh.go
index 554dee5..f97fca7 100644
--- a/traffic_ops/traffic_ops_golang/cdn/dnssecrefresh.go
+++ b/traffic_ops/traffic_ops_golang/cdn/dnssecrefresh.go
@@ -53,12 +53,6 @@ func RefreshDNSSECKeys(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-		// dbCtx, _ := context.WithTimeout(r.Context(), RefreshDNSSECKeysTxTimeout)
-		// tx, err := db.BeginTx(dbCtx, nil)
-		// if err != nil {
-		// 	api.HandleErr(w, r, noTx, http.StatusInternalServerError, nil, errors.New("RefresHDNSSECKeys beginning transaction: "+err.Error()))
-		// }
-
 		tx, err := db.Begin()
 		if err != nil {
 			api.HandleErr(w, r, noTx, http.StatusInternalServerError, nil, errors.New("RefresHDNSSECKeys beginning tx: "+err.Error()))
@@ -117,7 +111,7 @@ func doDNSSECKeyRefresh(tx *sql.Tx, cfg *config.Config) {
 		dses = append(dses, string(ds))
 	}
 
-	dsMatchlists, err := deliveryservice.GetDeliveryServicesMatchLists(dses, tx) // map[string][]tc.DeliveryServiceMatch
+	dsMatchlists, err := deliveryservice.GetDeliveryServicesMatchLists(dses, tx)
 	if err != nil {
 		log.Errorln("refreshing DNSSEC Keys: getting ds matchlists: " + err.Error())
 		doCommit = false
@@ -246,7 +240,7 @@ func doDNSSECKeyRefresh(tx *sql.Tx, cfg *config.Config) {
 					continue
 				}
 				log.Infoln("The ZSK keys for '" + ds.DSName + "' are expired!")
-				effectiveDate := expiration.Add(ttl * time.Duration(effectiveMultiplier) * -1) // -1 to add
+				effectiveDate := expiration.Add(ttl * time.Duration(effectiveMultiplier) * -1) // -1 to subtract
 				isKSK := false
 				newKeys, err := regenExpiredKeys(isKSK, dsKeys, effectiveDate, false, false)
 				if err != nil {