diff --git a/duo_client/admin.py b/duo_client/admin.py index d01163ed..490e14b2 100644 --- a/duo_client/admin.py +++ b/duo_client/admin.py @@ -114,6 +114,7 @@ 'user_managers_can_put_users_in_bypass': , 'email_activity_notification_enabled': , 'push_activity_notification_enabled': , + 'unenrolled_user_lockout_threshold': , } @@ -1985,6 +1986,7 @@ def update_settings(self, user_managers_can_put_users_in_bypass=None, email_activity_notification_enabled=None, push_activity_notification_enabled=None, + unenrolled_user_lockout_threshold=None, ): """ Update settings. @@ -2026,6 +2028,7 @@ def update_settings(self, user_managers_can_put_users_in_bypass - True|False|None email_activity_notification_enabled = True|False|None push_activity_notification_enabled = True|False|None + unenrolled_user_lockout_threshold = |0|None Returns updated settings object. @@ -2109,6 +2112,10 @@ def update_settings(self, params['push_activity_notification_enabled'] = ( '1' if push_activity_notification_enabled else '0' ) + if unenrolled_user_lockout_threshold is not None: + params['unenrolled_user_lockout_threshold'] = str( + unenrolled_user_lockout_threshold + ) if not params: raise TypeError("No settings were provided") diff --git a/tests/accountAdmin/base.py b/tests/accountAdmin/base.py index 882e404e..ebc0eda1 100644 --- a/tests/accountAdmin/base.py +++ b/tests/accountAdmin/base.py @@ -6,7 +6,7 @@ class TestAccountAdmin(unittest.TestCase): def setUp(self): - kwargs = {'ikey': 'test_ikey', 'skey': 'test_skey', 'host': 'example.com'} + kwargs = {'ikey': 'test_ikey', 'skey': 'test_skey', 'host': 'example.com', 'child_api_host': 'example2.com'} self.client = duo_client.admin.AccountAdmin( 'DA012345678901234567', **kwargs) # monkeypatch client's _connect() diff --git a/tests/admin/test_settings.py b/tests/admin/test_settings.py index b92ffb15..908fec5d 100644 --- a/tests/admin/test_settings.py +++ b/tests/admin/test_settings.py @@ -40,7 +40,10 @@ def test_update_settings(self): reactivation_url="https://www.example.com", reactivation_integration_key='DINTEGRATIONKEYTEST0', security_checkup_enabled=True, - user_managers_can_put_users_in_bypass=False + user_managers_can_put_users_in_bypass=False, + email_activity_notification_enabled=True, + push_activity_notification_enabled=True, + unenrolled_user_lockout_threshold=100, ) response = response[0] self.assertEqual(response['method'], 'POST') @@ -79,4 +82,7 @@ def test_update_settings(self): 'reactivation_integration_key': 'DINTEGRATIONKEYTEST0', 'security_checkup_enabled': '1', 'user_managers_can_put_users_in_bypass': '0', + 'email_activity_notification_enabled': '1', + 'push_activity_notification_enabled': '1', + 'unenrolled_user_lockout_threshold': '100', })