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 2020/03/06 15:42:38 UTC

[trafficcontrol] branch master updated: TP: Format DNSSEC keys effectiveDate in RCF3339 format (#4469)

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

mitchell852 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 de5f7b3  TP: Format DNSSEC keys effectiveDate in RCF3339 format (#4469)
de5f7b3 is described below

commit de5f7b3495d09cd3d523640b3caa70fb5bde637c
Author: Rawlin Peters <ra...@apache.org>
AuthorDate: Fri Mar 6 08:42:29 2020 -0700

    TP: Format DNSSEC keys effectiveDate in RCF3339 format (#4469)
    
    * Format DNSSEC keys effectiveDate in RCF3339 format
    
    Currently, TP is formatting the effectiveDate field in the request as
    unix epoch in MILLISECONDS. TO API expects epoch time format to be in
    SECONDS. This means that TO creates DNSSEC keys with an effective date
    ridiculously far into the future, when it was meant for the effective
    date to be "now".
    
    Alternatively, just format it as RFC3339, which the TO API can
    also parse.
    
    * Add CHANGELOG.md entry
---
 CHANGELOG.md                                                            | 1 +
 .../form/cdnDnssecKeys/generate/FormGenerateCdnDnssecKeysController.js  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf0fa61..9900def 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 
 ### Changed
 - Fix to traffic_ops_ort.pl to strip specific comment lines before checking if a file has changed.  Also promoted a changed file message from DEBUG to ERROR for report mode.
+- Fixed Traffic Portal regenerating CDN DNSSEC keys with the wrong effective date
 - Updated The Traffic Ops Python, Go and Java clients to use API version 2.0 (when possible)
 - Updated CDN-in-a-Box scripts and enroller to use TO API version 2.0
 - Updated numerous, miscellaneous tools to use TO API version 2.0
diff --git a/traffic_portal/app/src/common/modules/form/cdnDnssecKeys/generate/FormGenerateCdnDnssecKeysController.js b/traffic_portal/app/src/common/modules/form/cdnDnssecKeys/generate/FormGenerateCdnDnssecKeysController.js
index 3b4f787..dddf80e 100644
--- a/traffic_portal/app/src/common/modules/form/cdnDnssecKeys/generate/FormGenerateCdnDnssecKeysController.js
+++ b/traffic_portal/app/src/common/modules/form/cdnDnssecKeys/generate/FormGenerateCdnDnssecKeysController.js
@@ -20,7 +20,7 @@
 var FormGenerateCdnDnssecKeysController = function(cdn, dnssecKeysRequest, $scope, $location, $uibModal, formUtils, locationUtils, cdnService, messageModel) {
 
 	var generate = function() {
-		$scope.dnssecKeysRequest.effectiveDate = moment($scope.effectiveDate).format('x');
+		$scope.dnssecKeysRequest.effectiveDate = moment($scope.effectiveDate).utc().format();
 		cdnService.generateDNSSECKeys($scope.dnssecKeysRequest)
 			.then(function(result) {
 				messageModel.setMessages(result.data.alerts, true);