Remove API key From Console
parent
307b06d59a
commit
3a84aa14b9
4
main.py
4
main.py
|
|
@ -86,7 +86,7 @@ async def getuser(get: CL.CL_GET_USER,api_key: APIKey = Depends(auth.get_api_key
|
||||||
else:
|
else:
|
||||||
return result[0][0]
|
return result[0][0]
|
||||||
|
|
||||||
@app.post("/info/gethostname")
|
@app.post("/info/gethost")
|
||||||
async def gethostname(get: CL.CL_GET_HOSTNAME,api_key: APIKey = Depends(auth.get_api_key)):
|
async def gethostname(get: CL.CL_GET_HOSTNAME,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
result = database(f"SELECT hostname FROM `hardware` where `hostname` = '{get.hostname}'",f"{get.dbname}","")
|
result = database(f"SELECT hostname FROM `hardware` where `hostname` = '{get.hostname}'",f"{get.dbname}","")
|
||||||
if not result:
|
if not result:
|
||||||
|
|
@ -94,7 +94,7 @@ async def gethostname(get: CL.CL_GET_HOSTNAME,api_key: APIKey = Depends(auth.get
|
||||||
else:
|
else:
|
||||||
return result[0][0]
|
return result[0][0]
|
||||||
|
|
||||||
@app.post("/info/sethostname")
|
@app.post("/info/sethost")
|
||||||
async def sethostname(get: CL.CL_SET_HOSTNAME,api_key: APIKey = Depends(auth.get_api_key)):
|
async def sethostname(get: CL.CL_SET_HOSTNAME,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
result = database(f"INSERT INTO `{get.dbname}`.hardware (hostname,ipadresse,user,ram,hddused,hddfree,hddtotal) VALUES ({get.hostname},{get.ipadresse},{get.user},{get.ram}),{get.hddused},{get.hddfree},{get.hddtotal})","","")
|
result = database(f"INSERT INTO `{get.dbname}`.hardware (hostname,ipadresse,user,ram,hddused,hddfree,hddtotal) VALUES ({get.hostname},{get.ipadresse},{get.user},{get.ram}),{get.hddused},{get.hddfree},{get.hddtotal})","","")
|
||||||
if not result:
|
if not result:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue