Skip to content

Commit

Permalink
feat: add get_user_by_email() method to admin.py
Browse files Browse the repository at this point in the history
doc: add report_user_by_email.py to examples
  • Loading branch information
MarkTripod-Duo committed Dec 12, 2023
1 parent 023cbe6 commit d436244
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions duo_client/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,24 @@ def get_user_by_id(self, user_id):
response = self.json_api_call('GET', path, {})
return response

def get_user_by_email(self, email):
"""
Returns user specified by email.
email - User to fetch
Returns user object.
Raises RuntimeError on error.
"""
params = {
'email': email,
}
response = self.json_api_call('GET',
'/admin/v1/users',
params)
return response

def get_users_by_name(self, username):
"""
Returns user specified by username.
Expand Down

0 comments on commit d436244

Please sign in to comment.