Add input validation to shodan convert command
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.argumentinput argument. -
Implement input validation to ensure that the output format for the
shodan convertcommand is one of the supported file types. Implementation should be contained within a function so that it is referenced as a keyword parameter@click.argumentfor the format argument.