Archived
1
0

changed extension of example config file and updated all references accordingly

This commit is contained in:
2019-10-24 09:52:58 +02:00
parent a66c87a7b3
commit 4ac6224e8b
3 changed files with 10 additions and 10 deletions

View File

@@ -38,10 +38,10 @@ point / template to implement you own custom logic directly. It contains a
number of examples of the implemented direct and config-based method to start. number of examples of the implemented direct and config-based method to start.
To run the config-file implementation of the client create a config file named To run the config-file implementation of the client create a config file named
`duo_api.conf` in the same directory as the script using the provided template `duo_api.conf` in the same directory as the script using the provided example
`duo_api.tmpl` and configure it for your environment and run it. To use it `duo_api.conf.dist` and configure it for your environment and run it. To use
without config file, comment out the settings and code provided for that, set it without config file, comment out the settings and code provided for that,
the configuration values for your environment and run it. set the configuration values for your environment and run it.
<a name=duo_library>duo_library.py</a> <a name=duo_library>duo_library.py</a>

View File

@@ -1,5 +1,5 @@
# #
# duo_api.tmpl - config template for duo_api.py, a pure python3 DUO API client # duo_api.conf.dist - example config for duo_api.py, a pure python3 DUO client
# #
# Version 1.0, latest version, documentation and bugtracker available at: # Version 1.0, latest version, documentation and bugtracker available at:
# https://gitlab.lindenaar.net/scripts/duo # https://gitlab.lindenaar.net/scripts/duo

View File

@@ -33,9 +33,9 @@
method to get you started. method to get you started.
To run the config-file implementation of the client, simply create a config To run the config-file implementation of the client, simply create a config
file (duo_api.conf) from the template (duo_api.tmpl) and configure it for file (duo_api.conf) from the example (duo_api.conf.dist) and configure it
your environment in the same directory as this script and run it. To use it for your environment in the same directory as this script and run it. To use
without config file, comment out the code below and provide your values. it without config file, comment out the code below and provide your values.
See https://duo.com/docs/authapi and https://duo.com/docs/adminapi for the See https://duo.com/docs/authapi and https://duo.com/docs/adminapi for the
available endpoints, parameters and responses. available endpoints, parameters and responses.
@@ -96,7 +96,7 @@ def duo_api_config(config, req, vars=None):
Returns: the API response (JSON Object) Returns: the API response (JSON Object)
To pass parameters with the request, provide a dict (section) with a key To pass parameters with the request, provide a dict (section) with a key
equal to req. Below sample ConfigParser config file for an auth request: equal to req. Below a ConfigParser config file for an auth request:
[API] [API]
host=api-XXXXXXXX.duosecurity.com host=api-XXXXXXXX.duosecurity.com
@@ -154,7 +154,7 @@ if __name__ == '__main__':
# print('Access', response['result']) # print('Access', response['result'])
# Same example as above, now using a config file, for this to work copy # Same example as above, now using a config file, for this to work copy
# the file duo_api.tmpl to duo_api.conf and update for your environment # duo_api.conf.dist to duo_api.conf and update for your environment
config = ConfigParser() config = ConfigParser()
if not config.read(splitext(argv[0])[0] + '.conf'): if not config.read(splitext(argv[0])[0] + '.conf'):
print("Missing/unreadable config file",splitext(argv[0])[0]+'.conf') print("Missing/unreadable config file",splitext(argv[0])[0]+'.conf')