Remove API key From Console
parent
2e2144cfa1
commit
a24c1cd2be
4
main.py
4
main.py
|
|
@ -88,7 +88,7 @@ async def getuser(get: CL.CL_GET_USER,api_key: APIKey = Depends(auth.get_api_key
|
|||
|
||||
@app.post("/host/get")
|
||||
async def gethost(get: CL.CL_GET_HOST,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
result = database(f"SELECT id FROM `Clients` where `hostname` = '{get.hostname}'",f"{get.dbname}","")
|
||||
result = database(f"SELECT id FROM `Clients` where `Host-Name` = '{get.hostname}'",f"{get.dbname}","")
|
||||
if not result:
|
||||
return False
|
||||
else:
|
||||
|
|
@ -115,7 +115,7 @@ async def getdatabase(get: CL.CL_GET_DATABASE,api_key: APIKey = Depends(auth.get
|
|||
|
||||
@app.post("/host/set")
|
||||
async def sethost(get: CL.CL_SET_HOST,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
database(f"INSERT INTO `{get.dbname}`.Clients (Name,Username,IP-Adresse,Windows-Version,CPU-Name,Prozessor-Anzahl,RAM,Speichergesamt,Speicherfrei,Speicherbelegt) VALUES ('{get.hostname}','{get.user}','{get.ipadresse}','{get.winver}','{get.cpuname}','{get.cores}','{get.ram}','{get.hddtotal}','{get.hddfree}','{get.hddused}')","","")
|
||||
database(f"INSERT INTO `{get.dbname}`.Clients (Host-Name,Username,IP-Adresse,Windows-Version,CPU-Name,Prozessor-Anzahl,RAM,Speichergesamt,Speicherfrei,Speicherbelegt) VALUES ('{get.hostname}','{get.user}','{get.ipadresse}','{get.winver}','{get.cpuname}','{get.cores}','{get.ram}','{get.hddtotal}','{get.hddfree}','{get.hddused}')","","")
|
||||
result = database(
|
||||
f"SELECT id FROM `{get.dbname}`.Clients WHERE hostname = '{get.hostname}')",
|
||||
"", "")
|
||||
|
|
|
|||
Loading…
Reference in New Issue