shodan-python icon indicating copy to clipboard operation
shodan-python copied to clipboard

Add input validation to shodan convert command

Open rmhowe425 opened this issue 2 years ago • 0 comments

Issue

As shown in #203, currently the shodan convert command only supports converting .json.gz files to one of the supported file types listed in the CLI help menu.

There are currently no guardrails in place that would prevent a user from converting a file type other than .json.gz to any file type.

Enhancement

I am proposing the following:

  • Implement input validation to ensure that the input file type has a file extension of json.gz. Implementation should be contained within a function so that it is referenced as a keyword parameter in the @click.argument input argument.

  • Implement input validation to ensure that the output format for the shodan convert command is one of the supported file types. Implementation should be contained within a function so that it is referenced as a keyword parameter @click.argument for the format argument.

rmhowe425 avatar Dec 03 '23 03:12 rmhowe425