MrtnBalazs opened a new pull request, #656:
URL: https://github.com/apache/knox/pull/656

   ## What changes were proposed in this pull request?
   
   A new maven module was added which contains the angular version of the 
javascript token generation web application.
   The angular version works just like the old javascript site only a couple of 
improvements were added:
   -Invalid error message when form is invalid is now instantaneous (before you 
would have to press the generate button)
   -When form is invalid the generation button is now disabled
   -When token state service status request data prohibits token generation on 
the site, now the generation request is not sent even if the generation button 
is enabled through developer settings
   -X-XSRF-Header header is added now with the requests
   -Now there is no error message when lifespan input is disabled and maximum 
token ttl is under 1 hour to ask the user whether he wants to change the 
lifespan even though it is not possible
   -Now theres a pop up error when token generation fails
   -Now when lifespan input is disabled you can not enable it in the developer 
settings and adjust it and send a request with the adjusted lifespan
   
   ## How was this patch tested?
   
   Generated a token with the new site and used it in a curl request:
   ```
   curl -ku 
Token:eyJqa3UiOiJodHRwczpcL1wvbG9jYWxob3N0Ojg0NDNcL2dhdGV3YXlcL2hvbWVwYWdlXC9rbm94dG9rZW5cL2FwaVwvdjFcL2p3a3MuanNvbiIsImtpZCI6Ikx2X21EWFMySWUwUk90SGN0b2R0SVJLQ2syWVpxX2dDMDZvazlyanRNOTQiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImprdSI6Imh0dHBzOlwvXC9sb2NhbGhvc3Q6ODQ0M1wvZ2F0ZXdheVwvaG9tZXBhZ2VcL2tub3h0b2tlblwvYXBpXC92MVwvandrcy5qc29uIiwia2lkIjoiTHZfbURYUzJJZTBST3RIY3RvZHRJUktDazJZWnFfZ0MwNm9rOXJqdE05NCIsImlzcyI6IktOT1hTU08iLCJleHAiOjE2NjYzNTgxMTUsIm1hbmFnZWQudG9rZW4iOiJmYWxzZSIsImtub3guaWQiOiI3MDY4MmE5OC1mZTY1LTRmYzEtYjJlZi1kMjYxMjJiZmMxMTIifQ.RRyaAiZEP4fhgnIoqSiCiBv53W_HeNYWrQ0V0Sbq3FUuu5FbK4CmP1PmK4w_X-4xENuG34KQldCrU2el0cJ-EmcJx3BfL1x4lLOlfR7DS-IqXVwuijOvfRSknoeWHFNCyy_T7cS2g62Qfw1O9-cWdCuQQonTp_pWt8pmBeZbCp-CfgLQsxlpUS8KkZPoI1tXJlltTeZ2qRP_RWYTj7duI70n4JhPVKdaAt6gsYgkxz2FCSsh13pmaSkWkN24z4_qqWDBzia7Ce1nqBmPP7i1fAgWl8EdP65yfQ9purjoVXxUHk-UZSSUQuHPI_RsMuHcH8qs-ec8v5cav_qtxFXMBQ
 https://localhost:8443/gateway/test/hive
   ```
   I tested the feature manually by comparing the old and new site with 
different configurations:
   Deleted `knox.token.ttl` configuration or set it to `-6` -> default 30 
second maximum lifetime showed up
   Changed `knox.token.target.url` -> changed valued showed up
   Changed `knox.token.client.data` -> changed value showed up
   Set `knox.token.exp.server-managed` to `true` -> token generation is enabled
   Set `knox.token.exp.server-managed` to `false` -> token generation is 
disabled and error message is shown
   Set `knox.token.lifespan.input.enabled` to `true` -> lifespan input fields 
are shown and used in the request 
   Set `knox.token.lifespan.input.enabled` to `false` -> lifespan input fields 
are not shown and not used in the request
   Set token state service implementation in `gateway-site.xml` -> Backend 
initialization failed error message.
   ```
   <property>
         <name>gateway.service.tokenstate.impl</name>
         
<value>org.apache.knox.gateway.services.token.impl.DefaultTokenStateService</value>
   </property>
   ```
   Made the form invalid by changing all three lifespan input numbers to 0, 
deleted one of the numbers, made one of the numbers smaller then the minimum 
and higher then the maximum limit, made one of the numbers a rational number.


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to