apdavison / ebrains-validation-client

BSD 3-Clause "New" or "Revised" License
1 stars 4 forks source link

Expand check on 'environment' argument for BaseClient class #15

Closed appukuttan-shailesh closed 6 years ago

appukuttan-shailesh commented 6 years ago

The environment argument for the BaseClient class currently accepts only 'production' and 'dev' as valid values. This should be extended to allow users to specify their own values. Parameters appropriate for these would then be read from an external config file.

appukuttan-shailesh commented 6 years ago

@apdavison : is the following structure fine for the config file?

{
  "dev1": {
      "url": "www.....",
      "client_id": ""
  },
  "dev2": {
      "url": "www.....",
      "client_id": ""
  }
  ...
}

Do you foresee the need for any other parameters here at this point? username, password?

apdavison commented 6 years ago

Looks fine to me. We can always add further parameters later.

appukuttan-shailesh commented 6 years ago

This is the method header currently: def __init__(self, username, password=None, environment="production"):

We plan to access the config file for any values of environment apart from "environment" and "dev". Should we force a name and location for the config file (such as environ.json in the current directory), or add some new parameter for specifying the config path?

apdavison commented 6 years ago

I suggest config.json in the current directory.