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

ENH: Create decorator to handle instantiating Shodan object #219

Open
rmhowe425 opened this issue Jul 20, 2024 · 0 comments
Open

ENH: Create decorator to handle instantiating Shodan object #219

rmhowe425 opened this issue Jul 20, 2024 · 0 comments

Comments

@rmhowe425
Copy link
Contributor

rmhowe425 commented Jul 20, 2024

Proposing the idea to convert get_api_key() in shodan.cli.helpers.py to a decorator that retrieves a user's API key and instantiates an instance of shodan.Shodan()

Proposed Implementation:

  • Proposed changes to existing functionality for get_api_key() shown below.
  • Add get_shodan_inst() decorator to all Shodan CLI commands.
  • Add positional api parameter to all Shodan CLI commands.
  • Remove function call to get_api_key() from Shodan CLI command function bodies.

Benefits:

  • Significantly reduces redundant code.
  • Improves overall readability of the code base.

image

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

No branches or pull requests

1 participant