Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Limit = 10
Directory = General.Make_Directory(Concat_Plugin_Name)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
Log_File = General.Logging(Directory, Concat_Plugin_Name)
handler = logging.FileHandler(os.path.join(Directory, Log_File), "w")
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(levelname)s - %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
try:
pyhibp.set_api_key(key=Load_Configuration())
except:
logging.warning(f"{General.Date()} - {__name__.strip('plugins.')} - Failed to set API key, make sure it is set in the configuration file.")
Query_List = General.Convert_to_List(Query_List)
if Type_of_Query == "email":
Local_Plugin_Name = Plugin_Name + "-" + Type_of_Query
Cached_Data = General.Get_Cache(Directory, Local_Plugin_Name)
if not Cached_Data:
Cached_Data = []
for Query in Query_List:
Query_Response = pyhibp.get_pastes(email_address=Query)
logging.info(Query_Response)