Remove API key From Console
parent
c3ede74122
commit
d870263f02
|
|
@ -118,6 +118,11 @@ class CL_SET_HOST(BaseModel):
|
|||
hddtotal: str
|
||||
ipadresse: str
|
||||
|
||||
class CL_SET_LASTLOGON_USER(BaseModel):
|
||||
userID: int
|
||||
dbname: str
|
||||
lastlogon: str
|
||||
|
||||
class CL_ADD_CLIENT(BaseModel):
|
||||
query: str
|
||||
database: str
|
||||
|
|
|
|||
11
main.py
11
main.py
|
|
@ -118,6 +118,17 @@ async def gethost_user(get: CL.CL_GET_HOST_USER,api_key: APIKey = Depends(auth.g
|
|||
else:
|
||||
return result[0][0]
|
||||
|
||||
@app.post("/info/setlastlogon_user")
|
||||
async def setlastlogon_user(get: CL.CL_SET_LASTLOGON_USER,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
database(f"INSERT INTO `{get.dbname}`.lastlogon (lastlogon) VALUES ('{get.lastlogon}')","","")
|
||||
lastlogonid = database(f"SELECT id FROM `{get.dbname}`.lastlogon WHERE lastlogon = '{get.lastlogon}'","","")
|
||||
result = database(f"INSERT INTO `{get.dbname}`.lastlogon_to_user (userID,lastlogonID) VALUES ('{get.userID}','{get.lastlogon}')", "", "")
|
||||
if not result:
|
||||
return False
|
||||
else:
|
||||
return result[0][0]
|
||||
|
||||
|
||||
@app.post("/info/getclient")
|
||||
async def getclient(get: CL.CL_GET_CLIENT,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
result = database(f"SELECT Firma FROM `Kunden-Clients` where `Client-Name` = '{get.name}'","Stines-GmbH","")
|
||||
|
|
|
|||
Loading…
Reference in New Issue