From bd8a906e01a16748b328a8af11ed76191e2ddd84 Mon Sep 17 00:00:00 2001 From: Aaron McConnell Date: Fri, 28 Sep 2018 13:35:04 -0400 Subject: [PATCH] Rename async parameter, be stricter about expecting a boolean --- .travis.yml | 3 --- duo_client/auth.py | 8 ++++---- duo_client/auth_v1.py | 8 ++++---- duo_client/client.py | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27a25e0..d2f1363 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,3 @@ install: - pip install -r requirements-dev.txt script: - nose2 -matrix: - allow_failures: - - python: 3.7-dev diff --git a/duo_client/auth.py b/duo_client/auth.py index 4c83a06..2852eb8 100644 --- a/duo_client/auth.py +++ b/duo_client/auth.py @@ -112,7 +112,7 @@ def auth(self, username=None, user_id=None, ipaddr=None, - async=False, + async_txn=False, type=None, display_username=None, pushinfo=None, @@ -121,7 +121,7 @@ def auth(self, """ Perform second-factor authentication for a user. - If async is True, returns: { + If async_txn is True, returns: { 'txid': , } @@ -131,14 +131,14 @@ def auth(self, 'status_msg': , } - If Trusted Devices is enabled, async is not True, and status is + If Trusted Devices is enabled, async_txn is not True, and status is 'allow', another item is returned: * trusted_device_token: """ params = { 'factor': factor, - 'async': str(int(bool(async))), + 'async': str(int(async_txn)), } if username is not None: params['username'] = username diff --git a/duo_client/auth_v1.py b/duo_client/auth_v1.py index dfd2214..4de7ddc 100644 --- a/duo_client/auth_v1.py +++ b/duo_client/auth_v1.py @@ -69,17 +69,17 @@ def auth(self, username, phone=PHONE1, pushinfo=None, ipaddr=None, - async=False): + async_txn=False): """ Returns True if authentication was a success, else False. - If 'async' is True, returns txid of the authentication transaction. + If 'async_txn' is True, returns txid of the authentication transaction. """ params = { 'user': username, 'factor': factor, } - if async: + if async_txn: params['async'] = '1' if pushinfo is not None: params['pushinfo'] = pushinfo @@ -100,7 +100,7 @@ def auth(self, username, response = self.json_api_call('POST', '/rest/v1/auth', params) if self.auth_details: return response - if async: + if async_txn: return response['txid'] return response['result'] == 'allow' diff --git a/duo_client/client.py b/duo_client/client.py index 735bfd0..32ba2e8 100644 --- a/duo_client/client.py +++ b/duo_client/client.py @@ -5,7 +5,7 @@ from __future__ import print_function import six -__version__ = '3.3.0' +__version__ = '4.0.0' import base64 import collections