diff --git a/.gitignore b/.gitignore index e0638c0b2c7c34552c5c27073f92d926b6b4cc3b..1710afb5c58a4214c4465ec84668d9f2a9326df8 100644 --- a/.gitignore +++ b/.gitignore @@ -111,12 +111,13 @@ venv.bak/ credentials.json # API Gateway credentials (if instructions in README are followed) -api_gateway_credentials.json -api_gateway_credentials.yaml -api_gateway_credentials.yml +*.json +!api_gateway_credentials-example.json -# Local configuration -gsuitesync.yaml +# Potential local configuration files +*.yaml +*.yml +!configuration-example.yaml .vscode/ cache/ diff --git a/README.md b/README.md index f82c9c358cd481419a1e8b0371d9272e94acdd48..eec41c7f04ec43c7ce2e9ad6e14746ab540ee08f 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,8 @@ in the domain **subject to the listed scopes**. ## Preparing API Gateway credentials The `api_gateway` section in the configuration file specifies where the -credentials for accessing API Gateway can be found. These credentials must be +credentials for accessing API Gateway can be found; see the +[example file](api_gateway_credentials-example.json). These credentials must be supplied as a file in YAML/JSON format with values for the keys `base_url`, `client_id` and `client_secret`. The key and secret can be found on the [Apigee apps page](https://apigee.google.com/organizations/api-prod-a3dc87f7/apps) diff --git a/api_gateway_credentials-example.json b/api_gateway_credentials-example.json new file mode 100644 index 0000000000000000000000000000000000000000..d923ab9ecbb8366447d7adee477902ef97138c83 --- /dev/null +++ b/api_gateway_credentials-example.json @@ -0,0 +1,5 @@ +{ + "client_id": "API Gateway Client ID", + "client_secret": "API Gateway Client Secret", + "base_url": "https://api.apps.cam.ac.uk/lookup/v1" +} \ No newline at end of file diff --git a/gsuitesync/config/utils.py b/gsuitesync/config/utils.py index fad7b36a0ed9c10e2c69108124085ceecc5107a6..0dedd6b700a4bb479a67f45892e506de3ac6aff5 100644 --- a/gsuitesync/config/utils.py +++ b/gsuitesync/config/utils.py @@ -27,6 +27,7 @@ def load_configuration(location=None): paths = [] paths.extend([ os.path.join(os.getcwd(), 'gsuitesync.yaml'), + os.path.join(os.getcwd(), 'configuration.yaml'), os.path.expanduser('~/.gsuitesync/configuration.yaml'), '/etc/gsuitesync/configuration.yaml' ])