AutolabJS / autolabcli

Command line client for AutolabJS
https://autolabjs.github.io
GNU General Public License v3.0
10 stars 10 forks source link

Move credentials expiry timeout to the config file #99

Open mukkachaitanya opened 5 years ago

mukkachaitanya commented 5 years ago

Description

The timeout value for the expiry of credentials is hardcoded to 120 minutes.

Expected behavior: The time should be moved to the config file. The user should be able to modify the same accordingly by the use of prefs command.

Actual behavior: The value is currently hardcoded.

prasadtalasila commented 5 years ago

@mukkachaitanya and @rrgodhorus, it might also be beneficial to allow the user to set the timeout by using the following command.
autolabjs prefs changetimeout [ --type session --time <seconds>]

Since this is the very first issue @rrgodhorus is going to work on, he can pace himself using the following steps.

  1. Add the following new fields in the default preferences file.

    {
     "supportedLanguages" : [
       "java",
       "c",
       "cpp",
       "cpp14",
       "python2",
       "python3"
     ],
    
     "submission" : {
       "language": "java"
       },
    
     "main_server" : {
       "host": "autolab.bits-goa.ac.in",
       "port": "9000"
     },
    
     "gitlab" : {
       "host": "autolab.bits-goa.ac.in"
     }
    
      "timeouts" : {
         "session" : 7200
     }
    }
  2. Read the timeout needed in command-validator.js from preferences file.
  3. Write a new sub-command suggested above to change the default session timeout value.