From 753f1e7dc13a58d9c5eb339246b937f4b23f82d9 Mon Sep 17 00:00:00 2001 From: Sebastian Serfling Date: Wed, 1 Nov 2023 09:03:49 +0100 Subject: [PATCH] Remove API key From Console --- Classes/main_classes.py | 8 +++++++- main.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Classes/main_classes.py b/Classes/main_classes.py index cf8fc12..225f358 100644 --- a/Classes/main_classes.py +++ b/Classes/main_classes.py @@ -173,4 +173,10 @@ class CL_ADD_GROUP_VOLUME(BaseModel): path: str letter: str group: str - dbname: str \ No newline at end of file + dbname: str + +class CL_ERROR_LOG(BaseModel): + datum: str + hostname: str + samaccountname: str + errorcode: str \ No newline at end of file diff --git a/main.py b/main.py index 09c0a48..dda2f9b 100644 --- a/main.py +++ b/main.py @@ -296,7 +296,7 @@ async def get_addreport_group(get: CL.CL_ADD_REPORT_GROUP,api_key: APIKey = Depe return f"Create {get.query} - {get.dbname}" @app.post("/report/errolog") -async def get_errorlog(get: CL.CL_ADD_REPORT_GROUP,api_key: APIKey = Depends(auth.get_api_key)): +async def get_errorlog(get: CL.CL_ERROR_LOG,api_key: APIKey = Depends(auth.get_api_key)): print(database(f"INSERT INTO {get.dname}.ERROR_LOG (datum,hostname,samaccouuntname,fehlercode) VALUES ({get.datum},{get.hostname},{get.user},{get.errocode})","","")) return f"ADD {get.errocode} - {get.hostname}"