Remove API key From Console
parent
cdea59a583
commit
55710d4525
|
|
@ -56,6 +56,11 @@ class CL_GET_REPORT_GROUP(BaseModel):
|
|||
group_name: str
|
||||
dbname: str
|
||||
|
||||
class CL_GET_USER_ID(BaseModel):
|
||||
user: str
|
||||
dbname: str
|
||||
|
||||
|
||||
class CL_ADD_REPORT_GROUP(BaseModel):
|
||||
query: str
|
||||
dbname: str
|
||||
|
|
|
|||
16
main.py
16
main.py
|
|
@ -157,6 +157,22 @@ async def get_report_group(get: CL.CL_GET_REPORT_GROUP,api_key: APIKey = Depends
|
|||
else:
|
||||
return result[0][0]
|
||||
|
||||
@app.post("/report/getuserid")
|
||||
async def get_user_id(get: CL.CL_GET_USER_ID,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
result = database(f"SELECT ID FROM `{get.dbname}`.`User` WHERE SamAccountName = '{get.user}'","","")
|
||||
if not result:
|
||||
return False
|
||||
else:
|
||||
return result[0][0]
|
||||
|
||||
@app.post("/report/addusertogroup")
|
||||
async def get_report_group(get: CL.CL_GET_REPORT_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
result = database(f"SELECT ID FROM `{get.dbname}`.`Gruppen` WHERE Name = '{get.group_name}'","","")
|
||||
if not result:
|
||||
return False
|
||||
else:
|
||||
return result[0][0]
|
||||
|
||||
@app.post("/report/addgroup")
|
||||
async def get_addreport_group(get: CL.CL_ADD_REPORT_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
print(database(get.query,get.dbname,""))
|
||||
|
|
|
|||
Loading…
Reference in New Issue