The  Traffic Portal cdn/dnssec/generate page passes a human-readable string, 
which catastrophically breaks that CDN's DNSSEC keys without 
https://github.com/apache/trafficcontrol/pull/2720 (see 
https://github.com/apache/trafficcontrol/issues/2723). 

With that PR in TO, the Portal's input will be accepted and not break the 
world, even though it doesn't conform to the API proper. But, the Portal still 
needs fixed to send the correct API field, _especially_ because this allows us 
to fix the catastrophic bug if someone updates the Portal but not TO.

The fix should be fairly simple, something like
`traffic_portal/app/src/common/modules/form/cdnDnssecKeys/FormCdnDnssecKeysController.js`
```
                modalInstance.result.then(function() {
-                       generate();
+                       var expirationDateMS = 
Date.parse($scope.ksk_new.expirationDate); // convert human-readable text back 
to the UNIX epoch the Traffic Ops API accepts
+                       if( isNaN(expirationDateMS) ) {
+                               messageModel.setMessages([ { level: 'error', 
text: 'invalid date' } ], false);
+                       } else {
+                               $scope.ksk_new.expirationDate = 
expirationDateMS / 1000;
+                               generate();
+                       }
```

If someone can test that code in a working TP+TO+Riak setup, and make a PR, 
that'd be awesome.

[ Full content available at: 
https://github.com/apache/trafficcontrol/issues/2734 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to