smolnar82 opened a new pull request #443:
URL: https://github.com/apache/knox/pull/443


   ## What changes were proposed in this pull request?
   
   - let end-users declare a more refined lifespan
   - let end-users add a comment to the generated
   
   ## How was this patch tested?
   
   Updated and ran JUnit tests. Additionally, I did manual testing.
   
   1. Tested a wrong lifetime:
   <img width="584" alt="Screen Shot 2021-04-30 at 1 31 30 AM" 
src="https://user-images.githubusercontent.com/34065904/116630810-3ff06c00-a954-11eb-987a-32d1c401d1e6.png";>
   
   2. Tested custom lifespan (token generated at 30 Apr 2021 01:32:14 AM)
   <img width="589" alt="Screen Shot 2021-04-30 at 1 32 35 AM" 
src="https://user-images.githubusercontent.com/34065904/116630821-44b52000-a954-11eb-990a-4335240e3e7b.png";>
   
   3. Saved comment with tricky characters:
   <img width="607" alt="Screen Shot 2021-04-30 at 1 34 17 AM" 
src="https://user-images.githubusercontent.com/34065904/116630828-4aab0100-a954-11eb-83be-6191d28cd11e.png";>
   
   ```
   postgres=# select * from knox_tokens where token_id = 
'0dd15ada-4986-4de8-a261-001668af93f5';
                  token_id               |  issue_time   |  expiration   | 
max_lifetime  | username |                                  comment             
                     
   
--------------------------------------+---------------+---------------+---------------+----------+---------------------------------------------------------------------------
    0dd15ada-4986-4de8-a261-001668af93f5 | 1619739244250 | 1619825644246 | 
1620344044250 | admin    | comment with a question mark ? and my favorite 
cartoon tom & jerry !!! :)
   (1 row)
   ```
   


-- 
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