Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add enrollment_unversal_prompt_enabled to admin api settings #258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions duo_client/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
'email_activity_notification_enabled': <bool:can users get activity notifications via email>,
'push_activity_notification_enabled': <bool:can users get activity notifications via Duo Mobile>,
'unenrolled_user_lockout_threshold': <int:days until a user will be locked out due to being unenrolled>,
'enrollment_universal_prompt_enabled': <bool:will email enrollment use Universal Prompt experience>,
}


Expand Down Expand Up @@ -1987,6 +1988,7 @@ def update_settings(self,
email_activity_notification_enabled=None,
push_activity_notification_enabled=None,
unenrolled_user_lockout_threshold=None,
enrollment_universal_prompt_enabled=None,
):
"""
Update settings.
Expand Down Expand Up @@ -2029,6 +2031,7 @@ def update_settings(self,
email_activity_notification_enabled = True|False|None
push_activity_notification_enabled = True|False|None
unenrolled_user_lockout_threshold = <int:number of days>|0|None
enrollment_universal_prompt_enabled = True|False|None

Returns updated settings object.

Expand Down Expand Up @@ -2116,6 +2119,10 @@ def update_settings(self,
params['unenrolled_user_lockout_threshold'] = str(
unenrolled_user_lockout_threshold
)
if enrollment_universal_prompt_enabled is not None:
params['enrollment_universal_prompt_enabled'] = (
'1' if enrollment_universal_prompt_enabled else '0'
)

if not params:
raise TypeError("No settings were provided")
Expand Down
2 changes: 2 additions & 0 deletions tests/admin/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_update_settings(self):
email_activity_notification_enabled=True,
push_activity_notification_enabled=True,
unenrolled_user_lockout_threshold=100,
enrollment_universal_prompt_enabled=True,
)
response = response[0]
self.assertEqual(response['method'], 'POST')
Expand Down Expand Up @@ -85,4 +86,5 @@ def test_update_settings(self):
'email_activity_notification_enabled': '1',
'push_activity_notification_enabled': '1',
'unenrolled_user_lockout_threshold': '100',
'enrollment_universal_prompt_enabled': '1',
})
Loading