You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/05/02 18:49:00 UTC

[jira] [Work logged] (KNOX-2599) Improve tokengen UI

     [ https://issues.apache.org/jira/browse/KNOX-2599?focusedWorklogId=592038&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-592038 ]

ASF GitHub Bot logged work on KNOX-2599:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/May/21 18:48
            Start Date: 02/May/21 18:48
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on a change in pull request #443:
URL: https://github.com/apache/knox/pull/443#discussion_r624738363



##########
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:
       Thanks, @lmccay for your review.
   The required pattern by Java's [Duration.parse](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-) is :`PnDTnHnMn.nS`.
   Since I did not want to reinvent the wheel, we could re-use Java's own public API. Any objection?




-- 
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:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 592038)
    Time Spent: 0.5h  (was: 20m)

> Improve tokengen UI
> -------------------
>
>                 Key: KNOX-2599
>                 URL: https://issues.apache.org/jira/browse/KNOX-2599
>             Project: Apache Knox
>          Issue Type: Improvement
>    Affects Versions: 1.6.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The following improvements should be made on the {{tokengen}} application's UI:
> - let end-users declare a more refined lifespan
> - let end-users add a comment to the generated



--
This message was sent by Atlassian Jira
(v8.3.4#803005)