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

doc: add report_user_by_email.py to examples #242

Closed

Conversation

MarkTripod-Duo
Copy link
Contributor

Description

Added new example script for retrieving user by email address via Duo Admin API

Motivation and Context

This was done in response to issue #231

How Has This Been Tested?

Tested via manual execution for both positive and negative result requests

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] Documentation
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

# Retrieve user info from API:
email_address = get_next_arg('E-mail address of user to retrieve: ')
req_params = {"email": email_address}
# There is no get_user_by_email in the duo_client_python library, so we use the generic api_call
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add a function in there? I don't know if this a common thing that people might want.

Copy link
Contributor Author

@MarkTripod-Duo MarkTripod-Duo Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a new method to the library specifically for this use case should be rather trivial. I do not have any data on generalized API usage for user searches via email address to offer an opinion on whether a separate method is warranted. Perhaps adding a new optional parameter to the get_users() method to specify the email address could be an alternate possible update to the library. However, adding a get_user_by_email() method would maintain consistency with other methods available.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote let's add a get_user_by_email method - I agree it's easy and consistent. Do you want to handle that Mark?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New PR submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants