Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def target_factory(targets, user_args):
"""
Receives list of emails and user args. Fetchs API keys from config file using user_args path and cli keys.
For each target, launch target.methods() associated to found config artifacts.
Handles the hunter.io chase logic with counters from enumerate()
"""
finished = []
if user_args.config_file is not None or user_args.cli_apikeys is not None:
api_keys = get_config_from_file(user_args)
else:
api_keys = None
init_targets_len = len(targets)
query = "email"
skip_default_queries = False
if user_args.user_query is not None:
query = user_args.user_query
skip_default_queries = False
scylla_up = False
for counter, t in enumerate(targets):
c.info_news("Target factory started for {target}".format(target=t))
if user_args.debug:
current_target = target(t, debug=True)