rob05c opened a new issue #2734: Fix Traffic Portal cdn dnssec generate to pass 
UNIX epoch, not string
URL: https://github.com/apache/trafficcontrol/issues/2734
 
 
   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.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to