lmccay commented on a change in pull request #443:
URL: https://github.com/apache/knox/pull/443#discussion_r623873998



##########
File path: 
gateway-applications/src/main/resources/applications/tokengen/app/js/tokengen.js
##########
@@ -53,20 +53,23 @@ function b64DecodeUnicode(str) {
 }
 
 var gen = function() {
+       $('#invalidLifetimeText').hide();
     var pathname = window.location.pathname;
     var topologyContext = pathname.replace(loginPageSuffix, "");;
     var baseURL = topologyContext.substring(0, 
topologyContext.lastIndexOf('/'));
     baseURL = baseURL.substring(0, baseURL.lastIndexOf('/') + 1);
     var tokenURL = topologyContext + knoxtokenURL;
     var form = document.forms[0];
     //var comment = form.comment.value;
-    var lifespan = form.lifespan.value;
+    var lt_days = form.lt_days.value;
+    var lt_hours = form.lt_hours.value;
+    var lt_mins = form.lt_mins.value;
     var _gen = function() {
         var apiUrl = tokenURL;
         //Instantiate HTTP Request
-        var params = '';
-        if (lifespan != '') {
-               params = '?lifespan=' + lifespan;
+        var params = '?lifespan=P' + lt_days + "DT" + lt_hours + "H" + lt_mins 
+ "M";  //we need to support Java's Duration pattern

Review comment:
       So, this would end up with a query param like: "1DT2H3M"?
   Why are we using DT instead of D?
   We are also going to be exposing this as a general API.
   Wondering whether we would like to be able to just say 8H for 8 hours 
instead of "0DT8H0M".




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to