Skip to content

Commit

Permalink
Add pending_deletion_days to admin settings (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldllano authored Feb 10, 2023
1 parent a161b92 commit f6c9cd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions duo_client/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
Settings objects are returned in the following format:
{'inactive_user_expiration': <int:days until expiration>|0,
'pending_deletion_days': <int:days a user will be in pending deletion status>,
'sms_message': <str:sms message>,
'name': <str:name>,
'sms_batch': <int:sms batch size>,
Expand Down Expand Up @@ -1866,6 +1867,7 @@ def update_settings(self,
lockout_threshold=None,
lockout_expire_duration=None,
inactive_user_expiration=None,
pending_deletion_days=None,
log_retention_days=None,
sms_batch=None,
sms_expiration=None,
Expand Down Expand Up @@ -1904,6 +1906,7 @@ def update_settings(self,
lockout_threshold - <int:number of attempts>|None
lockout_expire_duration - <int:minutes>|0|None
inactive_user_expiration - <int:number of days>|None
pending_deletion_days - <int:number of days>|None
log_retention_days - <int:number of days>|0|None
sms_batch - <int:batch size>|None
sms_expiration - <int:minutes>|None
Expand Down Expand Up @@ -1948,6 +1951,8 @@ def update_settings(self,
params['lockout_expire_duration'] = str(lockout_expire_duration)
if inactive_user_expiration is not None:
params['inactive_user_expiration'] = str(inactive_user_expiration)
if pending_deletion_days is not None:
params['pending_deletion_days'] = str(pending_deletion_days)
if log_retention_days is not None:
params['log_retention_days'] = str(log_retention_days)
if sms_batch is not None:
Expand Down Expand Up @@ -2714,8 +2719,8 @@ def update_admin(self, admin_id,
name=None,
phone=None,
password=None,
password_change_required=None,
status=None,
password_change_required=None,
status=None,
):
"""
Update one or more attributes of an administrator.
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 @@ -12,6 +12,7 @@ def test_update_settings(self):
lockout_threshold=10,
lockout_expire_duration=60,
inactive_user_expiration=30,
pending_deletion_days=5,
log_retention_days=180,
sms_batch=5,
sms_expiration=60,
Expand Down Expand Up @@ -49,6 +50,7 @@ def test_update_settings(self):
'lockout_threshold': ['10'],
'lockout_expire_duration': ['60'],
'inactive_user_expiration': ['30'],
'pending_deletion_days': ['5'],
'log_retention_days': ['180'],
'sms_batch': ['5'],
'sms_expiration': ['60'],
Expand Down

0 comments on commit f6c9cd6

Please sign in to comment.