ProtoLife / daptics-api

API documentation and clients for the daptics.ai design of experiments engine
https://daptics.ai
GNU General Public License v3.0
1 stars 1 forks source link

Configure login and other options for DapticsClient #10

Closed nhpackard closed 4 years ago

nhpackard commented 5 years ago

Could we have a function that queries for login and password, so that we don't have to have the login info hanging around in the notebook.

pzingg commented 5 years ago

Is the suggestion that we add a callback function to the DapticsClient constructor arguments, that if supplied, will be called to obtain the username and password? I can think of three ways to do this:

  1. Predefined environment variables (DAPTICS_HOST, DAPTICS_USER, DAPTICS_PASSWORD, DAPTICS_AUTO_EXPORT_PATH, DAPTICS_AUTO_TASK_START, and DAPTICS_AUTO_TASK_TIMEOUT) that would supply these parameters to DapticsClient
  2. Credentials JSON config file with {"host": host, "user": user, "password": password, "auto_export_path": ...} that would be used to construct DapticsClient
  3. Login callback function argument passed to constructor that would return a (username, password) Python tuple. This function could be interactive, I guess.

Or any combination of the above.