Remove API key From Console
parent
55710d4525
commit
81f44d6432
|
|
@ -60,6 +60,10 @@ class CL_GET_USER_ID(BaseModel):
|
||||||
user: str
|
user: str
|
||||||
dbname: str
|
dbname: str
|
||||||
|
|
||||||
|
class CL_ADD_USER_TO_GROUP(BaseModel):
|
||||||
|
userID: str
|
||||||
|
groupID: str
|
||||||
|
dbname: str
|
||||||
|
|
||||||
class CL_ADD_REPORT_GROUP(BaseModel):
|
class CL_ADD_REPORT_GROUP(BaseModel):
|
||||||
query: str
|
query: str
|
||||||
|
|
|
||||||
4
main.py
4
main.py
|
|
@ -166,8 +166,8 @@ async def get_user_id(get: CL.CL_GET_USER_ID,api_key: APIKey = Depends(auth.get_
|
||||||
return result[0][0]
|
return result[0][0]
|
||||||
|
|
||||||
@app.post("/report/addusertogroup")
|
@app.post("/report/addusertogroup")
|
||||||
async def get_report_group(get: CL.CL_GET_REPORT_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
async def get_addusertogroup(get: CL.CL_ADD_USER_TO_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
result = database(f"SELECT ID FROM `{get.dbname}`.`Gruppen` WHERE Name = '{get.group_name}'","","")
|
result = database(f"INSERT INTO GruppenToUser (UserID,GruppenID) VALUES ({get.userID,get.groupID})")
|
||||||
if not result:
|
if not result:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue