def isAccessIdAuthentic(accessID): API_KEY_DB = dc.getApiKeysFromDb() if API_KEY_DB != False: if accessID in API_KEY_DB.keys(): customerDataDict = API_KEY_DB[accessID] print("INFO: FILEUPLOAD: Access ID authenticated. Requester identified as: "+ customerDataDict["customer"]) return True else: print("ERROR: FILEUPLOAD: Invalid AccessID, request denied.") return False
DB_PATH = CONSTANTS.DB_DIR WORKSPACE_DIR = CONSTANTS.WORKSPACE_DIR # These are directory names NOT path strings. UPLOAD_ZIP_PATH = CONSTANTS.USER_UPLOADS_ZIP_DIR UPLOAD_TXT_PATH = CONSTANTS.USER_UPLOADS_TEXT_DIR ################################ Init Databases ############################## try: from application import Data_Controller as dc print("INFO: HyAPI_ML: DB Controller initialized successfully.") except: import Data_Controller as dc print("DEBUG: HyAPI_ML: Safe Mode: Imported alternative DBC.") API_KEY_DB = dc.getApiKeysFromDb() REQ_HISTORY = dc.getRequestHistory() FILES_ON_SERVER = dc.getFilesOnServer() def isInitSuccessful(): if API_KEY_DB == False: return False if REQ_HISTORY == False: return False return True global status_msg status_msg = "" """