fix(server): specify request: Request type annotation for FastAPI sync endpoint
This commit is contained in:
+6
-6
@@ -936,20 +936,20 @@ async def import_signed_license(req: Request):
|
|||||||
|
|
||||||
@app.post("/api/license/renew")
|
@app.post("/api/license/renew")
|
||||||
@app.post("/api/license/sync")
|
@app.post("/api/license/sync")
|
||||||
async def trigger_license_renewal(req: Optional[Request] = None):
|
async def trigger_license_renewal(request: Request):
|
||||||
"""
|
"""
|
||||||
Explicitly triggers automated mTLS sync and renewal with logar.eibl.tech.
|
Explicitly triggers automated mTLS sync and renewal with logar.eibl.tech.
|
||||||
Supports picking up seat quota increases and certificate extensions in-flight.
|
Supports picking up seat quota increases and certificate extensions in-flight.
|
||||||
"""
|
"""
|
||||||
requested_seats = None
|
requested_seats = None
|
||||||
seat_increment = 0
|
seat_increment = 0
|
||||||
if req:
|
try:
|
||||||
try:
|
body = await request.json()
|
||||||
body = await req.json()
|
if isinstance(body, dict):
|
||||||
requested_seats = body.get("requested_seats")
|
requested_seats = body.get("requested_seats")
|
||||||
seat_increment = int(body.get("seat_increment", 0))
|
seat_increment = int(body.get("seat_increment", 0))
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
config = SERVER_STATE.get("config", {})
|
config = SERVER_STATE.get("config", {})
|
||||||
cert_dir = config.get("cert_dir", "certs")
|
cert_dir = config.get("cert_dir", "certs")
|
||||||
|
|||||||
Reference in New Issue
Block a user